/* Les pôles des parents des Pastoureaux : feuille de style unique.
   Mobile uniquement, aucun CDN, aucune police externe. Ossature et palette
   reprises du foyer de mini-sites (ateliers, dîner, agenda, ménage, travaux,
   paniers, portail) : neutres stone, bleu sarcelle sauge du logo pour
   l'identité, ocre pour l'accent. 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, textarea { 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 --------------------------------------------------------- */

.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 .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 du Conseil ------------------------------------------------- */

.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; }

/* Une mention discrète, en italique, sous le mot. */
.mention { margin: 12px 8px 0; text-align: center; font-style: italic; font-size: 14.5px; color: var(--muted); }

/* ---- 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;
}

/* ---- L'inscription de la famille --------------------------------------- */

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 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;
}
button.lien.retrait { display: block; margin: 4px 0 0; color: var(--muted); }

/* Le rappel au-dessus des pôles : ocre tant que rien n'est coché, sarcelle
   dès qu'un pôle l'est. */
.rappel {
  margin: 0 0 12px; 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;
}

/* ---- Les pôles : une carte illustrée par pôle, deux par ligne ------------ */

.poles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
button.pole {
  width: 100%; text-align: left; display: flex; flex-direction: column; align-items: stretch;
  gap: 4px; padding: 8px 10px 11px; cursor: pointer; color: var(--ink);
  background: var(--papier); border: 1px solid var(--terre-ln); border-radius: 14px;
}
button.pole:active { border-color: var(--brand-clair); }
button.pole[disabled] { opacity: .7; cursor: default; }
button.pole .illustration { display: block; width: 100%; max-width: 190px; height: auto; margin: 0 auto 2px; }
button.pole .groupe {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--terre); font-weight: 600;
}
button.pole .ligne { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
button.pole .lib {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700; font-size: 19px; line-height: 1.1; color: var(--brand-fonce);
}
button.pole .desc { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
button.pole .compte {
  align-self: flex-start; margin-top: 4px; font-size: 11.5px; color: var(--brand-fonce);
  background: var(--brand-bg); border: 1px solid var(--brand-clair);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
button.pole .compte.vide { color: var(--muted); background: var(--bg); border-color: var(--line); }
button.pole .coche {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; color: var(--brand); font-weight: 700; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
button.pole.actif { background: var(--brand); border-color: var(--brand); }
button.pole.actif .lib, button.pole.actif .groupe { color: #fff; }
button.pole.actif .desc { color: rgba(255,255,255,.85); }
button.pole.actif .compte { color: #fff; background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); }

/* ---- Le mot libre ------------------------------------------------------- */

.bloc { margin-top: 6px; }
.bloc h4 .facultatif {
  margin-left: 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  font-weight: 600; color: var(--muted-2);
}
.propose textarea {
  width: 100%; min-height: 90px; 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); }
.propose .qui {
  width: 100%; font-size: 16px; padding: 11px 14px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--card);
}
.valider {
  width: 100%; margin: 12px 0 0; padding: 12px 16px; min-height: 48px;
  border: 0; border-radius: 14px; font-size: 15.5px; font-weight: 700;
  background: var(--brand); color: #fff; cursor: pointer;
}
.valider:active { background: var(--brand-fonce); }
.valider.secondaire {
  background: var(--brand-bg); color: var(--brand-fonce); border: 1px solid var(--brand-clair);
}
.valider.secondaire:active { background: var(--brand-clair); }
.valider[disabled] { opacity: .6; cursor: default; }
.etat-sauvegarde { min-height: 20px; margin: 8px 0 0; font-size: 13.5px; color: var(--brand); text-align: right; }

/* ---- Les familles de chaque pôle ---------------------------------------- */

section.inscrits {
  background: var(--papier); border: 1px solid var(--terre-ln);
  border-radius: 16px; margin: 16px 0 0; padding: 16px 18px 10px; 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 .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); }
.pole-liste { margin: 0 0 12px; }
.pole-liste h4 {
  margin: 0 0 2px; font-size: 12.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--brand-fonce); font-weight: 600;
}
.pole-liste h4 .n { color: var(--terre); margin-left: 4px; }
.pole-liste .noms {
  margin: 0; font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 17px; line-height: 1.5; color: var(--ink-2);
}
.pole-liste .noms.vide { font-style: italic; color: var(--muted-2); font-size: 15px; }
.pole-liste .noms .sep { color: var(--terre); padding: 0 6px; }
.pole-liste .noms .qui { white-space: nowrap; }
