/* Style corporate sobre : fond noir, police système, formulaire compact. Chaque étape tient dans un écran. */
:root {
  --fond: #07060a;
  --surface: #111017;
  --surface-2: #17151f;
  --encre: #f1eef6;
  --muet: #a49cb1;
  --discret: #6f6880;
  --filet: #2a2533;
  --filet-fort: #3d3549;
  --accent: #c2a0e8;
  --succes: #9fe0bf;
  --erreur: #ff8a8a;
  --barre: linear-gradient(90deg, #f2a8d0, #c2a0e8 45%, #8fe0e6);
  --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rayon: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--fond); }
[hidden] { display: none !important; }

/* ---------- conteneur : une colonne centrée, hauteur d'un écran ---------- */
.planche {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
}
@media (min-width: 760px) { .planche { padding: 48px 24px 24px; } }
@media (min-height: 700px) and (min-width: 760px) { .planche { justify-content: center; } }

.label { font-size: 12px; color: var(--muet); letter-spacing: .02em; }

/* ---------- progression ---------- */
.progression { margin-bottom: 22px; }
.compteur { display: flex; justify-content: space-between; font-size: 12px; color: var(--muet); margin-bottom: 8px; }
.compteur #nom-etape { color: var(--discret); }
.barre { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.barre i { display: block; height: 100%; width: 25%; border-radius: 99px; background: var(--barre); transition: width .45s cubic-bezier(.2, .8, .2, 1); }

/* ---------- titres ---------- */
.titre {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -.01em;
  margin: 0;
}
@media (min-width: 760px) { .titre { font-size: 28px; } }
.titre:focus { outline: none; }
.chapeau { margin: 6px 0 0; color: var(--muet); font-size: 15px; }

/* ---------- étapes ---------- */
.etape { display: none; }
.etape.active { display: block; animation: entree .3s ease-out; }
@keyframes entree { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .etape.active { animation: none; } .barre i { transition: none; } }
.formulaire { margin-top: 18px; }

/* ---------- ressources ---------- */
.ressources { margin: 0; padding: 0; border: 0; display: grid; gap: 10px; }
.ressources legend { padding: 0; margin-bottom: 8px; font-size: 13px; color: var(--muet); }
.ressource {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 2px 12px;
  padding: 13px 14px;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.ressource:hover { border-color: var(--filet-fort); }
.ressource:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.ressource input, .consentement input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1.5px solid var(--filet-fort);
  border-radius: 5px;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ressource input::after, .consentement input::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--fond);
  border-bottom: 2px solid var(--fond);
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}
.ressource input:checked, .consentement input:checked { background: var(--accent); border-color: var(--accent); }
.ressource input:checked::after, .consentement input:checked::after { opacity: 1; }
.ressource input:focus-visible, .consentement input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ressource .nom { grid-column: 2; font-weight: 600; font-size: 15px; }
.ressource .promesse { grid-column: 2; color: var(--muet); font-size: 13.5px; line-height: 1.4; }
.ressource .origine { grid-column: 2; color: var(--discret); font-size: 12px; margin-top: 2px; }

/* ---------- champs ---------- */
.champ { margin-top: 14px; }
.champ:first-child { margin-top: 0; }
.champ label { display: block; font-size: 13px; color: var(--muet); margin-bottom: 6px; }
.champ input, .champ select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16 px minimum : pas de zoom automatique sur iPhone */
  color: var(--encre);
  background: var(--surface);
  border: 1px solid var(--filet-fort);
  border-radius: var(--rayon);
  padding: 12px 13px;
  appearance: none;
  -webkit-appearance: none;
}
.champ select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muet) 50%), linear-gradient(135deg, var(--muet) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.champ input:focus, .champ select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194, 160, 232, .18); }
.champ input[aria-invalid="true"], .champ select[aria-invalid="true"] { border-color: var(--erreur); }
.note { margin: 6px 0 0; font-size: 12.5px; color: var(--discret); }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.deux .champ { margin-top: 0; }
.deux + .champ { margin-top: 14px; }

.consentement {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muet);
  cursor: pointer;
}
.consentement a { color: var(--encre); }

.erreur { margin: 10px 0 0; font-size: 13px; color: var(--erreur); }
.erreur:empty { display: none; }
.turnstile { margin-top: 12px; }
.turnstile:empty { display: none; }

/* ---------- boutons ---------- */
.actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--fond);
  background: var(--encre);
  border: 1px solid var(--encre);
  border-radius: var(--rayon);
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
  -webkit-tap-highlight-color: transparent;
}
.bouton:hover { background: #fff; }
.bouton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bouton[disabled] { opacity: .5; cursor: progress; }
.bouton.secondaire { background: transparent; color: var(--encre); border-color: var(--filet-fort); }
.bouton.secondaire:hover { border-color: var(--encre); }
.actions .bouton.plein { flex: 1; }
@media (min-width: 560px) { .actions .bouton.plein { flex: 0 0 auto; min-width: 200px; } }
.retour {
  font: inherit;
  font-size: 14px;
  color: var(--muet);
  background: none;
  border: 0;
  padding: 10px 4px;
  cursor: pointer;
}
.retour:hover { color: var(--encre); }

/* ---------- confirmation et offre dirigeant ---------- */
.liste-envoyee { margin: 14px 0 0; padding: 0; list-style: none; }
.liste-envoyee li { padding: 7px 0 7px 22px; position: relative; font-size: 14px; }
.liste-envoyee li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 9px; height: 5px; border-left: 2px solid var(--succes); border-bottom: 2px solid var(--succes); transform: rotate(-45deg); }
.offre {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--filet-fort);
  border-radius: var(--rayon);
  background: var(--surface);
}
.offre .label { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.offre .titre { font-size: 19px; margin-top: 4px; }
.offre .chapeau { font-size: 14px; }
.offre .actions { margin-top: 14px; }
.offre .actions .bouton { flex: 1; }
.reserve { margin: 10px 0 0; font-size: 13.5px; color: var(--succes); }
.reserve:empty { display: none; }
#cal { width: 100%; }
#cal.ouvert { margin-top: 12px; min-height: 480px; }
/* Une fois le calendrier ouvert, il prend tout l'écran de l'étape */
.etape.mode-calendrier > .titre,
.etape.mode-calendrier > .chapeau,
.etape.mode-calendrier > .liste-envoyee,
.etape.mode-calendrier .offre > .label,
.etape.mode-calendrier .offre > .titre,
.etape.mode-calendrier .offre > .chapeau { display: none; }
.etape.mode-calendrier .offre { margin-top: 0; padding: 0; border: 0; background: none; }

/* ---------- pied ---------- */
.pied { margin-top: auto; padding-top: 18px; display: flex; gap: 16px; font-size: 12px; color: var(--discret); }
.pied a { color: var(--discret); text-decoration: none; }
.pied a:hover { color: var(--muet); }

/* ---------- pages de texte : guides, confidentialité, désinscription, 404 ---------- */
.entete { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muet); margin-bottom: 26px; }
.entete .marque { color: var(--encre); font-weight: 600; text-decoration: none; }
.coin, .vertical, .specimen { display: none !important; }
.titre.guide { font-size: 26px; }
@media (min-width: 760px) { .titre.guide { font-size: 32px; } }
.titre span { display: inline; }
.actions-guide { flex-wrap: wrap; }
.texte { margin-top: 26px; font-size: 15.5px; line-height: 1.6; }
.texte h2 { font-size: 19px; font-weight: 650; margin: 32px 0 10px; padding-top: 18px; border-top: 1px solid var(--filet); }
.texte h3 { font-size: 15px; margin: 22px 0 6px; }
.texte p, .texte li { color: #dcd7e4; }
.texte ul, .texte ol { padding-left: 1.2em; }
.texte li { margin: 5px 0; }
.texte strong { color: var(--encre); font-weight: 600; }
.texte a { color: var(--accent); text-underline-offset: 3px; }
.texte code { font-family: ui-monospace, Menlo, monospace; font-size: .86em; background: var(--surface-2); border: 1px solid var(--filet); border-radius: 5px; padding: 1px 5px; word-break: break-word; }
.texte pre { background: var(--surface); border: 1px solid var(--filet-fort); border-radius: var(--rayon); padding: 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.texte pre code { background: none; border: 0; padding: 0; font-size: 13px; line-height: 1.6; }
.copier {
  display: block;
  margin: 6px 0 16px auto;
  font: inherit;
  font-size: 12.5px;
  color: var(--encre);
  background: transparent;
  border: 1px solid var(--filet-fort);
  border-radius: 7px;
  padding: 6px 12px;
  cursor: pointer;
}
.copier:hover { border-color: var(--encre); }
.planche:has(.texte), .planche.texte-long { max-width: 720px; display: block; }

/* ---------- statistiques (admin) ---------- */
.stats { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
.stats th, .stats td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--filet); white-space: nowrap; }
.stats th:first-child, .stats td:first-child { text-align: left; }
.stats th { color: var(--muet); font-weight: 500; font-size: 12.5px; }

.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media print {
  .copier, .actions-guide { display: none; }
  .texte h2 { break-after: avoid; }
  .texte pre { break-inside: avoid; }
}
/* Grand écran : le formulaire et sa barre au centre de la page, le pied juste dessous */
@media (min-height: 700px) and (min-width: 760px) { .planche:not(.texte-long):not(:has(.texte)) .pied { margin-top: 36px; } }
