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

.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 trajets : ocre tant que rien n'est proposé,
   sarcelle dès qu'une place 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;
}

/* ---- Le prénom qui conduit et le mot ------------------------------------ */

.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: 64px; 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; }

/* ---- L'illustration du carton (facultative) ----------------------------- */

.carton .illustration {
  display: block; width: 100%; max-width: 220px; height: auto; margin: 10px auto 0;
}

/* Raccourci vers l'inscription, sous la consigne : la vue d'ensemble est
   longue sur téléphone. */
a.aller-inscription {
  display: block; width: fit-content; margin: 10px auto 0; padding: 9px 18px;
  border-radius: 999px; font-size: 14.5px; font-weight: 600; text-decoration: none;
  background: var(--brand); color: #fff;
}
a.aller-inscription:active { background: var(--brand-fonce); }

/* ---- Vue d'ensemble : une carte par vendredi ----------------------------- */

section.ensemble {
  background: var(--papier); border: 1px solid var(--terre-ln);
  border-radius: 16px; margin: 16px 0 0; padding: 16px 14px 8px;
}
section.ensemble h3 {
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic;
  font-weight: 600; font-size: 24px; color: #5c4327; margin: 0 0 8px; text-align: center;
}
section.ensemble .fil { display: flex; align-items: center; gap: 12px; margin: 2px 0 6px; }
section.ensemble .fil .trait { flex: 1; height: 1px; background: var(--terre-ln); }
section.ensemble .fil .compte {
  font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--terre); white-space: nowrap;
}
section.ensemble .fil .compte b { font-weight: 700; color: var(--terre-tx); }

/* L'intitulé du mois, entre deux groupes de vendredis. */
h4.mois {
  margin: 14px 2px 6px; font-size: 12.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--brand-fonce); font-weight: 600;
}
section.inscription h4.mois { color: var(--brand-fonce); }

.seance {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px 4px; margin: 0 0 8px;
}
.seance .date {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700; font-size: 20px; line-height: 1.15; color: var(--brand-fonce);
  margin: 0 0 4px;
}
/* Une séance passée reste lisible mais s'efface : elle ne se modifie plus. */
.seance.passe { opacity: .55; }
.seance.passe .date { color: var(--muted); }

.trajet { padding: 6px 0 8px; border-top: 1px solid var(--line); }
.seance .date + .trajet { border-top: 0; }
.trajet .tete, .choix .bascule {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.trajet .lib, .choix .lib { font-weight: 700; font-size: 15px; color: var(--ink); }
.trajet .horaire, .choix .horaire { font-size: 13px; color: var(--muted); }

/* La jauge : sarcelle pour ce qui est offert, sur un fond ocre clair pour ce
   qui manque. Pleine, elle passe toute en sarcelle. */
.jauge { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.barre {
  flex: 1; height: 10px; border-radius: 999px; overflow: hidden;
  background: var(--terre-bg); border: 1px solid var(--terre-ln);
}
.barre span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.trajet.complet .barre { border-color: var(--brand-clair); }
.jauge .compte {
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.etat { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.etat.manque { color: var(--terre); }
.etat.complet { color: var(--brand); }
.etat .coche {
  width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff;
}
.trajet .noms {
  margin: 4px 0 0; font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 16.5px; line-height: 1.4; color: var(--ink-2);
}
.trajet .noms .sep { color: var(--terre); padding: 0 2px; }
.trajet .noms .qui { white-space: nowrap; }

/* ---- Les trajets de la famille : un bouton par trajet, un stepper quand
   il est proposé ------------------------------------------------------------ */

.mes-trajets .seance { background: var(--bg); }
.choix {
  margin: 6px 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--card);
}
.choix .bascule {
  width: 100%; text-align: left; cursor: pointer; color: var(--ink);
  background: none; border: 0; padding: 10px 12px; min-height: 48px;
  align-items: center;
}
.choix .bascule .dispo {
  margin-left: auto; font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.choix .bascule .coche, .choix .bascule .vide {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; line-height: 1;
}
.choix .bascule .vide { border: 1.5px solid var(--line-2); background: #fff; }
.choix .bascule .coche { background: #fff; color: var(--brand); }
.choix.actif { border-color: var(--brand); }
.choix.actif .bascule { background: var(--brand); }
.choix.actif .bascule .lib { color: #fff; }
.choix.actif .bascule .horaire, .choix.actif .bascule .dispo { color: rgba(255,255,255,.85); }
.choix .bascule[disabled] { cursor: default; }
.choix.passe { opacity: .6; }

.stepper {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: var(--brand-bg); border-top: 1px solid var(--brand-clair);
}
.stepper button {
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  font-size: 22px; font-weight: 700; line-height: 1;
  background: #fff; color: var(--brand-fonce); border: 1px solid var(--brand-clair);
}
.stepper button:active { background: var(--brand-clair); }
.stepper button[disabled] { opacity: .4; cursor: default; }
.stepper .n {
  min-width: 26px; text-align: center; font-size: 22px; font-weight: 700;
  color: var(--brand-fonce); font-variant-numeric: tabular-nums;
}
.stepper .unite { font-size: 14px; color: var(--brand-fonce); }
.stepper.fige { font-size: 14px; font-weight: 600; color: var(--brand-fonce); }
