/* Gabarit du site. Les couleurs et la police viennent de theme.css, généré depuis theme.yaml. */
:root {
  --carte: #ffffff;
  --survol: #f3f5fa;
  --encart: #fff8e8;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond);
}

[hidden] { display: none !important; }

/* En-tête */
.entete { background: var(--nuit); color: #fff; }
.entete-int {
  max-width: 820px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.entete img { height: 34px; width: auto; display: block; }
.entete img:not([src]) { visibility: hidden; }
.entete a.retour { color: #fff; font-size: 14px; text-decoration: none; opacity: .8; }
.entete a.retour:hover { color: var(--accent); opacity: 1; }

.bandeau-prototype {
  background: var(--accent);
  color: var(--nuit);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
}

.bandeau { background: var(--nuit-2); color: #fff; }
.bandeau-int { max-width: 820px; margin: 0 auto; padding: 40px 16px 44px; }
.surtitre {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.bandeau h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.2; font-weight: 700; margin: 0; }
.bandeau p.chapeau { margin: 14px 0 0; color: #c9cfdb; max-width: 640px; }

/* Contenu */
main { max-width: 820px; margin: -20px auto 0; padding: 0 16px 64px; }
.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 14px;
  padding: clamp(22px, 5vw, 44px);
}
.carte + .carte { margin-top: 20px; }

h2 { font-size: 22px; line-height: 1.3; font-weight: 700; color: var(--nuit); margin: 36px 0 12px; }
h2:first-child { margin-top: 0; }
p { margin: 0 0 14px; }
strong { color: var(--nuit); font-weight: 600; }

/* Manuel : texte issu de manuel.md */
.manuel ul { padding-left: 22px; margin: 0 0 14px; }
.manuel li { margin-bottom: 6px; }

/* Frise : la liste numérotée qui suit directement un titre (« Notre démarche ») */
.manuel h2 + ol {
  list-style: none;
  counter-reset: etape;
  padding: 0;
  margin: 8px 0 0;
}
.manuel h2 + ol li {
  counter-increment: etape;
  position: relative;
  padding: 0 0 18px 52px;
  margin: 0;
  color: var(--texte-2);
}
.manuel h2 + ol li::before {
  content: counter(etape);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--nuit);
  color: var(--accent);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.manuel h2 + ol li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 38px;
  bottom: 4px;
  width: 2px;
  background: var(--bord);
}
.manuel h2 + ol li strong:first-child { display: block; font-size: 17px; margin-bottom: 4px; }

/* Liste numérotée après un paragraphe (les 10 points du cahier des charges) */
.manuel p + ol { columns: 2 300px; column-gap: 32px; padding-left: 22px; margin: 0 0 14px; }
.manuel p + ol li { break-inside: avoid; margin-bottom: 4px; }

.manuel blockquote {
  background: var(--encart);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 8px 0 0;
}
.manuel blockquote p { margin: 0; }

.manuel > p:last-child {
  margin: 28px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--bord);
  color: var(--texte-2);
}

/* Acceptation */
.acceptation { background: var(--nuit); color: #fff; border: none; }
.case { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; font-size: 17px; }
.case input {
  appearance: none;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: 2px 0 0;
  border: 2px solid var(--accent);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.case input::after {
  content: "";
  width: 6px;
  height: 12px;
  border: solid var(--nuit);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
}
.case input:checked { background: var(--accent); }
.case input:checked::after { opacity: 1; }
.case input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.case strong { color: #fff; }
.obligatoire { color: var(--accent); }
.acceptation .note { color: #aab3c5; font-size: 14px; margin: 14px 0 0 38px; }

/* Boutons */
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.acceptation .actions { margin-left: 38px; }
.bouton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--nuit);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.bouton:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
.bouton:focus-visible { outline: 3px solid var(--nuit); outline-offset: 2px; }
.bouton.secondaire { background: transparent; border-color: var(--bord); color: var(--texte); }
.bouton.secondaire:hover { border-color: var(--nuit); }

/* Bouton inactif tant que la case n'est pas cochée : géré en CSS, sans dépendre du JavaScript */
.acceptation:not(:has(#accepte:checked)) .bouton {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Questionnaire */
.progression { margin: 22px 0 0; }
.progression-texte { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: #c9cfdb; margin-bottom: 8px; }
.progression-barre { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.progression-barre span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }

.intro { color: var(--texte-2); border-bottom: 1px solid var(--bord); padding-bottom: 22px; margin-bottom: 30px; }
.intro p:last-child { margin-bottom: 0; }

fieldset { border: none; margin: 0 0 34px; padding: 0; min-width: 0; }
legend { font-size: 17px; font-weight: 600; color: var(--nuit); padding: 0; margin-bottom: 4px; }
.aide { font-size: 14px; color: var(--texte-2); margin: 0 0 12px; }

.choix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: 10px;
  margin-top: 12px;
}
.choix.large { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.option {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1.5px solid var(--bord);
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.4;
  transition: border-color .15s, background .15s;
}
.option:hover { border-color: var(--texte-2); }
.option input {
  appearance: none;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid var(--texte-2);
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.option input[type="radio"]:checked { border: 6px solid var(--nuit); }
.option input[type="checkbox"] { border-radius: 5px; }
.option input[type="checkbox"]:checked { background: var(--nuit); border-color: var(--nuit); }
.option input[type="checkbox"]::after {
  content: "";
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
}
.option input[type="checkbox"]:checked::after { opacity: 1; }
.option input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.option:has(input:checked) { border-color: var(--nuit); background: var(--survol); }
.option small { display: block; color: var(--texte-2); font-size: 13.5px; margin-top: 3px; }
.option.alternative { margin-top: 10px; border-style: dashed; }

/* Champs de saisie */
.champ { display: block; margin-top: 12px; }
.champ > span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--texte);
  background: #fff;
  padding: 12px 14px;
  border: 1.5px solid var(--bord);
  border-radius: 10px;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--nuit); }
input:disabled, textarea:disabled { background: var(--fond); color: var(--texte-2); }
.compteur { font-size: 13px; color: var(--texte-2); margin-top: 4px; text-align: right; }
.compteur.atteint { color: var(--nuit); }

.groupe { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 0 14px; }

.precision { margin-top: 14px; }

.depot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 18px;
  border: 1.5px dashed var(--bord);
  border-radius: 10px;
}
.depot ul { margin: 0; padding-left: 20px; font-size: 14px; }
.depot ul:empty { display: none; }
.depot .aide { margin: 0; }
.depot .bouton { padding: 9px 20px; font-size: 15px; }
.depot .bouton:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
input.cache { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.depot .retirer { font: inherit; font-size: 13px; color: var(--erreur); background: none; border: none; cursor: pointer; padding: 0 0 0 8px; }

/* Erreurs */
.message-erreur { color: var(--erreur); font-size: 14px; font-weight: 500; margin: 8px 0 0; }
.message-erreur:empty { display: none; }
fieldset.manquant .option:not(:has(input:checked)) { border-color: #f0b7b7; }
fieldset.manquant input:not([type="radio"]):not([type="checkbox"]),
fieldset.manquant textarea { border-color: var(--erreur); }

.pied-etape {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--bord);
}
.mention { font-size: 13.5px; color: var(--texte-2); margin-top: 18px; }

/* Confirmation */
.confirmation p:first-child strong { font-size: 20px; }
.envoi-prototype { margin-top: 24px; font-size: 14px; }
.envoi-prototype pre {
  background: var(--fond);
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: 14px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .acceptation .note, .acceptation .actions { margin-left: 0; }
  .pied-etape .bouton { flex: 1 1 100%; justify-content: center; }
  .entete img { height: 28px; }
}
