/* =============================================================
   Balade Gourmande - Styles
   Palette : vert olive, beige, brun, tons terreux/nature
   ============================================================= */

/* -- Variables CSS -- */
:root {
    --vert-olive: #65734E;
    --vert-olive-clair: #7d8c64;
    --vert-olive-fonce: #4d5a3a;
    --brun: #8B6D4E;
    --brun-clair: #a68a6a;
    --beige: #f5f0e8;
    --beige-clair: #faf7f2;
    --beige-fonce: #e8e0d4;
    --terre: #3d3528;
    --terre-clair: #5a5040;
    --blanc: #ffffff;
    --erreur: #c0392b;
    --erreur-bg: #fde8e8;
    --succes: #27ae60;
    --succes-bg: #e8f8f0;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 12px rgba(61, 53, 40, 0.08);
    --shadow-lg: 0 4px 24px rgba(61, 53, 40, 0.12);
    --transition: 0.2s ease;
}

/* -- Reset et base -- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: var(--beige);
    color: var(--terre);
    line-height: 1.6;
    min-height: 100vh;
}

/* -- Conteneur principal -- */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* -- En-tete -- */
.header {
    text-align: center;
    padding: 40px 20px 30px;
    margin-bottom: 8px;
}

.header__title {
    font-size: 2.4rem;
    color: var(--vert-olive);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.header__subtitle {
    font-size: 1.05rem;
    color: var(--terre-clair);
    font-weight: 400;
}

.header__dates {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.header__date-badge {
    background-color: var(--vert-olive);
    color: var(--blanc);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* -- Carte formulaire -- */
.form-card {
    background: var(--blanc);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 24px;
}

.form-card__title {
    font-size: 1.3rem;
    color: var(--vert-olive);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--beige-fonce);
}

/* -- Grille 2 colonnes coordonnées -- */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* -- Champs de formulaire -- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--terre);
    margin-bottom: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.form-group label .required {
    color: var(--erreur);
    margin-left: 2px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--beige-fonce);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--terre);
    background-color: var(--beige-clair);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--vert-olive);
    box-shadow: 0 0 0 3px rgba(101, 115, 78, 0.15);
}

.form-group input.is-invalid {
    border-color: var(--erreur);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

/* -- Sélecteur de créneaux horaires -- */
.slot-section {
    margin-bottom: 4px;
}

.slot-section__label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--terre);
    margin-bottom: 12px;
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.slot-days {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.slot-day__label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--brun);
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.slot-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.slot-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: var(--blanc);
    border: 2px solid var(--beige-fonce);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    color: var(--terre);
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all var(--transition);
    min-width: 76px;
    line-height: 1.2;
}

.slot-btn:hover:not(:disabled) {
    background: var(--vert-olive);
    border-color: var(--vert-olive);
    color: var(--blanc);
}

.slot-btn--active {
    background: var(--vert-olive);
    border-color: var(--vert-olive);
    color: var(--blanc);
}

.slot-btn--full {
    background: var(--beige-fonce);
    border-color: var(--beige-fonce);
    color: var(--terre-clair);
    cursor: not-allowed;
    opacity: 0.65;
}

.slot-full-label {
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 2px;
}

/* -- Inputs quantité (+/-) -- */
.qty-input {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--beige-fonce);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--blanc);
}

.qty-btn {
    width: 38px;
    height: 40px;
    background: var(--beige-clair);
    border: none;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--terre);
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
    line-height: 1;
}

.qty-btn:hover {
    background: var(--beige-fonce);
}

.qty-input input[type="number"] {
    width: 54px;
    height: 40px;
    border: none;
    border-left: 1.5px solid var(--beige-fonce);
    border-right: 1.5px solid var(--beige-fonce);
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--terre);
    background: var(--blanc);
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qty-input input[type="number"]::-webkit-outer-spin-button,
.qty-input input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.qty-hint {
    font-size: 0.82rem;
    margin-top: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.qty-hint--warn {
    color: var(--brun);
}

/* -- Lignes d'options -- */
.option-group-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--terre-clair);
    margin: 18px 0 10px;
    padding-top: 14px;
    border-top: 1px solid var(--beige-fonce);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.78rem;
}

.option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--beige-fonce);
}

.option-row:last-of-type {
    border-bottom: none;
}

.option-row__info {
    flex: 1;
}

.option-row__name {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--terre);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.option-row__detail {
    font-size: 0.82rem;
    color: var(--terre-clair);
    margin-top: 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.option-row__price {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brun);
    margin-top: 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.option-warning {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--erreur-bg);
    border: 1px solid var(--erreur);
    border-radius: var(--radius);
    font-size: 0.86rem;
    color: var(--erreur);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* -- Récapitulatif confirmation -- */
.confirmation__summary {
    background: var(--beige-clair);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 12px;
}

.conf-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.93rem;
    border-bottom: 1px solid var(--beige-fonce);
}

.conf-summary-row:last-child {
    border-bottom: none;
}

.conf-summary-row strong {
    color: var(--terre-clair);
    font-weight: 600;
}

/* -- Section participant (ancienne, conservée pour compatibilité) -- */
.entry-block {
    background: var(--beige-clair);
    border: 1.5px solid var(--beige-fonce);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    position: relative;
    transition: border-color var(--transition);
}

.entry-block:hover {
    border-color: var(--brun-clair);
}

.entry-block__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.entry-block__number {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--vert-olive);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.entry-block__remove {
    background: none;
    border: 1.5px solid var(--erreur);
    color: var(--erreur);
    padding: 4px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all var(--transition);
}

.entry-block__remove:hover {
    background: var(--erreur);
    color: var(--blanc);
}

/* -- Radio groups -- */
.radio-section {
    margin-bottom: 16px;
}

.radio-section__label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--terre);
    margin-bottom: 8px;
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.radio-group--day-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--brun);
    margin: 8px 0 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.radio-group--day-label:first-child {
    margin-top: 0;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1.5px solid var(--beige-fonce);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--blanc);
}

.radio-option:hover {
    border-color: var(--vert-olive-clair);
    background: rgba(101, 115, 78, 0.04);
}

.radio-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--beige-fonce);
    border-radius: 50%;
    margin-right: 10px;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    position: relative;
}

.radio-option input[type="radio"]:checked {
    border-color: var(--vert-olive);
    background-color: var(--vert-olive);
}

.radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blanc);
}

.radio-option--selected {
    border-color: var(--vert-olive);
    background: rgba(101, 115, 78, 0.06);
}

.radio-option__text {
    font-size: 0.95rem;
    color: var(--terre);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.radio-option__price {
    margin-left: auto;
    font-weight: 600;
    color: var(--brun);
    font-size: 0.92rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* -- Bouton ajouter participant -- */
.btn-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--blanc);
    border: 2px dashed var(--vert-olive-clair);
    border-radius: var(--radius-lg);
    color: var(--vert-olive);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin-bottom: 24px;
}

.btn-add:hover {
    background: rgba(101, 115, 78, 0.06);
    border-color: var(--vert-olive);
}

.btn-add__icon {
    font-size: 1.3rem;
    line-height: 1;
}

/* -- Zone total -- */
.total-bar {
    background: var(--blanc);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px 32px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-bar__label {
    font-size: 1.1rem;
    color: var(--terre);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.total-bar__amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--vert-olive);
}

/* -- Message info -- */
.info-message {
    background: rgba(101, 115, 78, 0.08);
    border-left: 4px solid var(--vert-olive);
    padding: 12px 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--terre-clair);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
}

/* -- Bouton soumettre -- */
.btn-submit {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: var(--vert-olive);
    color: var(--blanc);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0.3px;
}

.btn-submit:hover {
    background: var(--vert-olive-fonce);
    box-shadow: var(--shadow-lg);
}

.btn-submit:disabled {
    background: var(--beige-fonce);
    color: var(--terre-clair);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-submit--loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-submit--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--blanc);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* -- Messages d'erreur -- */
.error-list {
    background: var(--erreur-bg);
    border: 1px solid var(--erreur);
    border-radius: var(--radius);
    padding: 16px 16px 16px 20px;
    margin-bottom: 24px;
    display: none;
}

.error-list.visible {
    display: block;
}

.error-list__title {
    color: var(--erreur);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.error-list ul {
    list-style: none;
    padding: 0;
}

.error-list li {
    color: var(--erreur);
    font-size: 0.9rem;
    padding: 2px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.error-list li::before {
    content: '- ';
}

/* -- Page de confirmation -- */
.confirmation {
    display: none;
}

.confirmation.visible {
    display: block;
}

.confirmation__icon {
    text-align: center;
    margin-bottom: 16px;
}

.confirmation__icon svg {
    width: 64px;
    height: 64px;
}

.confirmation__title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--vert-olive);
    margin-bottom: 8px;
}

.confirmation__subtitle {
    text-align: center;
    color: var(--terre-clair);
    margin-bottom: 24px;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.confirmation__ref {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--brun);
    margin-bottom: 24px;
    padding: 12px;
    background: var(--beige-clair);
    border-radius: var(--radius);
}

.confirmation__section {
    margin-bottom: 20px;
}

.confirmation__section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--vert-olive);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1.5px solid var(--beige-fonce);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.confirmation__table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.92rem;
}

.confirmation__table th {
    background: var(--vert-olive);
    color: var(--blanc);
    padding: 8px 10px;
    text-align: left;
    font-weight: 500;
    font-size: 0.85rem;
}

.confirmation__table th:last-child {
    text-align: right;
}

.confirmation__table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--beige-fonce);
}

.confirmation__table td:last-child {
    text-align: right;
    font-weight: 600;
}

.confirmation__table tr:nth-child(even) {
    background: var(--beige-clair);
}

.confirmation__total {
    text-align: right;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--vert-olive);
    margin: 12px 0 20px;
}

.confirmation__payment {
    background: var(--beige-clair);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.confirmation__payment p {
    margin: 4px 0;
    font-size: 0.95rem;
}

.confirmation__payment strong {
    color: var(--terre);
}

.confirmation__qr {
    text-align: center;
    margin: 20px 0;
}

.confirmation__qr img {
    max-width: 200px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.confirmation__qr-label {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--terre-clair);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.confirmation__email-notice {
    text-align: center;
    font-size: 0.95rem;
    color: var(--terre-clair);
    margin: 16px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.btn-new {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: none;
    color: var(--vert-olive);
    border: 2px solid var(--vert-olive);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin-top: 24px;
}

.btn-new:hover {
    background: var(--vert-olive);
    color: var(--blanc);
}

/* -- Contact -- */
.contact {
    text-align: center;
    padding: 16px;
    color: var(--terre-clair);
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* -- Responsive -- */
@media (max-width: 640px) {
    .container {
        padding: 12px 12px 32px;
    }

    .header {
        padding: 28px 16px 20px;
    }

    .header__title {
        font-size: 1.8rem;
    }

    .form-card {
        padding: 20px 16px;
    }

    .entry-block {
        padding: 16px;
    }

    .total-bar {
        padding: 16px 20px;
    }

    .total-bar__amount {
        font-size: 1.3rem;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .slot-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-width: 66px;
    }

    .option-row {
        gap: 8px;
    }

    .confirmation__table {
        font-size: 0.82rem;
    }

    .confirmation__table th,
    .confirmation__table td {
        padding: 6px 6px;
    }
}
