/* Charte reprise du faire-part. Le sauge de la carte (#96A189) ne porte jamais de texte clair : contraste insuffisant. */
@font-face { font-family: "PT Serif"; font-weight: 400; font-display: swap; src: url(/statique/fonts/pt-serif-400.woff2) format("woff2"); }
@font-face { font-family: "PT Serif"; font-weight: 700; font-display: swap; src: url(/statique/fonts/pt-serif-700.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(/statique/fonts/atkinson-hyperlegible-400.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(/statique/fonts/atkinson-hyperlegible-700.woff2) format("woff2"); }

:root {
  --sauge: #96a189;
  --sauge-profond: #4f6447;
  --sauge-brume: #dde5d3;
  --sauge-grise: #a9b5a3;
  --bordure: #c9cfc2;
  --ivoire: #faf7f0;
  --encre: #2b3528;
  --encre-sur-sauge: #1f241d;
  --galet: #6b6a63;
  --cire: #8e3b2c;
  --erreur: #a3352b;
  --titres: "PT Serif", Georgia, "Times New Roman", serif;
  --texte: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ivoire);
  color: var(--encre);
  font: 19px/1.5 var(--texte);
}
h1, h2 { font-family: var(--titres); line-height: 1.15; margin: 0; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
a { color: var(--sauge-profond); }
a:hover { color: var(--encre); }
:focus-visible { outline: 3px solid var(--sauge-profond); outline-offset: 2px; }
[hidden] { display: none !important; }

/* En-tête : le vert sauge, le lettrage et les gypsophiles du faire-part. */
.entete {
  position: relative;
  height: 168px;
  flex-shrink: 0;
  background: var(--sauge);
  overflow: hidden;
}
.entete-fleur { position: absolute; top: 0; right: 0; width: 170px; height: auto; }
.entete-titre { position: absolute; left: 16px; bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.entete-noms, .entete-noms img { display: block; width: 220px; height: auto; }
.entete-date { margin: 0 0 0 8px; font: 13px var(--titres); letter-spacing: .22em; color: var(--encre-sur-sauge); }
.entete-haute { height: 220px; }
.entete-haute .entete-fleur { width: 190px; }
.entete-haute .entete-titre { left: 16px; bottom: 20px; gap: 6px; }
.entete-haute .entete-noms { width: 250px; }
.entete-haute .entete-date { font-size: 15px; }
.entete-sceau { height: 230px; overflow: visible; display: flex; align-items: flex-end; justify-content: center; }
.sceau { position: relative; margin-bottom: -46px; animation: sceau .6s ease-out both; }
@keyframes sceau { from { transform: scale(1.15) translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sceau { animation: none; } }
.entete-sceau + .contenu { padding-top: 70px; }

.contenu {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.intro, .question { margin: 0; line-height: 1.5; }
.salutation { margin: 0 0 -14px; color: var(--galet); }
.discret { color: var(--galet); }
.centre { text-align: center; }
.pied { color: var(--galet); font-size: 16px; text-align: center; margin: 0; }
.surtitre { font: 700 15px var(--texte); letter-spacing: .06em; text-transform: uppercase; color: var(--sauge-profond); }

/* Boutons : 58 px de haut, pleine largeur, texte explicite. */
.bouton {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; width: 100%; padding: 0 20px;
  border: 0; border-radius: 12px;
  background: var(--sauge-profond); color: #fff;
  font: 700 19px var(--texte); text-decoration: none; cursor: pointer;
}
.bouton:hover { background: var(--encre); color: #fff; }
.bouton-secondaire, .bouton-contour {
  background: #fff; color: var(--encre); border: 1.5px solid var(--sauge-profond);
}
.bouton-secondaire { display: flex; align-items: center; justify-content: center; min-height: 54px; border-radius: 12px; font: 700 17px var(--texte); text-decoration: none; }
.bouton-secondaire:hover, .bouton-contour:hover { background: var(--sauge-brume); color: var(--encre); }
.bouton-contour {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 0 18px; border-radius: 12px;
  font: 700 18px var(--texte); text-align: left; cursor: pointer;
}
.bouton-contour svg { color: var(--sauge-profond); flex-shrink: 0; }
.bouton-contour.petit { min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
.lien, .lien-bouton {
  background: none; border: 0; padding: 8px 0; min-height: 48px;
  color: var(--sauge-profond); font: 17px var(--texte); text-decoration: underline; cursor: pointer;
  text-align: center; display: flex; align-items: center; justify-content: center; width: 100%;
}

/* Champs. */
label { font-weight: 700; display: block; }
input[type=text], input[type=password], textarea, select {
  width: 100%; min-height: 52px; padding: 10px 14px;
  border: 1.5px solid var(--galet); border-radius: 10px; background: #fff;
  color: var(--encre); font: 17px var(--texte);
}
textarea { min-height: 110px; }
.aide { display: block; color: var(--galet); font-size: 15px; }
.champ-code {
  min-height: 64px; font-size: 26px !important; letter-spacing: .12em;
  font-variant-numeric: tabular-nums; text-transform: uppercase;
}
.champ-code[aria-invalid=true] { border: 2px solid var(--erreur); }
.formulaire-code { display: flex; flex-direction: column; gap: 6px; }
.formulaire-code label { font-size: 18px; }
.formulaire-code .bouton { margin-top: 10px; }
.erreur { display: flex; gap: 8px; align-items: flex-start; color: var(--erreur); margin: 0; font-size: 16px; line-height: 1.4; }
.erreur svg { flex-shrink: 0; margin-top: 1px; }

.bandeau { margin: 0; padding: 12px 16px; border-radius: 10px; background: var(--sauge-brume); font-size: 17px; }
.bandeau-alerte { background: #f6e3df; }
.bandeau-alerte p { margin: 4px 0; }

.indice {
  display: flex; gap: 14px; align-items: center;
  padding: 12px 14px; border-radius: 12px; background: var(--sauge-brume); font-size: 16px; line-height: 1.4;
}
.indice p { margin: 0; }
.indice svg { flex-shrink: 0; }
.indice-carte { fill: var(--sauge); stroke: var(--sauge-profond); }
.indice-etiquette { fill: var(--ivoire); stroke: var(--cire); stroke-width: 2; }
.indice-qr { fill: var(--encre); }

details > summary {
  cursor: pointer; color: var(--sauge-profond); text-decoration: underline; font-size: 17px;
  min-height: 48px; display: flex; align-items: center; justify-content: center; text-align: center;
  list-style: none;
}
details > summary::-webkit-details-marker { display: none; }
.secours[open], .absence[open] {
  background: #fff; border: 1px solid var(--sauge-brume); border-radius: 14px; padding: 8px 16px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.secours p, .absence p { margin: 0; font-size: 17px; }
.adresse { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.adresse .bouton-contour { width: auto; }

.carte {
  background: #fff; border: 1px solid var(--sauge-brume); border-radius: 14px;
  padding: 16px; margin: 0; min-width: 0;
}
.carte p { margin: 0; }
.carte-brume { background: var(--sauge-brume); border: 0; display: flex; flex-direction: column; gap: 6px; font-size: 17px; }
legend { font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--sauge-profond); padding: 0 6px; }

/* Accueil personnalisé. */
.actions-invite { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.changer { margin-top: auto; }

/* Barre du bas : Invitation, Programme, Histoire. */
.navigation {
  position: sticky; bottom: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 8px 6px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--sauge-brume); background: var(--ivoire);
}
.navigation a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 52px; font-size: 13px; color: var(--galet); text-decoration: none;
}
.navigation a[aria-current=page] { color: var(--encre); font-weight: 700; }
.navigation a[aria-current=page] svg { color: var(--sauge-profond); }

/* Programme et histoire. */
.journee { display: flex; flex-direction: column; gap: 8px; }
.programme { list-style: none; padding: 0; margin: 0; }
.programme li { display: grid; grid-template-columns: 4.5ch 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sauge-brume); }
.programme-heure { font-weight: 700; }
.programme-lieu { display: block; color: var(--galet); font-size: 17px; }
.recit { display: flex; flex-direction: column; gap: 14px; }
.recit p { margin: 0; line-height: 1.6; }

/* Formulaire de réponse : étapes, bascules Présent·e / Absent·e, puces de régime. */
.page-reponse .entete { display: none; }
.page-reponse .contenu { padding-top: 20px; }
.reponse { display: flex; flex-direction: column; gap: 20px; }
.etape { display: flex; flex-direction: column; gap: 20px; }
.titre-etape { font-size: 30px; }
.etapes-entete { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-size: 15px; }
.retour { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 17px; text-decoration: none; }
.progression { height: 4px; border-radius: 2px; background: var(--sauge-brume); margin-top: -8px; }
.progression div { width: 0; height: 4px; border-radius: 2px; background: var(--sauge-profond); transition: width .2s; }
.reponse:not(.en-etapes) .etape + .etape { padding-top: 12px; border-top: 1px solid var(--sauge-brume); }

fieldset.carte { display: flex; flex-direction: column; gap: 12px; }
.choix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choix-nom { grid-column: 1 / -1; font-size: 18px; }
.bascule, .puce {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 12px;
  border: 1px solid var(--bordure); border-radius: 10px; background: #fff;
  font-weight: 400; font-size: 17px; cursor: pointer; text-align: center;
}
.choix-regimes .bascule { min-height: 56px; }
.bascule input, .puce input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bascule:has(input:checked), .puce:has(input:checked) {
  background: var(--sauge-brume); border: 2px solid var(--sauge-profond); font-weight: 700;
}
.bascule:has(input:checked)::before, .puce:has(input:checked)::before { content: "✓\00a0"; }
.bascule:has(input:focus-visible), .puce:has(input:focus-visible) { outline: 3px solid var(--sauge-profond); outline-offset: 2px; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { min-height: 46px; padding: 0 16px; border-radius: 23px; font-size: 16px; }
.precisez { display: flex; flex-direction: column; gap: 6px; }
.precisez label { font-weight: 400; font-size: 16px; }
fieldset:has([data-autre]):not(:has([data-autre]:checked)) .precisez { display: none; }
.reponse:not(:has(input[name=regimes][value=oui]:checked)) .regimes { display: none; }
.carte:has(input[name=accompagnant][value=non]:checked) .accompagnant { display: none; }
.accompagnant { display: flex; flex-direction: column; gap: 6px; }
.regimes { display: flex; flex-direction: column; gap: 16px; }
.note-sante { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 15px; line-height: 1.45; }
.note-sante svg { flex-shrink: 0; margin-top: 2px; }
.recap { margin-top: 4px; }
