/* ==========================================================================
   Festimaton — page de réservation (parcours pas à pas)
   ========================================================================== */
.resa { position: relative; isolation: isolate; padding: calc(var(--header-h) + clamp(12px, 2.6vh, 36px)) 0 clamp(32px, 6vh, 64px); }
.resa__bg {
  position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(38% 42% at 8% 18%, rgba(209,15,92,.28), transparent 70%),
    radial-gradient(38% 42% at 94% 30%, rgba(240,208,15,.12), transparent 70%),
    radial-gradient(45% 50% at 80% 100%, rgba(30,150,165,.28), transparent 70%);
}
.resa__wrap { width: min(100% - 2 * var(--gutter), 900px); margin-inline: auto; }

/* --- Fil d'étapes --- */
.resa-progress {
  list-style: none; padding: 0; margin: 0 auto 14px;
  display: flex; justify-content: center; gap: clamp(6px, 2vw, 14px);
  font-size: .88rem; font-weight: 500; color: var(--muted);
}
.resa-progress li { display: flex; align-items: center; gap: 8px; }
.resa-progress li + li::before { content: ""; width: clamp(14px, 4vw, 40px); height: 2px; border-radius: 2px; background: var(--line-strong); margin-right: clamp(0px, 1vw, 6px); }
.resa-progress span {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--panel-2); color: var(--muted); font-size: .8rem; font-weight: 700;
  transition: background .4s, color .4s, transform .4s var(--spring);
}
.resa-progress .is-current { color: var(--text); }
.resa-progress .is-current span { background: var(--grad-warm-deep); color: #fff; transform: scale(1.12); }
.resa-progress .is-done span { background: var(--green); color: var(--ink); }     /* blanc sur ce vert : 2,15:1 */
@media (max-width: 520px) {
  .resa-progress li:not(.is-current) { font-size: 0; gap: 0; }
  .resa-progress li:not(.is-current)::before { margin-right: 6px; }
  .resa-progress li { font-size: .85rem; }
}

/* --- Carte principale --- */
.resa-card {
  position: relative;
  padding: clamp(20px, 3vw, 34px) clamp(20px, 4vw, 44px);
  border-radius: clamp(24px, 3vw, 36px);
  background: linear-gradient(180deg, rgba(255,255,255,.045), transparent 40%), var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  min-height: 380px;
}
.view { display: grid; gap: 12px; }
.view[hidden] { display: none; }
.view h1 { font-size: clamp(1.45rem, 1.05rem + 1.5vw, 2rem); }
.view h2 { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.3rem); }
.view h1:focus, .view h2:focus { outline: none; }
.view__hint { color: var(--muted); margin-top: -4px; font-size: .95rem; }
.view--center { justify-items: center; text-align: center; align-content: center; min-height: 360px; }
.view--center .muted, .view--center .lead { max-width: 52ch; }
.view__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }
/* Téléphone : un bouton par ligne, sur toute la largeur, et son texte peut passer à la ligne. Sans cela, le long
   « Vos dates sont flexibles ? Écrivez-nous » (français) dépassait de la tuile, et tout son contenu se décentrait. */
@media (max-width: 560px) {
  .view__actions { justify-self: stretch; flex-direction: column; }
  .view__actions .btn { white-space: normal; text-align: center; }
}
.view-enter { animation: view-in .55s var(--ease-out) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }

.view__badge {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  color: #fff; box-shadow: 0 14px 30px -12px rgba(0,0,0,.7);
}
.view__badge svg { width: 32px; height: 32px; stroke-width: 3; }
.view__badge--ok { background: var(--grad-cool); animation: pop .7s var(--spring) both .1s; }
.view__badge--party { width: 92px; height: 92px; background: var(--grad-warm); animation: pop .8s var(--spring) both .05s; }
.view__badge--party svg { width: 46px; height: 46px; }
@keyframes pop { from { transform: scale(0) rotate(-30deg); } }

.link-btn { margin-left: 10px; }     /* le reste dans site.css */
.resa-dates { color: var(--soft); font-weight: 500; }

/* --- Récapitulatif + bouton --- */
.resa-summary {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px;
  margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line);
}
.resa-summary__text { display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--soft); min-height: 48px; }
.resa-summary__text svg { width: 22px; height: 22px; color: var(--orange); flex: none; }
.resa-summary__text small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
@media (max-width: 560px) {
  .resa-summary { flex-direction: column; align-items: stretch; gap: 10px; }
  .resa-summary .btn { width: 100%; }
  /* sur mobile, le récapitulatif et le bouton restent à portée de pouce */
  .resa-summary {
    position: sticky; bottom: 0; z-index: 5;
    margin: 6px calc(-1 * clamp(20px, 4vw, 44px)) calc(-1 * clamp(20px, 3vw, 34px));
    padding: 14px clamp(20px, 4vw, 44px) calc(14px + env(safe-area-inset-bottom));
    background: rgba(31, 27, 43, .94);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-radius: 0 0 24px 24px;
  }
  .resa-summary__text { min-height: 0; font-size: .95rem; }
}
/* Le récapitulatif collant cache ce qui passe derrière lui : le défilement au clavier s'arrête au-dessus de lui
   (WCAG 2.4.11), et dans une fenêtre très basse (fort zoom) il ne colle plus, il prendrait presque tout l'écran */
@media (max-width: 560px) and (min-height: 501px) { html { scroll-padding-bottom: calc(160px + env(safe-area-inset-bottom)); } }
@media (max-width: 560px) and (max-height: 500px) { .resa-summary { position: static; } }

/* --------------------------------------------------------------------------
   Calendrier : sélection du début et de la fin dans un seul widget
   -------------------------------------------------------------------------- */
.cal { --cell: clamp(36px, 10.5vw, 41px); user-select: none; -webkit-user-select: none; }
.cal__head { position: relative; margin-bottom: 8px; }
.cal__titles { display: grid; grid-template-columns: repeat(var(--months, 2), minmax(0, 1fr)); gap: clamp(20px, 4vw, 44px); }
.cal__titles span { text-align: center; font-size: 1rem; font-weight: 700; line-height: 38px; text-transform: capitalize; }
.cal__head button {
  position: absolute; top: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.07); color: var(--text); transition: background .2s, transform .3s var(--spring);
}
.cal__head button[data-prev] { left: 0; }
.cal__head button[data-next] { right: 0; }
.cal__head button:hover:not(:disabled) { background: rgba(255,255,255,.14); transform: scale(1.06); }
.cal__head button:disabled { opacity: .25; cursor: default; }
.cal__head svg { width: 20px; height: 20px; }
.cal__months { display: grid; grid-template-columns: repeat(var(--months, 2), minmax(0, 1fr)); gap: clamp(20px, 4vw, 44px); }
.cal__dow, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__dow { margin-bottom: 4px; }
.cal__dow span { text-align: center; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.cal__grid { row-gap: 2px; }

.cal__cell { position: relative; display: grid; place-items: center; height: var(--cell); }
.cal__cell::before {                 /* bande de la période */
  content: ""; position: absolute; top: 3px; bottom: 3px; left: 0; right: 0;
  background: transparent; transition: background-color .2s;
}
/* la période choisie : un fond, et un liseré orange en haut et en bas qui la délimite (le fond seul ne donnait que
   1,36:1 sur le panneau ; le liseré, 6:1) */
.cal__cell.is-range::before, .cal__cell.is-start.has-end::before, .cal__cell.is-end:not(.is-start)::before {
  background: rgba(238,125,10,.24); border-block: 1.5px solid var(--orange);
}
.cal__cell.is-preview::before, .cal__cell.is-preview-start::before, .cal__cell.is-preview-end::before { background: rgba(238,125,10,.1); }
/* arrondis en bout de semaine */
.cal__grid .cal__cell:nth-child(7n+1)::before { left: 4px; border-radius: 999px 0 0 999px; }
.cal__grid .cal__cell:nth-child(7n)::before { right: 4px; border-radius: 0 999px 999px 0; }
/* le premier et le dernier jour : la bande part du milieu du jour (après les arrondis, qui ne la rallongent pas) */
.cal__grid .cal__cell.is-start.has-end::before, .cal__grid .cal__cell.is-preview-start::before { left: 50%; }
.cal__grid .cal__cell.is-end:not(.is-start)::before, .cal__grid .cal__cell.is-preview-end::before { right: 50%; }
.cal__grid .cal__cell.is-start.has-end:nth-child(7n)::before, .cal__grid .cal__cell.is-preview-start:nth-child(7n)::before,
.cal__grid .cal__cell.is-end:not(.is-start):nth-child(7n+1)::before, .cal__grid .cal__cell.is-preview-end:nth-child(7n+1)::before { display: none; }

.cal__day {
  position: relative; z-index: 1;
  width: calc(var(--cell) - 4px); height: calc(var(--cell) - 4px); border: 0; border-radius: 50%;
  background: none; font-weight: 500; font-size: .98rem; font-variant-numeric: tabular-nums;
  transition: background-color .2s, color .2s, transform .3s var(--spring);
}
.cal__day:hover { background: rgba(255,255,255,.1); }
.cal__day:active { transform: scale(.9); }
.cal__cell.is-today .cal__day::after {
  content: ""; position: absolute; left: 50%; bottom: 6px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--yellow);
}
.cal__cell.is-start .cal__day, .cal__cell.is-end .cal__day {
  background: var(--grad-warm-deep); color: #fff; font-weight: 700;
  box-shadow: 0 8px 18px -8px rgba(209,15,92,.9);
}
.cal__cell.is-start .cal__day { animation: day-pick .45s var(--spring); }
@keyframes day-pick { from { transform: scale(.6); } }
.cal__cell.is-past .cal__day, .cal__day:disabled { color: rgba(255,255,255,.22); cursor: default; background: none; }
.cal__cell.is-empty { visibility: hidden; }
.cal__noscript { color: var(--soft); }


/* --------------------------------------------------------------------------
   Vérification : l'obturateur tourne
   -------------------------------------------------------------------------- */
.shutter { width: 120px; height: 120px; margin-bottom: 8px; }
.shutter img { width: 100%; height: 100%; animation: shutter 1.1s var(--ease-out) infinite; }
@keyframes shutter {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(140deg) scale(.82); }
  100% { transform: rotate(360deg) scale(1); }
}

/* --------------------------------------------------------------------------
   Formulaire
   -------------------------------------------------------------------------- */
.resa-form { display: grid; gap: 18px; margin-top: 8px; }
.resa-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 640px) { .resa-form__row { grid-template-columns: 1fr; } }
.opt { font-weight: 400; color: var(--muted); }

.pills { border: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pills--4 { grid-template-columns: repeat(4, 1fr); }
.pills--2 { grid-template-columns: repeat(2, 1fr); }
.pills .field__error { grid-column: 1 / -1; }
.pills.has-error .pill span { border-color: rgba(229,36,33,.7); }
/* Champs obligatoires : signalés par une étiquette, et tant qu'ils sont vides, un contour qui respire aux couleurs
   de l'accent (reservation.js, .is-todo) ; en erreur, le rouge l'emporte ; rien ne bouge sous « mouvement réduit » */
.req {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; vertical-align: 2px;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--orange); background: rgba(238,125,10,.14);
}
.opt.is-req { color: var(--orange); font-weight: 600; }
/* Trois souffles, puis un contour orange fixe : une animation sans fin de l'ombre (que la carte graphique ne sait pas
   animer seule) occupait 44 % du processeur d'un téléphone lent, tout le temps passé sur le formulaire */
.field.is-todo .input, .pills.is-todo .pill span {
  border-color: rgba(238,125,10,.65);
  animation: requis 2.6s ease-in-out 3;
}
.pills.is-todo .pill:nth-of-type(2) span { animation-delay: .25s; }
.field.is-todo .input:focus, .field.has-error .input, .pills.has-error .pill span { animation: none; }
.field.is-todo.has-error .input { border-color: var(--red); }
.pills.is-todo.has-error .pill span { border-color: rgba(229,36,33,.7); }
@keyframes requis {
  0%, 100% { box-shadow: 0 0 0 0 rgba(238,125,10,0); }
  50% { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(238,125,10,.2), 0 0 22px -2px rgba(209,15,92,.35); }
}
@media (prefers-reduced-motion: reduce) { .field.is-todo .input, .pills.is-todo .pill span { animation: none; } }
@media (max-width: 760px) { .pills--4 { grid-template-columns: repeat(2, 1fr); } }
.pills legend { font-weight: 600; font-size: .95rem; margin-bottom: 8px; padding: 0; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: grid; gap: 2px; height: 100%;
  padding: 12px 16px; border-radius: 16px; border: 1.5px solid var(--field-line);
  background: rgba(255,255,255,.03);
  transition: border-color .2s, background-color .2s, transform .3s var(--spring);
}
.pill strong { font-weight: 600; }
.pill em { font-style: normal; font-size: .85rem; color: var(--muted); }
.pill:hover span { border-color: rgba(255,255,255,.6); }
.pill input:checked + span {
  border-color: var(--orange); background: rgba(238,125,10,.12);
  transform: translateY(-2px);
}
.pill input:checked + span strong::after { content: " ✓"; color: var(--orange); }
.pill input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
@media (max-width: 560px) {
  .pills, .pills--4, .pills--2 { grid-template-columns: 1fr; }
  .pill span { grid-auto-flow: column; justify-content: space-between; align-items: center; gap: 12px; }
  .pill em { text-align: right; }
}

/* Type d'évènement : liste maison, mêmes couleurs que les suggestions du lieu */
.select-btn {
  display: block; text-align: left; cursor: pointer; padding-right: 48px; font-style: normal;
  background: rgba(255,255,255,.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a39cb6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 16px center / 18px no-repeat;
}
.select-btn.is-empty { color: rgba(255,255,255,.55); font-style: italic; }
.select-btn[aria-expanded="true"] { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(238,125,10,.2); }
.combo__list li[role="option"].is-chosen::after { content: "✓"; color: var(--orange); font-weight: 700; }

/* Distance et frais de livraison, sous le lieu */
.resa-distance {
  display: block; line-height: 1.55;
  padding: 10px 14px; border-radius: 12px; font-size: .92rem;
  background: rgba(30,150,165,.12); border: 1px solid rgba(30,150,165,.35); color: var(--soft);
}
.resa-distance strong { color: var(--text); }
.resa-distance__credit { display: block; margin-top: 4px; font-size: .7rem; opacity: .7; }
.resa-distance.is-far { background: rgba(240,208,15,.1); border-color: rgba(240,208,15,.45); }
.resa-distance.is-pending { opacity: .7; }

/* Lieu : suggestions de communes (geo.api.gouv.fr) */
.combo { position: relative; }
.combo__list {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  list-style: none; margin: 0; padding: 6px; max-height: 300px; overflow-y: auto;
  border-radius: 16px; background: #2b2540; border: 1px solid var(--line-strong);
  box-shadow: 0 24px 50px -16px rgba(0,0,0,.8);
}
.combo__list li[role="option"] {
  display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 11px; cursor: pointer;
}
.combo__list li[role="option"] span { color: var(--muted); font-variant-numeric: tabular-nums; }
.combo__list li[role="option"]:hover, .combo__list li[aria-selected="true"] { background: rgba(238,125,10,.18); }
.combo__list li[aria-selected="true"] span { color: var(--soft); }
.combo__empty { padding: 10px 14px; color: var(--muted); font-size: .9rem; }

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.resa-form__foot { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px 24px; margin-top: 4px; }
/* Le total estimé, à gauche du bouton d'envoi (le texte d'engagement passe au-dessus, sur toute la largeur) :
   formule + livraison, ou « sur devis » */
.resa-total {
  display: grid; justify-items: end; justify-self: end; gap: 0; margin: 0; text-align: right; line-height: 1.25;
}
.resa-total__label { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.resa-total__amount { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.resa-total__amount.is-quote { font-size: 1.15rem; color: var(--soft); }
.resa-total__detail { font-size: .8rem; color: var(--muted); max-width: 30ch; }
/* Téléphone : le total et le bouton d'envoi restent à portée de pouce pendant qu'on remplit le formulaire, en bandeau
   collé en bas de l'écran, comme le récapitulatif de l'étape des dates, jusqu'à leur place à la fin du formulaire ;
   le texte d'engagement reste au-dessus, dans le formulaire (demande du 2026-11-23). Le pied est un enfant direct du
   formulaire : il colle sur toute sa hauteur. Dans une fenêtre très basse (fort zoom, clavier ouvert sur Android), il
   ne colle plus. */
@media (max-width: 560px) {
  .resa-form__foot {
    position: sticky; bottom: 0; z-index: 5;
    gap: 12px;
    margin: 0 calc(-1 * clamp(20px, 4vw, 44px)) calc(-1 * clamp(20px, 3vw, 34px));
    padding: 12px clamp(20px, 4vw, 44px) calc(12px + env(safe-area-inset-bottom));
    background: rgba(31, 27, 43, .94);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    border-radius: 0 0 24px 24px;
  }
  /* Deux étages (choix du 2026-11-23) : en haut le total, l'étiquette et le montant sur une ligne, le détail dessous
     sur toute la largeur ; en bas le bouton, sur toute la largeur, comme sur l'étape des dates. À côté du bouton, le
     détail montait sur quatre lignes. */
  .resa-form__foot { grid-template-columns: 1fr; gap: 10px; }
  .resa-total {
    grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px;
    justify-items: start; justify-self: stretch; text-align: left; line-height: 1.2;
  }
  .resa-total__label { font-size: .72rem; }
  .resa-total__amount { font-size: 1.3rem; }
  .resa-total__amount.is-quote { font-size: 1rem; }
  .resa-total__detail { grid-column: 1 / -1; font-size: .75rem; max-width: none; }
  .resa-form__foot .btn--send { width: 100%; min-height: 50px; font-size: 1rem; }
}
@media (max-width: 560px) and (max-height: 500px) { .resa-form__foot { position: static; } }
.resa-form__legal { margin: 0; font-size: .85rem; color: var(--muted); }
.resa-form__legal a { color: var(--soft); }
.btn--send { min-height: 56px; padding-inline: 1.8em; font-size: 1.05rem; }
.btn--send.is-sending { pointer-events: none; }
.btn--send.is-sending span::after { content: "…"; }
.btn--send.is-sending svg { animation: send-fly 1s var(--ease-out) infinite; }
@keyframes send-fly { 50% { transform: translate(4px, -4px); opacity: .4; } }
@media (max-width: 560px) { .btn--send { width: 100%; } }

.resa-form__error {
  padding: 14px 18px; border-radius: 14px;
  background: rgba(229,36,33,.12); border: 1px solid rgba(229,36,33,.4); color: #ffc9c4;
}
.resa-form__error a { color: #fff; font-weight: 600; }
.field.has-error .field__error { margin-top: -2px; }

/* --------------------------------------------------------------------------
   Indisponible : un tirage « complet » qui tombe
   -------------------------------------------------------------------------- */
.oops { width: 190px; height: 196px; display: grid; place-items: center; margin-bottom: 4px; }
.oops__print {
  width: 146px; height: 184px; padding: 8px 8px 0; border-radius: 3px; background: var(--paper);
  transform: rotate(-8deg); box-shadow: 0 18px 30px -12px rgba(0,0,0,.8);
  display: grid; grid-template-rows: 1fr auto;
  animation: oops-drop .9s var(--spring) both;
}
/* la photo du tirage : la borne déjà à une autre fête, chapeau pointu et lunettes (sans texte : une image pour toutes les langues) */
.oops__print::before {
  content: ""; border-radius: 2px;
  background: #3d2a55 url("/assets/img/oups-fete.webp") center / cover;
}
.oops__print span { color: var(--red); text-align: center; font-size: 1.3rem; padding: 2px 0 4px; }
@keyframes oops-drop { from { transform: translateY(-40px) rotate(12deg); opacity: 0; } }

/* --------------------------------------------------------------------------
   Envoyé
   -------------------------------------------------------------------------- */
.resa-recap { color: var(--soft); font-weight: 500; padding: 10px 18px; border-radius: 999px; background: rgba(255,255,255,.06); }
.resa-recap:empty { display: none; }

/* Confettis (canvas plein écran, ajouté par confetti.js) */
.confetti-canvas { position: fixed; inset: 0; z-index: 300; pointer-events: none; width: 100%; height: 100%; }

/* --------------------------------------------------------------------------
   Réassurance sous la carte
   -------------------------------------------------------------------------- */
.resa-reassure {
  list-style: none; padding: 0; margin-top: 22px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px;
  font-size: .9rem; color: var(--muted);
}
.resa-reassure li { display: inline-flex; align-items: center; gap: 8px; }
.resa-reassure svg { width: 18px; height: 18px; color: var(--green); }
.resa-reassure a { color: var(--soft); font-weight: 600; text-decoration: none; }

/* Erreur sous le calendrier (période refusée, date passée) */
.resa-summary + .resa-form__error { margin-top: 14px; }
.resa-form__error .link-btn { margin-left: 0; color: #fff; font-weight: 600; }   /* dans la phrase : pas de marge avant le mot */

/* Contraste élevé de Windows (couleurs forcées) : la période choisie et l'étape en cours, qui n'étaient marquées que
   par des fonds (effacés dans ce mode), prennent la couleur de sélection du système */
@media (forced-colors: active) {
  .cal__cell.is-start .cal__day, .cal__cell.is-end .cal__day,
  .resa-progress .is-current span { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .cal__cell.is-range .cal__day { outline: 2px solid Highlight; outline-offset: -3px; }
}
