/* ══════════════════════════════════════════════════════════════
   Palette & tokens — MODIFIE ICI pour changer toutes les couleurs
   ══════════════════════════════════════════════════════════════ */
/* ── Thème « sauge »
   Les valeurs ci-dessous sont les équivalents hex, pour les navigateurs qui ne
   connaissent pas oklch(). Le bloc @supports juste en dessous les remplace par
   les vraies valeurs oklch. MODIFIE ICI (les deux blocs) pour changer l'ambiance. */
:root {
  --bg-center: #dff1df;      /* oklch(0.94 0.03 145)  — sauge clair lumineux */
  --bg-mid:    #bdceac;      /* oklch(0.83 0.05 130)  — sauge soutenu */
  --bg-edge:   #a6a87d;      /* oklch(0.72 0.06 110)  — olive/mousse profond */

  --card-top:    #fbf8f0;    /* oklch(0.98 0.012 90)  — ivoire chaud */
  --card-bottom: #f1efe2;    /* oklch(0.95 0.018 100) */
  --card-border: #b1bca8;    /* oklch(0.78 0.03 130)  — fine bordure sauge */

  --ink: #27321c;            /* oklch(0.3 0.04 130)   — vert forêt presque noir */
  --ink-soft: #505947;       /* oklch(0.45 0.03 130)  — gris-vert sourdine */
  --eyebrow-ink: #516c4b;    /* oklch(0.5 0.06 140)   — vert mousse discret */

  --photo-ring: #798d6f;     /* oklch(0.62 0.05 135)  — contour du cercle */
  --heart: #4a6e42;          /* oklch(0.5 0.08 140)   — le cœur */

  --btn-yes-1: #608661;      /* oklch(0.58 0.07 145)  — début du dégradé */
  --btn-yes-2: #425430;      /* oklch(0.42 0.06 130)  — fin du dégradé */
  --btn-no-border: #7c8c74;  /* oklch(0.62 0.04 135) */
  --btn-no-ink: #414c35;     /* oklch(0.4 0.04 130) */

  --accent: #608661;         /* sauge principal (focus, états actifs) */
  --accent-deep: #425430;    /* mousse profonde (survol) */
  --accent-light: #b1bca8;   /* sauge clair (bordures, décor) */
  --accent-wash: #ecf5e8;    /* oklch(0.96 0.02 135) — fond d'une carte active */
  --decor: #b1bca8;          /* pétales du fond */
  --line: #d3dacd;           /* oklch(0.88 0.02 130) — bordures neutres */

  --radius-card: 28px;
  --radius-inner: 18px;
  --shadow-card: 0 24px 60px -22px rgba(40, 55, 30, .34);
  --shadow-soft: 0 8px 20px -10px rgba(40, 55, 30, .26);
  --shadow-lift: 0 14px 28px -14px rgba(40, 55, 30, .38);

  /* MODIFIE ICI : les polices (pense à changer aussi le <link> dans index.html) */
  --font-title: "Quicksand", "Trebuchet MS", -apple-system, sans-serif;
  --font-hand: "Caveat", "Segoe Script", cursive;
  --font-ui: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(.22, .68, .32, 1);
}

/* Les vraies valeurs oklch, sur les navigateurs qui les supportent */
@supports (color: oklch(0.5 0.1 130)) {
  :root {
    --bg-center: oklch(0.94 0.03 145);
    --bg-mid:    oklch(0.83 0.05 130);
    --bg-edge:   oklch(0.72 0.06 110);

    --card-top:    oklch(0.98 0.012 90);
    --card-bottom: oklch(0.95 0.018 100);
    --card-border: oklch(0.78 0.03 130);

    --ink: oklch(0.3 0.04 130);
    --ink-soft: oklch(0.45 0.03 130);
    --eyebrow-ink: oklch(0.5 0.06 140);

    --photo-ring: oklch(0.62 0.05 135);
    --heart: oklch(0.5 0.08 140);

    --btn-yes-1: oklch(0.58 0.07 145);
    --btn-yes-2: oklch(0.42 0.06 130);
    --btn-no-border: oklch(0.62 0.04 135);
    --btn-no-ink: oklch(0.4 0.04 130);

    --accent: oklch(0.58 0.07 145);
    --accent-deep: oklch(0.42 0.06 130);
    --accent-light: oklch(0.78 0.03 130);
    --accent-wash: oklch(0.96 0.02 135);
    --decor: oklch(0.78 0.03 130);
    --line: oklch(0.88 0.02 130);
  }
}

/* ══════════════════════════════════════════════════════════════
   Base
   ══════════════════════════════════════════════════════════════ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;          /* jamais de scroll horizontal */
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Dégradé radial centré : clair au centre, olive profond sur les bords */
  background: radial-gradient(
    ellipse 115% 90% at 50% 42%,
    var(--bg-center) 0%,
    var(--bg-mid) 58%,
    var(--bg-edge) 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Focus clavier visible partout */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

/* ══════════════════════════════════════════════════════════════
   Décor : pétales flottants
   ══════════════════════════════════════════════════════════════ */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: -6vh;
  color: var(--decor);
  opacity: .6;
  font-size: 18px;
  animation: fall linear infinite;
  will-change: transform;
}
@keyframes fall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); }
  100% { transform: translate3d(18px, 112vh, 0) rotate(320deg); }
}

/* Confettis */
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}

/* ══════════════════════════════════════════════════════════════
   Scène & carte
   ══════════════════════════════════════════════════════════════ */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: 600px;
  background: linear-gradient(165deg, var(--card-top) 0%, var(--card-bottom) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 34px 24px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* liseré doux en haut de la carte */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-light), var(--accent), var(--accent-light));
  opacity: .75;
}

/* ══════════════════════════════════════════════════════════════
   Écrans & transitions
   ══════════════════════════════════════════════════════════════ */
.screen[hidden] { display: none; }

.screen.is-active {
  animation: screen-in 400ms var(--ease) both;
}
.screen.is-leaving {
  animation: screen-out 200ms var(--ease) both;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes screen-out {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(.97) translateY(10px); }
}

/* ══════════════════════════════════════════════════════════════
   Typographie
   ══════════════════════════════════════════════════════════════ */
.eyebrow {
  font-family: var(--font-hand);
  font-size: 26px;
  color: var(--eyebrow-ink);
  margin: 0 0 14px;
  line-height: 1;
}

/* Simple libellé, sans pastille */
.step-label {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 16px;
}

.title {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(27px, 7.4vw, 38px);
  line-height: 1.2;
  letter-spacing: -.015em;
  margin: 0 0 12px;
  color: var(--ink);
}

.subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 auto 26px;
  max-width: 34ch;
}

.hint {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 7px 0 0;
  opacity: .85;
}

/* ══════════════════════════════════════════════════════════════
   Photos — polaroïds légèrement de biais
   L'image est TOUJOURS visible en entier (jamais rognée) : c'est
   la largeur qui est fixée, la hauteur suit le format de la photo.
   ══════════════════════════════════════════════════════════════ */
.polaroid {
  --tilt: -2.5deg;                 /* MODIFIE ICI : l'inclinaison */
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 24px;
  padding: 9px 9px 26px;           /* marge basse plus épaisse, façon polaroïd */
  background: linear-gradient(165deg, #FFFFFF 0%, var(--card-top) 100%);
  border: 1px solid var(--card-border);
  border-radius: 5px;
  box-shadow: 0 14px 30px -14px rgba(40, 55, 30, .45),
              0 2px 6px -2px rgba(40, 55, 30, .25);
  transform: rotate(var(--tilt));
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
  position: relative;
}
.polaroid:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 0 20px 40px -16px rgba(40, 55, 30, .5);
}

/* petit ruban adhésif en haut */
.polaroid::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 66px;
  height: 19px;
  transform: translateX(-50%) rotate(-1.5deg);
  background: rgba(121, 141, 111, .30);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
}

.polaroid img {
  display: block;
  height: auto;
  border-radius: 2px;
  background: var(--card-bottom);
}

/* MODIFIE ICI : la taille des deux photos */
.polaroid-question { --tilt: -2.5deg; }
.polaroid-question img { width: 186px; }      /* photo carrée */

.polaroid-meal { --tilt: 2.5deg; }
.polaroid-meal img { width: 168px; }          /* photo en portrait */

.polaroid-done {
  --tilt: -1.8deg;
  margin: 0 auto 18px;
  animation: seal-pop 460ms var(--ease) 150ms both;  /* apparaît en tout premier */
}
.polaroid-done img { width: 150px; }          /* petit gif de célébration */

/* repli si la photo n'est pas trouvée */
.photo-fallback {
  display: none;
  font-size: 44px;
  color: var(--heart);
  line-height: 1;
}
.polaroid.is-empty {
  width: 168px;
  height: 190px;
  display: grid;
  place-items: center;
}
.polaroid.is-empty .photo-fallback { display: block; }

/* ══════════════════════════════════════════════════════════════
   Boutons
   ══════════════════════════════════════════════════════════════ */
.btn {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  border-radius: 999px;
  padding: 15px 28px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease),
              background-color 180ms var(--ease), color 180ms var(--ease);
  -webkit-tap-highlight-color: transparent;
  min-height: 50px;
}

.btn-primary {
  background: linear-gradient(160deg, var(--btn-yes-1) 0%, var(--btn-yes-2) 100%);
  color: var(--card-top);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover {
  background: linear-gradient(160deg, var(--btn-yes-2) 0%, var(--btn-yes-2) 100%);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
.btn-primary:active { transform: scale(.96); }
.btn-primary.is-pressed { animation: pop 260ms var(--ease); }
@keyframes pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(.93); }
  100% { transform: scale(1); }
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent-light);
}
.btn-outline:hover { background: var(--accent-wash); border-color: var(--accent); }
.btn-outline:active { transform: scale(.97); }

/* le bouton "Non" */
.btn-ghost {
  background: transparent;
  color: var(--btn-no-ink);
  border-color: var(--btn-no-border);
  font-weight: 500;
  transition: transform 260ms var(--ease), left 260ms var(--ease), top 260ms var(--ease),
              font-size 260ms var(--ease), padding 260ms var(--ease);
}
.btn-ghost:hover { border-color: var(--accent-deep); }

.heart { color: currentColor; }

/* Zone où le bouton "Non" a le droit de s'échapper */
.choices {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 250px;   /* MODIFIE ICI : plus grand = plus de place pour que le "Non" s'échappe */
  padding-bottom: 8px;
}
/* le "Oui" reste toujours au-dessus et cliquable */
#btnYes { position: relative; z-index: 3; width: 100%; max-width: 300px; }
#btnNo  { z-index: 2; }
#btnNo.is-loose {
  position: absolute;
  margin: 0;
  z-index: 1;
}
#btnNo.is-tiny {
  font-size: 11px;
  padding: 7px 12px;
  min-height: 0;
  opacity: .75;
}

.actions { margin-top: 26px; }
.actions .btn { width: 100%; }
.actions-split {
  display: flex;
  gap: 10px;
  flex-direction: row-reverse;   /* action principale à droite */
}
.actions-split .btn { flex: 1 1 auto; }
.actions-split .btn-outline { flex: 0 1 40%; }

.link-quiet {
  margin-top: 22px;
  background: none;
  border: none;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent-light);
  cursor: pointer;
  padding: 8px 12px;
}
.link-quiet:hover { color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   Champs de formulaire
   ══════════════════════════════════════════════════════════════ */
.fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-soft);
  margin-bottom: 7px;
}

.field input,
.field select {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 16px;             /* 16px = pas de zoom auto sur iOS */
  font-weight: 500;
  color: var(--ink);
  background: var(--card-top);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-inner);
  padding: 14px 16px;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
  min-height: 52px;
  appearance: none;
}
.field input:hover,
.field select:hover { border-color: var(--accent-light); }
.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(96, 134, 97, .20);
}

/* petite flèche dessinée pour la liste déroulante */
.field select {
  padding-right: 42px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: right 20px center, right 15px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* apparition du champ libre "Autre" */
#planOtherField[hidden] { display: none; }
#planOtherField { animation: screen-in 320ms var(--ease) both; }
.field input::placeholder { color: #93A08A; }
.field input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }

/* ══════════════════════════════════════════════════════════════
   Grille des repas
   ══════════════════════════════════════════════════════════════ */
.meal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 430px) {
  .meal-grid { grid-template-columns: repeat(4, 1fr); }
}

.meal {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--card-top);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-inner);
  padding: 14px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 82px;
  justify-content: center;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease),
              border-color 180ms var(--ease), background-color 180ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.meal-emoji { font-size: 22px; line-height: 1; }

.meal:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent-light);
}
.meal:active { transform: scale(.98); }

.meal.is-selected {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.nudge {
  font-size: 13.5px;
  color: var(--accent-deep);
  min-height: 20px;
  margin: 12px 0 0;
}

/* ══════════════════════════════════════════════════════════════
   ÉCRAN 4 — confirmation
   ══════════════════════════════════════════════════════════════ */
.screen-done { padding-top: 4px; }

@keyframes seal-pop {
  from { transform: scale(0) rotate(-40deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);   opacity: 1; }
}

.title-done { margin-bottom: 8px; }

/* « Je viendrai te chercher à 19h30 » */
.pickup {
  font-family: var(--font-hand);
  font-size: 25px;
  line-height: 1.3;
  color: var(--accent-deep);
  margin: 0;
}
.pickup #pickupTime {
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 1px;
}

/* Petit séparateur avec un cœur au milieu */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 4px 4px;
  color: var(--accent-light);
  font-size: 12px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
}

/* Le carton d'invitation */
.ticket {
  position: relative;
  text-align: left;
  border-radius: var(--radius-inner);
  padding: 14px 20px 16px;
  margin: 14px 0 4px;
  background: linear-gradient(150deg, var(--accent-wash) 0%, var(--card-bottom) 100%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), var(--shadow-soft);
  overflow: hidden;
}
/* encoches façon ticket */
.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card-bottom);   /* même teinte que la carte à cette hauteur */
}
.ticket::before { left: -10px; }
.ticket::after  { right: -10px; }

/* Jour + heure côte à côte, puis activité et menu sur toute la largeur */
.ticket-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
}

.recap-cell {
  text-align: left;
  padding: 13px 0;
  border-top: 1px dashed rgba(80, 89, 71, .30);
  min-width: 0;
  animation: row-in 420ms var(--ease) both;
  animation-delay: calc(var(--i, 1) * 90ms + 120ms);
}
/* la première rangée n'a pas de trait au-dessus */
.recap-cell:nth-child(1),
.recap-cell:nth-child(2) { border-top: none; padding-top: 4px; }
.recap-cell.is-wide { grid-column: 1 / -1; }

@keyframes row-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.recap-key {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0 0 3px;
  opacity: .9;
}
.recap-val {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;   /* une activité très longue passe à la ligne au lieu de déborder */
}

/* ══════════════════════════════════════════════════════════════
   Petits écrans
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .card { padding: 28px 18px 24px; border-radius: 24px; }
  .photo-frame { width: 132px; height: 132px; }
  .btn { font-size: 15px; padding: 14px 20px; }
  .actions-split { flex-direction: column-reverse; }
  .actions-split .btn { flex: 1 1 auto; width: 100%; }
}

/* ══════════════════════════════════════════════════════════════
   Accessibilité : mouvement réduit
   ══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .petals { display: none; }
  .btn:hover, .meal:hover { transform: none; }
}
