/* Dîner de rentrée des Pastoureaux : feuille de style unique.
   Mobile uniquement, aucun CDN, aucune police externe. Ossature et palette
   reprises du foyer de mini-sites (agenda, ménage, travaux, paniers, portail) :
   neutres stone, bleu sarcelle sauge du logo pour l'identité, ocre d'automne
   pour l'accent de saison. Titres en Cormorant Garamond auto-hébergée. */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/cormorant-garamond-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic; font-weight: 400 700; font-display: swap;
  src: url("fonts/cormorant-garamond-italic-latin.woff2") format("woff2");
}

:root {
  --bg:#fafaf9; --card:#ffffff; --ink:#1c1917; --ink-2:#292524;
  --muted:#78716c; --muted-2:#8a837d; --line:#e7e5e4; --line-2:#d6d3d1;
  --brand:#235b5b; --brand-2:#1b4949; --brand-clair:#b6d8d8;
  --brand-deco:#83b9b9; --brand-bg:#f2fafa; --brand-fonce:#1f5252;
  --entete:#92b6b6; --entete-tx:#123833; --entete-sous:#16453c;
  --terre:#a9762f; --terre-bg:#f8f1e6; --terre-tx:#5c4327; --terre-ln:#e3d2b6;
  --papier:#fdfaf3;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }
button, input { font-family: inherit; }

.chargement { padding: 40vh 0 0; text-align: center; color: var(--muted-2); }

/* ---- En-tête de marque : il défile, il ne colle pas -------------------- */

header.app {
  background: var(--entete); color: var(--entete-tx);
  padding: calc(16px + env(safe-area-inset-top)) 20px 15px;
  display: flex; align-items: center; gap: 12px;
}
header.app .logo {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.55);
}
header.app h1 {
  margin: 0; font-size: 21px; line-height: 1.15; font-weight: 600; min-width: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
}
header.app h1 .sub {
  display: block; color: var(--entete-sous); font-size: 14px;
  font-style: italic; font-weight: 400;
}
/* Retour au portail : pastille ronde au coin haut-gauche, la place où l'on
   cherche un retour sur téléphone. Le lien porte le code du portail. */
header.app .retour {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .72); color: var(--entete-sous);
  border: 1px solid rgba(255, 255, 255, .8); text-decoration: none;
}
header.app .retour span { font-size: 25px; line-height: 1; margin-top: -3px; }
header.app .retour:active { background: #ffffff; }

main { flex: 1; padding: 0 16px 34px; }

/* ---- Le carton d'invitation -------------------------------------------- */

/* Le bandeau reprend le flyer papier : fond crème, guirlande d'automne en
   haut, titre calligraphié. C'est la première chose que voit le parent. */
.carton {
  background: var(--papier); border: 1px solid var(--terre-ln);
  border-radius: 18px; margin: 18px 0 0; padding: 0 0 22px;
  overflow: hidden; text-align: center;
}
.carton .bandeau {
  display: block; width: 100%; height: auto;
}
.carton .surtitre {
  margin: 16px 0 0; font-size: 12.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--brand-fonce);
}
.carton h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic; font-weight: 600;
  font-size: 38px; line-height: 1.05; color: #5c4327;
  margin: 4px 18px 0;
}
.carton .sous {
  margin: 8px 0 0; font-size: 13px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--terre);
}
.carton .filet {
  width: 120px; height: 1px; background: var(--brand-deco);
  margin: 16px auto 0; border: 0;
}
.carton .organisateur {
  margin: 14px 18px 0; font-size: 14px; font-style: italic; color: var(--muted);
}

/* ---- Le mot de l'équipe ------------------------------------------------ */

.mot {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; margin: 16px 0 0; padding: 18px 18px 6px;
}
.mot p { margin: 0 0 14px; color: var(--ink-2); }
.mot p:first-child { font-weight: 600; }

/* ---- Les informations pratiques ---------------------------------------- */

.infos { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.infos li {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 13px 15px;
  display: flex; align-items: flex-start; gap: 13px;
}
.infos .pastille {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
  background: var(--brand-bg); border: 1px solid var(--brand-clair);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; line-height: 1;
}
.infos .cle {
  display: block; font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.infos .valeur {
  display: block; font-size: 17px; font-weight: 600; color: var(--ink);
  margin-top: 1px;
}
.infos .detail { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }

/* ---- La date limite de réponse ----------------------------------------- */

/* Ocre et non sarcelle : c'est la seule ligne qui demande quelque chose au
   lecteur, elle doit se détacher du reste sans crier. */
.reponse {
  margin: 16px 0 0; padding: 14px 16px; text-align: center;
  background: var(--terre-bg); border: 1px solid var(--terre-ln);
  border-radius: 14px; color: var(--terre-tx);
}
.reponse .libelle { font-weight: 700; font-size: 16px; }
.reponse .reste { display: block; margin-top: 3px; font-size: 13.5px; color: var(--terre); }
.reponse.passee { background: var(--bg); border-color: var(--line-2); color: var(--muted); }
.reponse.passee .reste { color: var(--muted-2); }

/* ---- Porte d'accès ----------------------------------------------------- */

.porte { padding: 34px 22px; text-align: center; }
.porte h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600; font-size: 26px; color: var(--brand-fonce); margin: 0 0 6px;
}
.porte .hint { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.porte form { display: flex; gap: 10px; max-width: 340px; margin: 0 auto; }
.porte input {
  flex: 1; min-width: 0; font-size: 17px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--card);
}
.porte button {
  font-size: 16px; font-weight: 700; padding: 12px 20px; min-height: 48px;
  background: var(--brand); color: #fff; border: none; border-radius: 12px; cursor: pointer;
}
.porte .erreur {
  color: var(--terre-tx); background: var(--terre-bg); border: 1px solid var(--terre-ln);
  border-radius: 10px; padding: 8px 12px; font-size: 14px; max-width: 340px; margin: 14px auto 0;
}

.notice { text-align: center; color: var(--muted); padding: 30px 20px; }

/* ---- Pied -------------------------------------------------------------- */

footer {
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom));
  text-align: center; color: var(--muted-2); font-size: 13px;
}
footer .filet {
  width: 74px; height: 2px; border-radius: 1px;
  background: var(--brand-deco); margin: 0 auto 12px;
}

/* ---- La réponse de la famille ------------------------------------------ */

.reponse .aller {
  display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600;
  color: var(--terre-tx); text-decoration: underline; text-underline-offset: 3px;
}
.reponse.passee .aller { color: var(--muted); }

section.inscription {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; margin: 16px 0 0; padding: 16px 16px 14px;
}
section.inscription h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600; font-size: 24px; color: var(--brand-fonce); margin: 0 0 8px;
}
section.inscription h4, .bloc h4 {
  margin: 14px 0 8px; font-size: 12.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.hint { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.hint.centre { text-align: center; margin: 10px 0; }

/* Recherche et liste des noms : un bouton par participant, pleine largeur,
   le nom bien lisible, les prénoms (ou la classe) en dessous. */
.search {
  width: 100%; font-size: 17px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg);
}
.picklist { display: grid; gap: 6px; }
button.pick {
  width: 100%; text-align: left; display: grid;
  grid-template-columns: 1fr auto; column-gap: 8px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; min-height: 48px; cursor: pointer; color: var(--ink);
}
button.pick:active { background: var(--brand-bg); border-color: var(--brand-clair); }
button.pick .nom { font-weight: 600; font-size: 16px; }
button.pick .detail { grid-column: 1; font-size: 13px; color: var(--muted); }
button.pick .coche {
  grid-column: 2; grid-row: 1 / span 2; color: var(--brand); font-weight: 700; font-size: 18px;
}
button.pick.deja { border-color: var(--brand-clair); background: var(--brand-bg); }

/* En-tête « votre famille » une fois le nom choisi. */
.moi {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 0 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px;
}
.moi .lbl { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.moi .nom {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700; font-size: 26px; line-height: 1.1; color: var(--brand-fonce);
}
.moi .detail { font-size: 14px; color: var(--muted); }
button.lien {
  background: none; border: none; padding: 6px 0; cursor: pointer;
  color: var(--brand); font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
  white-space: nowrap;
}

/* Le grand bouton de présence : une case à cocher qu'on ne peut pas rater. */
button.presence {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  font-size: 16.5px; font-weight: 700; line-height: 1.25; padding: 14px 16px; min-height: 56px;
  background: var(--brand); color: #fff; border: none; border-radius: 14px; cursor: pointer;
}
button.presence:active { background: var(--brand-2); }
button.presence .case {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 7px;
  border: 2px solid rgba(255,255,255,.85); display: inline-flex;
  align-items: center; justify-content: center; font-size: 17px;
}
button.presence.confirme {
  background: var(--brand-bg); color: var(--brand-fonce); border: 1px solid var(--brand-clair);
  cursor: default;
}
button.presence.confirme .case { background: var(--brand); color: #fff; border-color: var(--brand); }

.bloc { margin-top: 6px; }

/* Nombre de personnes : deux gros boutons et le chiffre entre les deux. */
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 44px; height: 44px; border-radius: 12px; font-size: 24px; line-height: 1;
  background: var(--card); border: 1px solid var(--line-2); color: var(--brand-fonce); cursor: pointer;
}
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper .n {
  min-width: 34px; text-align: center; font-size: 24px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stepper .unite { color: var(--muted); font-size: 15px; }

/* Les options : un bouton par choix, l'actif en sarcelle. Le compteur
   « déjà 4 » aide à choisir ce qui manque sur la table. */
.choix { display: grid; gap: 8px; }
/* Deux carrés côte à côte, un « ou » bien visible entre les deux. */
.choix.deux { grid-template-columns: 1fr auto 1fr; align-items: stretch; }
.choix.deux .ou {
  align-self: center; font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); padding: 0 2px;
}
.sous-choix { display: grid; gap: 8px; margin-top: 8px; padding-left: 12px; border-left: 3px solid var(--brand-clair); }
button.option {
  width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 11px 14px; min-height: 48px; cursor: pointer; color: var(--ink); font-size: 15.5px; line-height: 1.3;
}
button.option:active { background: var(--brand-bg); }
button.option.actif { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
button.option .compte {
  flex: 0 0 auto; font-size: 12px; color: var(--muted); background: var(--bg);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
button.option.actif .compte { color: #fff; background: rgba(255,255,255,.2); }
.choix.deux button.option { flex-direction: column; justify-content: center; text-align: center; font-weight: 600; min-height: 64px; padding: 10px 8px; }

.etat-sauvegarde { min-height: 20px; margin: 12px 0 0; font-size: 13.5px; color: var(--brand); text-align: right; }
button.lien.retrait { display: block; margin: 4px 0 0; color: var(--muted); }

/* Un choix complet reste lisible mais ne se prend plus : sa part des inscrits
   est couverte. Il rouvrira de lui-même quand d'autres familles s'inscriront. */
button.option.complet { opacity: .55; cursor: default; background: var(--bg); }
button.option .compte.plein { color: var(--terre-tx); background: var(--terre-bg); border: 1px solid var(--terre-ln); }

/* Les planches, illustrées : l'aquarelle au-dessus, le libellé en dessous. */
button.option.illustree { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px 11px; background: var(--papier); }
button.option.illustree .illustration { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; }
button.option.illustree .ligne { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
button.option.illustree.actif { background: var(--brand); }
button.option.illustree.complet .illustration { filter: grayscale(.6); }
