/* Formulaires Koovo. Une feuille pour les cinq formulaires et leurs pages merci.
   Même papier que le site : crème et encre, la police du téléphone, des filets.
   Une couleur = un rôle : Menthe = validé (les tampons, la case cochée), Corail = ce qui manque.
   Le bouton principal est noir, jamais en couleur. Pensé pour un iPhone tenu d'une main. */

:root {
  color-scheme: light dark;
  --fond: #F5F3EE;
  --surface: #FFFFFF;
  --creux: #ECE9E2;
  --encre: #1B1B1F;
  --texte-2: #5F5D57;
  --filet: rgba(27, 27, 31, 0.12);
  --filet-fort: rgba(27, 27, 31, 0.22);
  --menthe: #19C08A; --menthe-fond: #DCF6EA; --menthe-fonce: #0B4D36;
  --corail: #FF5C3A; --corail-fond: #FFE3DC; --corail-fonce: #6B1F0F;
  --bouton-fond: #1B1B1F; --bouton-texte: #F5F3EE;
  --police: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --police-titre: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gouttiere: 20px;
  --rayon: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #17171A; --surface: #232327; --creux: #1E1E22; --encre: #F3F2EF; --texte-2: #A8A6A0;
    --filet: rgba(243, 242, 239, 0.12); --filet-fort: rgba(243, 242, 239, 0.24);
    --menthe: #2ADBA0; --menthe-fond: #123A2C; --menthe-fonce: #8CF0CC;
    --corail: #FF7355; --corail-fond: #40201A; --corail-fonce: #FFC2B3;
    --bouton-fond: #F3F2EF; --bouton-texte: #17171A;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--fond); color: var(--encre); }
body {
  font: 400 17px/1.45 var(--police); -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1; min-height: 100vh; min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }
[hidden] { display: none !important; }

.page {
  max-width: 520px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) var(--gouttiere) calc(112px + env(safe-area-inset-bottom));
}

/* En-tête : le mot Koovo, le compteur, la ligne de tampons */
.haut { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.logo { display: block; height: 22px; width: auto; }
.progression { display: flex; align-items: center; gap: 12px; }
.compte { font-size: 14px; font-weight: 600; color: var(--texte-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tampons { display: flex; gap: 6px; }
.tampons span {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--filet-fort); flex: none;
  transition: background-color .25s ease, border-color .25s ease, transform .3s cubic-bezier(.34, 1.4, .64, 1);
}
.tampons .fait { background: var(--menthe); border-color: var(--menthe); }
.tampons .ici { border-color: var(--encre); }
.tampons .fait.vient { transform: scale(1.18); }

.chapeau { margin: 26px 0 0; font-size: 15px; font-weight: 600; color: var(--texte-2); letter-spacing: -0.005em; }

/* L'écran d'une question */
.ecran { outline: none; }
.ecran.entre { animation: entre .26s cubic-bezier(.2, .8, .2, 1) both; }
.ecran.entre-retour { animation: entre-retour .26s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes entre { from { opacity: 0; transform: translateX(18px); } }
@keyframes entre-retour { from { opacity: 0; transform: translateX(-18px); } }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; display: block; width: 100%; }
.question {
  margin: 6px 0 0; font: 700 30px/1.12 var(--police-titre); letter-spacing: -0.028em;
  text-wrap: balance; outline: none;
}
.aide { margin: 10px 0 0; color: var(--texte-2); font-size: 16px; }

.champ { margin-top: 22px; }
.champ + .champ { margin-top: 18px; }
.libelle { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.aide-champ { display: block; font-size: 14px; color: var(--texte-2); margin-top: 7px; }

/* Les choix : une liste groupée comme dans les Réglages de l'iPhone, une ligne par réponse.
   Choisir, c'est tamponner : le rond vide de la carte se remplit en Menthe, la ligne passe en Menthe clair. */
.choix-liste {
  display: grid; background: var(--surface); border: 1px solid var(--filet-fort); border-radius: var(--rayon); overflow: hidden;
}
.choix {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 14px 16px 14px 18px;
  font-weight: 600; font-size: 17px; line-height: 1.25; cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background-color .15s ease;
}
.choix + .choix { box-shadow: inset 0 1px 0 var(--filet); }
.choix:active { background: var(--creux); }
.choix input, .pastille-choix input, .note input, .accord input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.choix .texte { flex: 1; }
.marque {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--filet-fort);
  display: grid; place-items: center; transition: background-color .15s ease, border-color .15s ease, transform .25s cubic-bezier(.34, 1.5, .64, 1);
}
.multi .marque { border-radius: 8px; }
.marque svg { width: 15px; height: 15px; opacity: 0; transition: opacity .15s ease; }
.choix.choisi { background: var(--menthe-fond); }
.choix.choisi .marque { background: var(--menthe); border-color: var(--menthe); color: #1B1B1F; transform: scale(1.06); }
.choix.choisi .marque svg { opacity: 1; }

/* Trois choix courts (Lille, Paris, Ailleurs) : côte à côte, comme un sélecteur iOS */
.choix-liste.en-ligne { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.en-ligne .choix { justify-content: center; text-align: center; padding: 14px 8px; }
.en-ligne .choix + .choix { box-shadow: inset 1px 0 0 var(--filet); }
.en-ligne .choix .marque { display: none; }
.en-ligne .choix.choisi { background: var(--encre); color: var(--fond); }
.choix:has(input:focus-visible), .pastille-choix:has(input:focus-visible), .note:has(input:focus-visible), .accord:has(input:focus-visible) { outline: 2px solid var(--encre); outline-offset: -2px; }

/* Texte libre */
.saisie {
  display: block; width: 100%; background: var(--surface); border: 1px solid var(--filet-fort); border-radius: var(--rayon);
  padding: 14px 16px; font-size: 17px; line-height: 1.4; resize: none; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.saisie { min-height: 0; }
.saisie::placeholder { color: var(--texte-2); opacity: .75; }
.saisie:focus { border-color: var(--encre); box-shadow: 0 0 0 1px var(--encre); }
.limite { display: block; text-align: right; font-size: 13px; color: var(--texte-2); margin-top: 6px; }
.limite.depasse { color: var(--corail-fonce); font-weight: 600; }

/* « Rien pour l'instant » : une pastille sous la question */
.pastille-choix {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 18px;
  border: 1px solid var(--filet-fort); border-radius: 999px; background: transparent; font-weight: 600; font-size: 16px; cursor: pointer;
  user-select: none; -webkit-user-select: none; transition: background-color .15s ease, color .15s ease;
}
.pastille-choix.choisi { background: var(--encre); border-color: var(--encre); color: var(--fond); }

/* La note : cinq tampons */
.notes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 4px; }
.note {
  position: relative; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--filet-fort); background: var(--surface);
  display: grid; place-items: center; font: 700 22px/1 var(--police-titre); cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background-color .15s ease, border-color .15s ease, transform .25s cubic-bezier(.34, 1.4, .64, 1);
}
.note.plein { background: var(--menthe); border-color: var(--menthe); color: #1B1B1F; }
.note.choisi { transform: scale(1.08); }
.notes-legende { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14px; color: var(--texte-2); }

/* Le consentement */
.accord {
  position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--filet-fort); border-radius: var(--rayon); font-size: 15px; line-height: 1.45; cursor: pointer;
}
.accord .case {
  flex: none; width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--filet-fort); display: grid; place-items: center; margin-top: 1px;
  transition: background-color .15s ease, border-color .15s ease;
}
.accord .case svg { width: 15px; height: 15px; opacity: 0; color: #1B1B1F; }
.accord.choisi { border-color: var(--encre); }
.accord.choisi .case { background: var(--menthe); border-color: var(--menthe); }
.accord.choisi .case svg { opacity: 1; }

/* Ce qui manque */
.erreur { display: flex; gap: 8px; align-items: baseline; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--corail-fonce); }
.erreur::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--corail); transform: translateY(-1px); }
.champ.a-revoir .saisie, .champ.a-revoir .accord { border-color: var(--corail); box-shadow: 0 0 0 1px var(--corail); }

/* Le mot de l'équipe, sur le premier écran */
.mot { margin: 30px 0 0; padding: 16px 0 0; border-top: 1px solid var(--filet); font-size: 15px; color: var(--texte-2); }
.mot b { display: block; margin-top: 4px; color: var(--encre); font-weight: 600; }

/* Mentions RGPD, en bas de chaque formulaire */
.mentions { margin-top: 34px; font-size: 13px; line-height: 1.5; color: var(--texte-2); }
.mentions p { margin: 0; }
.mentions details { margin-top: 6px; }
.mentions summary { cursor: pointer; font-weight: 600; color: var(--encre); list-style: none; display: inline-flex; min-height: 32px; align-items: center; }
.mentions summary::-webkit-details-marker { display: none; }
.mentions summary::after { content: " +"; white-space: pre; }
.mentions details[open] summary::after { content: " −"; }
.mentions details p + p { margin-top: 8px; }

/* La barre du bas : retour et suivant, à portée du pouce */
.barre {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: color-mix(in srgb, var(--fond) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--filet);
}
.barre-dedans {
  max-width: 520px; margin: 0 auto; display: flex; gap: 10px;
  padding: 12px var(--gouttiere) calc(12px + env(safe-area-inset-bottom));
}
.bouton {
  flex: 1; min-height: 56px; border: 0; border-radius: var(--rayon); background: var(--bouton-fond); color: var(--bouton-texte);
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: opacity .15s ease, transform .12s ease;
}
.bouton:active { transform: scale(.985); }
.bouton[aria-disabled="true"] { opacity: .32; }
.bouton.envoi { opacity: .7; pointer-events: none; }
.retour {
  flex: none; width: 56px; min-height: 56px; border-radius: var(--rayon); border: 1px solid var(--filet-fort); background: transparent;
  display: grid; place-items: center; cursor: pointer;
}
.retour svg { width: 22px; height: 22px; }

.bandeau {
  margin: 0 auto; max-width: 520px; padding: 0 var(--gouttiere);
}
.bandeau p {
  margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--corail-fond); color: var(--corail-fonce);
  font-size: 15px; font-weight: 600;
}

/* Chargement, lien cassé */
.attente { margin-top: 40px; color: var(--texte-2); font-size: 16px; }
.attente::before {
  content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--filet-fort);
  border-top-color: var(--encre); margin-right: 10px; vertical-align: -2px; animation: tourne .8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
.texte-page { font-size: 17px; color: var(--texte-2); margin: 14px 0 0; }
.texte-page strong { color: var(--encre); font-weight: 600; }
.lien-bouton { margin-top: 26px; display: flex; }

/* Le piège à robots : invisible pour un humain, rempli par un robot */
.piege { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Pages merci */
.merci { padding-top: 34px; }
.merci h1 { margin: 26px 0 0; font: 700 32px/1.1 var(--police-titre); letter-spacing: -0.03em; text-wrap: balance; }
.merci .texte-page { font-size: 18px; color: var(--encre); }
.merci .texte-page + .texte-page { color: var(--texte-2); font-size: 17px; }
.signature { margin-top: 22px; font-weight: 600; }
.carte-pleine { display: flex; gap: 8px; margin-top: 30px; }
.carte-pleine span { width: 16px; height: 16px; border-radius: 50%; background: var(--menthe); }
.numero {
  margin-top: 22px; padding: 16px; border-radius: var(--rayon); background: var(--surface); border: 1px solid var(--filet-fort);
  font-size: 15px; color: var(--texte-2);
}
.numero b { display: block; margin-top: 4px; font: 700 24px/1.2 var(--police-titre); color: var(--encre); letter-spacing: -0.01em; }

@media (max-width: 360px) {
  :root { --gouttiere: 16px; }
  .question { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
