:root {
  --fond: #f5f3ee;
  --carte: #ffffff;
  --encre: #1d2321;
  --doux: #59625f;
  --accent: #1f6f68;
  --accent-fonce: #17534e;
  --accent-clair: #eaf4f2;
  --ligne: #d9d5cc;
  --perso: #e1f0ed;
  --perso-texte: #15504b;
  --pro: #e7e5f6;
  --pro-texte: #39337d;
  --erreur: #b3261e;
}

* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

.progression { position: sticky; top: 0; height: 6px; background: var(--ligne); z-index: 10; }
#barre { height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }

main { max-width: 680px; margin: 0 auto; padding: 2rem 1rem 4rem; }
main.large { max-width: 1180px; }

h1 { font-size: 1.85rem; line-height: 1.2; margin: 1.5rem 0 .75rem; }
h2 { font-size: 1.3rem; margin: 0 0 1.25rem; }
.sous-titre { font-size: 1.1rem; color: var(--doux); }

.carte {
  background: var(--carte);
  border: 1px solid var(--ligne);
  border-radius: 14px;
  padding: 1.5rem;
}
.centre { text-align: center; }

.intro {
  background: #f1efe9;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: .75rem 1rem;
  margin: 0 0 1.5rem;
  font-style: italic;
}

fieldset.question { border: 0; padding: 0; margin: 0 0 1.75rem; min-width: 0; }
fieldset.question:last-of-type { margin-bottom: .5rem; }
.legende { display: block; font-weight: 650; font-size: 1.05rem; margin-bottom: .4rem; }
input.email {
  width: 100%;
  font: inherit;
  padding: .75rem 1rem;
  border: 1.5px solid var(--ligne);
  border-radius: 10px;
}
input.email:focus { outline: 3px solid #9fd0ca; outline-offset: 1px; border-color: var(--accent); }
.invalide input.email { border-color: #e3aaa5; }
legend { font-weight: 650; font-size: 1.05rem; padding: 0; margin-bottom: .4rem; }
.aide { color: var(--doux); font-size: .9rem; margin: 0 0 .6rem; }
.aide + .exemples { margin-top: -.4rem; padding-left: 1.3rem; }

.options { display: flex; flex-direction: column; gap: .5rem; }
.en-ligne .options { flex-direction: row; flex-wrap: wrap; }
.grille .options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grille .groupe, .grille input.detail { grid-column: 1 / -1; }
.groupe {
  margin: .75rem 0 0;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--doux);
}
.options > .groupe:first-child { margin-top: 0; }
.groupe.vide { height: 1.2rem; }
.grille .option[data-valeur="aucun"] { grid-column: 1; } /* « Aucun » sous « Autre » */

.option {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 52px;
  padding: .7rem 1rem;
  background: #fff;
  border: 1.5px solid var(--ligne);
  border-radius: 10px;
  cursor: pointer;
}
.option:hover { border-color: var(--accent); }
.option.coche { border-color: var(--accent); background: var(--accent-clair); }
.option input { width: 1.3rem; height: 1.3rem; margin: 0; flex: none; accent-color: var(--accent); }
.option:focus-within { outline: 3px solid #9fd0ca; outline-offset: 1px; }
.en-ligne .option { min-width: 5.5rem; justify-content: center; }
.en-ligne .option[data-valeur="0"] { flex-basis: 100%; justify-content: flex-start; } /* 0 € sur toute la largeur */

input.detail {
  font: inherit;
  padding: .65rem .9rem;
  margin: 0 0 .25rem 2.6rem;
  border: 1.5px solid var(--ligne);
  border-radius: 10px;
}
input.detail:focus { outline: 3px solid #9fd0ca; outline-offset: 1px; border-color: var(--accent); }

.erreur { color: var(--erreur); font-weight: 600; margin: .4rem 0 0; }
.erreur:empty { display: none; }
.invalide .option { border-color: #e3aaa5; }
.erreur-envoi { color: var(--erreur); font-weight: 600; margin: 0; }

.nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.nav.fin { justify-content: flex-end; }
button {
  font: inherit;
  font-weight: 600;
  min-height: 52px;
  padding: .8rem 1.6rem;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
button:focus-visible { outline: 3px solid #9fd0ca; outline-offset: 2px; }
.principal { background: var(--accent); color: #fff; }
.principal:hover { background: var(--accent-fonce); }
.secondaire { background: transparent; color: var(--encre); border: 1.5px solid var(--ligne); }
.secondaire:hover { border-color: var(--doux); }

.colonnes { display: grid; gap: 1.25rem; align-items: start; }
.colonnes.double { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .colonnes.double { grid-template-columns: 1fr; } }

.entete {
  margin: -1.5rem -1.5rem 1.25rem;
  padding: .55rem 1.5rem;
  border-radius: 14px 14px 0 0;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.entete.perso { background: var(--perso); color: var(--perso-texte); }
.entete.pro { background: var(--pro); color: var(--pro-texte); }
.termine { color: var(--doux); margin: 0; }

.merci h1 { margin-top: 0; }
a { color: var(--accent-fonce); }

.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.noscript { max-width: 680px; margin: 2rem auto; padding: 0 1rem; }

/* Espace admin */
.admin { max-width: 860px; }
.admin h2 { margin-top: 2rem; }
.admin h3 { font-size: 1rem; margin: 1.25rem 0 .4rem; }
.admin h3 small { color: var(--doux); font-weight: 400; }
.admin table { width: 100%; border-collapse: collapse; background: #fff; margin-bottom: 1rem; }
.admin th, .admin td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--ligne); font-size: .9rem; }
.admin .n { text-align: right; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { #barre { transition: none; } }
