/* Formulaire en écrans successifs : une question, un écran. */

.bandeau {
  position: sticky; top: 0; z-index: 20;
  background: var(--creme); border-bottom: 1px solid var(--bord);
  padding-top: env(safe-area-inset-top);
}
.bandeau-inner {
  max-width: 560px; margin: 0 auto; padding: 10px 18px 12px;
  display: flex; align-items: center; gap: 12px;
}
.bandeau .titre { font-weight: 700; font-size: .95rem; flex: 1; }
.bandeau .compteur { font-size: .82rem; color: var(--encre-doux); font-variant-numeric: tabular-nums; }

.jauge { height: 5px; background: var(--creme-fonce); border-radius: 999px; overflow: hidden; }
.jauge > i { display: block; height: 100%; width: 0; background: var(--terre); border-radius: 999px; transition: width .3s ease; }

.entete-fete { padding: 26px 0 8px; }
/* Seul bloc de texte posé sur la photo : il lui faut plus de contraste que
   le gris d'aide habituel, sinon il se perd dans le feuillage. */
.entete-fete .aide { color: var(--encre); font-weight: 500; }
.entete-fete .sur-titre { color: var(--terre); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .74rem; margin-bottom: 6px; }

/* --- écrans --- */
.ecran { padding: 22px 0 8px; animation: apparait .22s ease both; }
@keyframes apparait { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ecran .question { font-size: 1.35rem; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.ecran .aide { color: var(--encre-doux); font-size: .95rem; margin: 0 0 18px; }

/* --- choix cliquables --- */
.choix { display: grid; gap: 10px; margin-bottom: 8px; }
.choix button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: var(--touche); padding: 14px 16px;
  border: 1.5px solid var(--bord); border-radius: var(--rayon);
  background: #fff; color: var(--encre); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .12s ease, background .12s ease, transform .08s ease;
}
.choix button:active { transform: scale(.99); }
.choix button[aria-pressed="true"] { border-color: var(--terre); background: var(--terre-pale); box-shadow: inset 0 0 0 1px var(--terre); }
.choix button .lib { font-weight: 600; }
.choix button .sous { display: block; font-weight: 400; font-size: .87rem; color: var(--encre-doux); margin-top: 2px; }
.choix button .coche { margin-left: auto; color: var(--terre); font-weight: 700; opacity: 0; }
.choix button[aria-pressed="true"] .coche { opacity: 1; }
.choix.deux { grid-template-columns: 1fr 1fr; }
.choix.deux button { flex-direction: column; align-items: flex-start; justify-content: center; }

/* --- compteurs +/- --- */
.compteurs { display: grid; gap: 12px; }
.compteur-ligne {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--bord); border-radius: var(--rayon); background: #fff; padding: 10px 12px;
}
.compteur-ligne .lib { flex: 1; font-weight: 600; }
.compteur-ligne button {
  width: 46px; height: 46px; border-radius: 12px; border: 1.5px solid var(--bord);
  background: var(--creme); font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--encre);
}
.compteur-ligne button:active { background: var(--creme-fonce); }
.compteur-ligne output { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.15rem; }

.ages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ages label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--encre-doux); }
.ages input { width: 88px; }

/* --- autocomplétion --- */
.auto { position: relative; }
.auto-liste {
  list-style: none; margin: 8px 0 0; padding: 0;
  border: 1.5px solid var(--bord); border-radius: var(--rayon); background: #fff;
  overflow: hidden; box-shadow: var(--ombre);
}
.auto-liste li { border-bottom: 1px solid var(--creme-fonce); }
.auto-liste li:last-child { border-bottom: 0; }
.auto-liste button {
  width: 100%; min-height: 50px; padding: 12px 15px; border: 0; background: none;
  font: inherit; text-align: left; cursor: pointer; color: var(--encre);
  display: flex; align-items: center; gap: 10px;
}
.auto-liste button:active { background: var(--terre-pale); }
.auto-liste .indice { color: var(--encre-doux); font-size: .85rem; }
.auto-liste .deja { margin-left: auto; }
.etat-recherche { padding: 12px 2px; color: var(--encre-doux); font-size: .9rem; }

/* --- pied de navigation --- */
.pied {
  position: sticky; bottom: 0; z-index: 15;
  background: linear-gradient(to top, var(--creme) 68%, rgba(253,248,242,0));
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center;
}
.pied .bouton { flex: 1; }
.pied .bouton.secondaire { flex: 0 0 auto; min-width: 96px; }

/* --- récapitulatif --- */
.recap { display: grid; gap: 2px; margin: 4px 0 18px; }
.recap-ligne { display: flex; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--creme-fonce); }
.recap-ligne dt { flex: 0 0 42%; color: var(--encre-doux); font-size: .9rem; margin: 0; }
.recap-ligne dd { flex: 1; margin: 0; font-weight: 600; }

.code-bloc { background: var(--terre-pale); border: 1.5px dashed var(--terre-clair); border-radius: var(--rayon); padding: 18px; text-align: center; }
.code-bloc .code { font-size: 2rem; font-weight: 800; letter-spacing: .22em; color: var(--terre); font-variant-numeric: tabular-nums; }

.trajet-chiffres { display: flex; gap: 22px; justify-content: center; margin-top: 12px; }
.trajet-chiffres div { text-align: center; }
.trajet-chiffres .val { font-size: 1.3rem; font-weight: 700; }
.trajet-chiffres .lib { font-size: .8rem; color: var(--encre-doux); }

/* --- cagnotte --- */
.cagnotte { background: var(--ambre-pale); border: 1.5px solid #f0dcb8; border-radius: var(--rayon); padding: 18px; }

/* --- buffet : compteurs publics --- */
.buffet { background: #fff; border: 1.5px solid var(--bord); border-radius: var(--rayon); padding: 16px; }
.buffet-barre { display: flex; height: 30px; border-radius: 999px; overflow: hidden; background: var(--creme-fonce); margin: 12px 0 8px; }
.buffet-barre i {
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff; min-width: 0;
  transition: width .35s ease;
}
.buffet-barre i.sale { background: var(--terre); }
.buffet-barre i.sucre { background: var(--ambre); }
.buffet-legende { display: flex; gap: 16px; flex-wrap: wrap; font-size: .88rem; }
.buffet-legende span { display: inline-flex; align-items: center; gap: 6px; }
.buffet-legende i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.buffet-legende i.sale { background: var(--terre); }
.buffet-legende i.sucre { background: var(--ambre); }
.buffet-conseil {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--rayon);
  background: var(--ambre-pale); border: 1.5px solid #f0dcb8; color: #7d5210; font-size: .93rem;
}
.buffet-vide { color: var(--encre-doux); font-size: .93rem; }
.plats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.plats span {
  background: var(--creme-fonce); border-radius: 999px; padding: 5px 12px; font-size: .85rem;
}
.plats span.sucre { background: var(--ambre-pale); color: #7d5210; }
.plats span.sale { background: var(--terre-pale); color: var(--terre); }

/* --- rappel « apporte ton assiette » --- */
.rappel {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--vert-pale); border: 1.5px solid #bcd8c3; border-radius: var(--rayon);
  padding: 14px; color: #1f5128; font-size: .93rem;
}
.rappel strong { display: block; margin-bottom: 2px; }

/* --- infos pratiques --- */
.billets { display: grid; gap: 14px; }
.billet { background: #fff; border: 1.5px solid var(--bord); border-radius: var(--rayon); padding: 16px; }
.billet .date { font-size: .8rem; color: var(--encre-doux); }
.billet-corps :first-child { margin-top: 0; }
.billet-corps :last-child { margin-bottom: 0; }
.billet-corps ul, .billet-corps ol { padding-left: 1.2em; }
.billet-corps code { background: var(--creme-fonce); padding: 1px 5px; border-radius: 5px; font-size: .9em; }

.alerte-boite { background: var(--ambre-pale); border: 1.5px solid #f0dcb8; border-radius: var(--rayon); padding: 14px; color: #7d5210; }
.erreur-boite { background: #fdecec; border: 1.5px solid #f3c9c9; border-radius: var(--rayon); padding: 14px; color: #9b2c2c; }

@media (min-width: 620px) {
  .ecran .question { font-size: 1.5rem; }
}

/* --- case à cocher isolée --- */
.case {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  min-height: var(--touche); padding: 14px 16px; text-align: left;
  border: 1.5px solid var(--bord); border-radius: var(--rayon);
  background: #fff; color: var(--encre); font: inherit; cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.case[aria-pressed="true"] { border-color: var(--terre); background: var(--terre-pale); box-shadow: inset 0 0 0 1px var(--terre); }
.case .boite {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; margin-top: 1px;
  border: 2px solid var(--bord); display: flex; align-items: center; justify-content: center;
  font-size: .85rem; color: #fff; background: #fff;
}
.case[aria-pressed="true"] .boite { background: var(--terre); border-color: var(--terre); }
.case .lib { font-weight: 600; display: block; }
.case .sous { display: block; font-size: .87rem; color: var(--encre-doux); margin-top: 2px; font-weight: 400; }

/* --- page de garde ------------------------------------------------------
   Affichée uniquement sur l'écran d'accueil : dès qu'on entre dans le
   formulaire, elle disparaît et laisse la place aux questions. */
.couverture {
  margin: 0 -18px 6px;            /* déborde de l'enveloppe, jusqu'aux bords */
  position: relative;
  line-height: 0;
}
.couverture img {
  width: 100%; height: auto; display: block;
}
/* Pas de fondu : le collage porte déjà son propre cadre (bords déchirés, motifs
   fleuris). Un dégradé par-dessus rognait le bas de l'image et coupait le sujet. */
@media (min-width: 600px) {
  .couverture { margin-left: 0; margin-right: 0; border-radius: var(--rayon); overflow: hidden; }
}
