/* Les ateliers du midi 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 .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; }
/* Le lien vers la carte reste une note de bas de ligne : même taille que le
   détail, sarcelle et souligné pour qu'on sache qu'il se touche. */
.infos .carte {
  display: inline-block; margin-top: 5px; font-size: 13.5px;
  color: var(--brand); text-decoration: underline; text-underline-offset: 2px;
}
.infos .carte:active { color: var(--brand-fonce); }

/* ---- 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;
}
/* Ce qui reste à faire, juste sous la présence confirmée : une boisson ET un
   plat sont attendus, et rien ne le disait avant. Ocre tant qu'il manque
   quelque chose, sarcelle quand c'est complet. */
.rappel {
  margin: 10px 0 0; padding: 10px 14px; border-radius: 12px;
  font-size: 14.5px; font-weight: 600; text-align: center;
  background: var(--terre-bg); border: 1px solid var(--terre-ln); color: var(--terre-tx);
}
.rappel.complete {
  background: var(--brand-bg); border-color: var(--brand-clair); color: var(--brand-fonce);
  font-weight: 500;
}
/* La pastille « à choisir » sur le titre du bloc encore vide. */
.bloc h4 .requis {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--terre-bg); border: 1px solid var(--terre-ln); color: var(--terre-tx);
  font-size: 11px; letter-spacing: .06em;
}
.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. */

/* 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. */
/* Le « ou » qui sépare les deux planches. Même lettrage que celui des paires
   côte à côte, mais tenu entre deux filets : empilées, les deux planches ont
   besoin qu'on lise l'alternative avant de choisir. */
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); }

/* Le bouton final : il clôt la réponse. Gris et inerte tant qu'il manque la
   boisson ou le plat, en disant lequel, plein sarcelle une fois complet. */
.valider {
  width: 100%; margin: 18px 0 0; padding: 14px 16px; min-height: 52px;
  border: 0; border-radius: 14px; font-size: 16px; font-weight: 700;
  background: var(--brand); color: #fff; cursor: pointer;
}
.valider:active { background: var(--brand-fonce); }
.valider[disabled] {
  background: var(--bg); color: var(--muted); border: 1px dashed var(--line-2);
  font-weight: 600; font-size: 14.5px; cursor: default;
}
.valide-ok {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; text-align: center;
  background: var(--brand-bg); border: 1px solid var(--brand-clair);
  color: var(--brand-fonce); font-size: 14.5px;
}
.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); }
button.option .note { display: block; font-size: 13px; font-style: italic; color: var(--terre-tx); text-align: left; line-height: 1.35; }
button.option.actif .note { color: rgba(255,255,255,.85); }
button.option .coche {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; color: var(--brand); font-weight: 700; font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
/* Une mention discrète, en italique, sous les informations pratiques. */
.mention { margin: 12px 8px 0; text-align: center; font-style: italic; font-size: 14.5px; color: var(--muted); }
.hint.exempt { margin: 14px 0 4px; font-style: italic; color: var(--brand-fonce); }

/* Sont déjà inscrits : les noms, en Cormorant, séparés d'un point médian. */
section.inscrits {
  background: var(--papier); border: 1px solid var(--terre-ln);
  border-radius: 16px; margin: 16px 0 0; padding: 16px 18px 14px; text-align: center;
}
section.inscrits h3 {
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic;
  font-weight: 600; font-size: 22px; color: #5c4327; margin: 0 0 8px;
}
section.inscrits .noms {
  margin: 0; font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px; line-height: 1.6; color: var(--ink-2);
}
section.inscrits .noms .sep { color: var(--terre); padding: 0 7px; }
/* Le fil : le compte des personnes attendues, tenu entre deux traits fins,
   comme un filet de carton. Ocre, petit, sans crier. */
section.inscrits .fil {
  display: flex; align-items: center; gap: 12px; margin: 2px 0 10px;
}
section.inscrits .fil .trait { flex: 1; height: 1px; background: var(--terre-ln); }
section.inscrits .fil .compte {
  font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--terre); white-space: nowrap;
}
section.inscrits .fil .compte b { font-weight: 700; color: var(--terre-tx); }
section.inscrits .fil .compte .sep { padding: 0 5px; color: var(--terre-ln); }
/* Le nombre de personnes d'un foyer : un petit chiffre en exposant, ocre,
   collé au nom. Assez discret pour ne pas casser la ligne des noms. */
section.inscrits .noms .qui { white-space: nowrap; }
section.inscrits .noms .n {
  display: inline-block; vertical-align: super; margin-left: 2px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 10.5px; line-height: 1; font-weight: 700; color: var(--terre);
  font-variant-numeric: tabular-nums;
}

/* ---- Les jours du midi -------------------------------------------------- */

/* Quatre jours seulement (l'école n'a pas classe le mercredi) : ils tiennent
   sur une ligne, même sur un petit téléphone. Cases larges, c'est un geste de
   pouce et non une case de formulaire administratif. */
.jours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.jour {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 66px; padding: 8px 4px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  user-select: none; text-align: center;
}
.jour:active { border-color: var(--brand-clair); }
.jour input { position: absolute; opacity: 0; pointer-events: none; }
.jour .marque {
  width: 20px; height: 20px; border-radius: 6px; background: var(--bg);
  border: 1.5px solid var(--line-2); position: relative;
}
.jour input:checked ~ .marque { background: var(--brand); border-color: var(--brand); }
/* Le crochet, dessiné en CSS : pas d'image à charger pour vingt pixels. */
.jour input:checked ~ .marque::after {
  content: ""; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.jour input:checked ~ .nom { color: var(--brand-fonce); }
.jour:has(input:checked) { border-color: var(--brand-clair); background: var(--brand-bg); }
.jour input:focus-visible ~ .marque { outline: 3px solid var(--brand-2); outline-offset: 2px; }

/* ---- Le formulaire en quatre questions ---------------------------------- */

/* Un champ d'une ligne : l'intitulé de l'atelier, les dates possibles. */
.champ {
  width: 100%; font-size: 16px; padding: 12px 14px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px;
}
.champ::placeholder { color: var(--muted-2); }
.champ.dates { margin-top: 10px; }
.bloc h4 .facultatif {
  margin-left: 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  font-weight: 600; color: var(--muted-2);
}

/* Les puces des classes : assez larges pour le pouce, assez discrètes pour ne
   pas voler la vedette au champ de saisie. */
.puces { display: flex; flex-wrap: wrap; gap: 7px; }
button.puce {
  padding: 8px 13px; min-height: 38px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 14.5px; color: var(--ink-2);
}
button.puce:active { border-color: var(--brand-clair); background: var(--brand-bg); }
button.puce.niveau { font-weight: 600; font-variant-numeric: tabular-nums; }
button.puce.niveau.actif {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
/* Le nombre d'enfants : deux boutons et un chiffre, plutôt qu'un clavier à
   ouvrir pour taper « 8 ». */
.compte-enfants { display: flex; align-items: center; gap: 10px; }
.compte-enfants .pas {
  flex: 0 0 44px; width: 44px; height: 44px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px;
  font-size: 20px; line-height: 1; color: var(--brand-fonce);
}
.compte-enfants .pas:active { background: var(--brand-bg); border-color: var(--brand-clair); }
.compte-enfants input {
  width: 74px; height: 44px; text-align: center; font-size: 17px; font-weight: 700;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line-2); border-radius: 12px;
  font-variant-numeric: tabular-nums;
}
/* Les flèches natives du champ nombre feraient doublon avec nos deux boutons. */
.compte-enfants input::-webkit-outer-spin-button,
.compte-enfants input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.compte-enfants input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.compte-enfants .unite { font-size: 14px; color: var(--muted); }

/* ---- Ce que la famille propose d'animer --------------------------------- */

.propose textarea {
  width: 100%; min-height: 130px; resize: vertical;
  font-family: inherit; font-size: 16px; line-height: 1.45; color: var(--ink);
  padding: 12px 14px; background: var(--card);
  border: 1px solid var(--line-2); border-radius: 12px;
}
.propose textarea::placeholder { color: var(--muted-2); }
.compteur { margin: 6px 2px 0; text-align: right; font-size: 13px; color: var(--muted-2); }
.compteur.plein { color: var(--terre-tx); }

/* Le prénom du parent qui animerait : dans un couple, ce n'est pas toujours
   celui qu'on croit, et l'organisatrice a besoin de savoir qui appeler. */
.propose .qui {
  width: 100%; font-size: 16px; padding: 11px 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--card);
}
