.av-resa-booking {
    --avresa-text: #1e293b;
    --avresa-surface: #ffffff;
    --avresa-accent: #2563eb;
    --avresa-muted: #64748b;
    --avresa-border: #e2e8f0;
    /* Valeurs de repli — en pratique toujours fournies en style inline par
       booking-form.php (couleurs effectives réglages généraux / planning). */
    --avresa-numbers-color: #ffffff;
    --avresa-button-color: var(--avresa-accent);
    --avresa-button-text-color: #ffffff;
    --avresa-nav-color: var(--avresa-muted);
    --avresa-nav-text-color: #ffffff;
    --avresa-selection-color: var(--avresa-accent);
    max-width: 640px;
    margin: 0 auto;
    font-family: inherit;
    color: var(--avresa-text);
}

.av-resa-card {
    background: var(--avresa-surface);
    border: 1px solid var(--avresa-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.av-resa-card h2 { margin-top: 0; font-size: 1.2rem; }
/* Spécificité volontairement plus élevée que la règle ci-dessus (2 classes + élément
   contre 1) pour être sûr de l'emporter — les deux titres d'étape ("Choisissez vos
   dates de séjour" et "Vos informations") sont traités de façon identique : taille
   réglable (Réglages généraux + surcharge par planning) et centrage optionnel. */
.av-resa-card h2.av-resa-step-title { font-size: var(--avresa-step-title-font-size, 1.2rem); }
.av-resa-card h2.av-resa-step-title.is-centered { text-align: center; }
.av-resa-min-nights-hint { margin: -8px 0 12px; font-size: 13px; color: var(--avresa-muted); }

/* ── Navigation calendrier ───────────────────────────────────────────────── */
.av-resa-calendar-wrap { position: relative; }
.av-resa-calendar-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.7);
    border-radius: 8px;
    z-index: 5;
}
/* Une règle d'auteur (même de faible spécificité) l'emporte toujours sur la règle
   [hidden] { display: none } de la feuille de style du navigateur (même bug que la
   modale admin, cf. 1.0.1) : sans cette surcharge, le voile reste affiché en
   permanence, attribut hidden ou pas — le sablier tournerait indéfiniment. */
.av-resa-calendar-loading[hidden] {
    display: none;
}
.av-resa-calendar-loading::after {
    content: '';
    width: 26px;
    height: 26px;
    border: 3px solid var(--avresa-muted);
    border-right-color: transparent;
    border-radius: 50%;
    animation: av-resa-spin .6s linear infinite;
}
.av-resa-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 600;
}
.av-resa-calendar-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--avresa-nav-color);
    color: var(--avresa-nav-text-color);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    font-size: 16px;
}
.av-resa-calendar-nav button:disabled { opacity: .4; cursor: default; }

.av-resa-cal-weekdays, .av-resa-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    /* Grille plafonnée en largeur totale plutôt que chaque case individuellement :
       évite toute ambiguïté navigateur entre width/max-width et aspect-ratio sur
       un item de grille "stretch", qui laissait les cases s'étirer sur toute la
       largeur de la carte au lieu de rester petites. */
    max-width: 322px;
    margin-left: auto;
    margin-right: auto;
}
.av-resa-cal-weekdays span {
    text-align: center;
    font-size: 12px;
    color: var(--avresa-muted);
    text-transform: uppercase;
}
.av-resa-cal-days { margin-top: 4px; }
.av-resa-cal-empty { visibility: hidden; }

.av-resa-cal-day {
    box-sizing: border-box;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    color: var(--avresa-numbers-color);
    text-shadow: 0 1px 1px rgba(0,0,0,.25);
    transition: box-shadow .1s ease;
}
.av-resa-cal-day:hover:not(.is-disabled) { box-shadow: 0 0 0 2px var(--avresa-selection-color); }
.av-resa-cal-day.is-disabled { opacity: .35; cursor: not-allowed; }
.av-resa-cal-day.is-start, .av-resa-cal-day.is-end {
    outline: 3px solid var(--avresa-selection-color);
    outline-offset: -1px;
}
.av-resa-cal-day.is-in-range { box-shadow: inset 0 0 0 2px var(--avresa-selection-color); }

.av-resa-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    font-size: 12px;
    color: var(--avresa-muted);
}
.av-resa-legend li { display: flex; align-items: center; gap: 6px; }
.av-resa-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}

.av-resa-selection-recap {
    margin: 4px 0 16px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}
.av-resa-continue {
    display: block;
    width: 100%;
    margin-top: 20px;
    background: var(--avresa-button-color);
    color: var(--avresa-button-text-color);
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
/* Invisible tant qu'aucune période valide n'est sélectionnée, mais l'espace reste
   réservé (visibility, pas display) : rien ne bouge autour quand le bouton apparaît. */
.av-resa-continue:disabled { visibility: hidden; cursor: default; }

/* ── Formulaire ──────────────────────────────────────────────────────────── */
.av-resa-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .av-resa-form-grid { grid-template-columns: 1fr; } }

/* Type de champ "Texte seul" : une phrase informative, ex. pour introduire un
   groupe de cases à cocher juste en dessous — pas d'espacement de champ classique. */
.av-resa-field-heading { margin: 14px 0 6px; font-weight: 600; font-size: 13px; }

.av-resa-field { margin-bottom: 14px; }
.av-resa-field--full { grid-column: 1 / -1; }
.av-resa-field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.av-resa-field input[type="text"],
.av-resa-field input[type="email"],
.av-resa-field input[type="tel"],
.av-resa-field select,
.av-resa-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--avresa-border);
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.av-resa-checkbox-label { display: flex; align-items: center; gap: 6px; font-weight: normal; }
/* Disposition "au-dessus" pour une case à cocher : libellé sur sa propre ligne,
   case en dessous (comportement historique) — au lieu de la ligne unique par défaut. */
.av-resa-checkbox-label.is-stacked { flex-direction: column; align-items: flex-start; gap: 4px; }

/* Disposition "à la suite" / "devant le champ" (champs personnalisés) : libellé et
   champ sur la même ligne, au lieu du libellé au-dessus par défaut. Seul l'ordre
   d'affichage (avant/après) change entre les deux, déterminé côté PHP. */
.av-resa-field--row { display: flex; align-items: center; gap: 8px; }
.av-resa-field--row label { display: inline; margin-bottom: 0; white-space: nowrap; flex-shrink: 0; }
.av-resa-field--row input[type="text"],
.av-resa-field--row input[type="email"],
.av-resa-field--row input[type="tel"],
.av-resa-field--row select,
.av-resa-field--row textarea {
    width: auto;
    flex: 1;
}
.av-resa-gdpr-consent {
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 16px;
    font-size: 13px;
    color: var(--avresa-muted);
    line-height: 1.4;
}
.av-resa-gdpr-consent input { margin-top: 3px; flex-shrink: 0; }

.av-resa-btn-submit {
    width: 100%;
    background: var(--avresa-button-color);
    color: var(--avresa-button-text-color);
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.av-resa-btn-submit:disabled { opacity: .6; cursor: default; }

.av-resa-submit-error {
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.av-resa-nav { text-align: left; }
.av-resa-btn-back {
    background: none;
    border: none;
    color: var(--avresa-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
}

.av-resa-confirmation {
    text-align: center;
    padding: 24px 8px;
    font-size: 16px;
}

/* ── Indicateur "opération en cours" ──────────────────────────────────────
   Petit rond qui tourne, ajouté après le texte du bouton (currentColor pour
   suivre la couleur de texte configurée du bouton), sans masquer le libellé. */
.av-resa-loading {
    position: relative;
    padding-right: 34px !important;
}
.av-resa-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    opacity: .75;
    animation: av-resa-spin .6s linear infinite;
}
@keyframes av-resa-spin {
    to { transform: rotate(360deg); }
}
