/* Questionnaire aux aidants de Côte-d'Or : feuille de style unique.
   Texte de 18 px, contrastes AA au moins, grandes zones cliquables, focus toujours visible. */
:root {
  --violet: #7E4A8C;
  --violet-fonce: #5E3569;
  --violet-clair: #E3D3EA;
  --violet-pale: #F6F0F8;
  --texte: #1D1A20;
  --texte-doux: #4A4550;
  --bord: #B9AFC0;
  --erreur: #B3261E;
  --erreur-fond: #FCEEEE;
  --ok: #1E6B3A;
  --fond: #FFFFFF;
  --rayon: 10px;
}
* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.5;
}
img { max-width: 100%; height: auto; }
a { color: var(--violet-fonce); text-underline-offset: 2px; }
a:hover { color: var(--violet); }
:focus-visible { outline: 3px solid var(--texte); outline-offset: 2px; }
/* Titres qui reçoivent le focus par programme (lecteurs d'écran) : pas de cadre, ce ne sont pas des commandes. */
h1[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible, main[tabindex="-1"]:focus-visible { outline: none; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.evitement { position: absolute; left: -9999px; top: 0; background: var(--texte); color: #fff; padding: 8px 14px; z-index: 10; }
.evitement:focus { left: 8px; top: 8px; }

/* En-tête et pied */
.bandeau-test { background: #FFF4CC; border-bottom: 2px solid #C9A100; padding: 10px 16px; text-align: center; font-weight: 600; }
.entete { border-bottom: 1px solid #ECE6EF; }
.entete-int { max-width: 760px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo-mba { height: 40px; width: auto; margin-left: auto; }
.logo-cd21 { height: 52px; width: auto; }
main { outline: none; }
.app { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }
.pied { max-width: 760px; margin: 0 auto; padding: 18px 16px 40px; border-top: 1px solid #ECE6EF; color: var(--texte-doux); font-size: 0.85rem; }
.pied p { margin: 0.3em 0; }
.chargement { color: var(--texte-doux); }

/* Titres et textes */
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0.2em 0 0.4em; outline: none; }
h2 { font-size: 1.2rem; margin: 1.4em 0 0.4em; }
p { margin: 0 0 0.8em; }
ul { padding-left: 1.3em; margin: 0 0 0.9em; }
li { margin-bottom: 0.35em; }
.sous-titre { font-size: 1.05rem; color: var(--texte-doux); margin-top: -0.2em; }
.accroche { font-weight: 600; font-size: 1.1rem; }
.encadre { background: var(--violet-pale); border-left: 5px solid var(--violet); border-radius: 0 var(--rayon) var(--rayon) 0; padding: 14px 18px; margin: 1em 0; }
.encadre h2 { margin-top: 0; font-size: 1.05rem; }
.encadre p:last-child { margin-bottom: 0; }
.date-limite { font-weight: 700; text-align: center; padding: 10px; border-top: 2px solid var(--violet-clair); border-bottom: 2px solid var(--violet-clair); margin: 1.4em 0; }
.petit { font-size: 0.88rem; color: var(--texte-doux); }
.message { border-radius: var(--rayon); padding: 14px 18px; margin: 1em 0; }
.message.info { background: var(--violet-pale); border: 1px solid var(--violet-clair); }
.message.alerte { background: #FFF4CC; border: 1px solid #C9A100; }
.message.erreur { background: var(--erreur-fond); border: 1px solid var(--erreur); }

/* Formulaires */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.question { margin: 0 0 30px; padding: 0; }
.bloc-question { scroll-margin-top: 16px; }
.libelle { display: block; font-weight: 700; font-size: 1.05rem; margin-bottom: 0.5em; }
.libelle .num { color: var(--violet-fonce); margin-right: 0.2em; }
.facultatif { font-weight: 400; font-style: italic; color: var(--texte-doux); }
.aide { color: var(--texte-doux); font-size: 0.92rem; margin: -0.2em 0 0.8em; }
.options { display: grid; gap: 8px; }
.groupe { font-weight: 700; font-size: 0.85rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--violet-fonce); margin: 10px 0 0; }
.groupe:first-child { margin-top: 0; }
.option {
  display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; cursor: pointer;
  border: 2px solid var(--bord); border-radius: var(--rayon); background: #fff; line-height: 1.35;
}
.option:hover { border-color: var(--violet); }
.option.coche { border-color: var(--violet); background: var(--violet-pale); }
.option input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--violet); }
.options.ligne { display: flex; flex-wrap: wrap; gap: 8px; }
.options.ligne .option { flex: 0 1 auto; }
.champ {
  display: block; width: 100%; font: inherit; color: inherit; padding: 10px 12px;
  border: 2px solid var(--bord); border-radius: var(--rayon); background: #fff;
}
.champ:focus { border-color: var(--violet); }
.champ.annee { width: 6.5em; letter-spacing: 0.08em; }
textarea.champ { min-height: 7em; resize: vertical; }
.precision { margin: -2px 0 6px 36px; width: calc(100% - 36px); }
.etiquette { display: block; font-weight: 600; margin: 10px 0 4px; }
.case-hors { margin-top: 10px; }
.zone-hors { display: grid; gap: 4px; margin-top: 8px; }
.compteur { font-size: 0.82rem; color: var(--texte-doux); text-align: right; margin-top: 4px; }

/* Recherche de commune : la liste s'insère sous le champ (elle ne recouvre jamais le bouton Suivant). */
.propositions {
  list-style: none; margin: 4px 0 0; padding: 4px; border: 2px solid var(--violet); border-radius: var(--rayon);
  background: #fff; max-height: 320px; overflow-y: auto;
}
.propositions li { padding: 10px 12px; border-radius: 6px; cursor: pointer; }
.propositions li[aria-selected="true"], .propositions li:hover { background: var(--violet-clair); }
.propositions .vide { cursor: default; color: var(--texte-doux); }
.commune-choisie { margin-top: 6px; color: var(--ok); font-weight: 600; }

/* Grille */
.ligne-grille { border-top: 1px solid #ECE6EF; padding: 12px 0 4px; }
.ligne-grille legend { font-weight: 600; margin-bottom: 6px; }
.choix-grille { display: flex; flex-wrap: wrap; gap: 6px; }
.choix-grille .option { padding: 8px 10px; font-size: 0.92rem; }
.choix-grille .option input { width: 20px; height: 20px; }

/* Étapes et navigation */
.progression { margin: 0 0 18px; }
.progression-texte { font-size: 0.9rem; color: var(--texte-doux); margin-bottom: 6px; }
.barre { height: 10px; background: var(--violet-clair); border-radius: 5px; overflow: hidden; }
.barre-remplie { height: 100%; background: var(--violet); border-radius: 5px; width: 0; transition: width 0.3s; }
.intro-etape { font-style: italic; color: var(--texte-doux); }
.navigation { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.bouton {
  font: inherit; font-weight: 700; padding: 13px 26px; border-radius: 999px; border: 2px solid var(--violet);
  background: var(--violet); color: #fff; cursor: pointer; min-height: 52px; text-decoration: none; display: inline-block; text-align: center;
}
.bouton:hover { background: var(--violet-fonce); border-color: var(--violet-fonce); color: #fff; }
.bouton.secondaire { background: #fff; color: var(--violet-fonce); }
.bouton.secondaire:hover { background: var(--violet-pale); color: var(--violet-fonce); }
.bouton[disabled] { opacity: 0.6; cursor: wait; }
.navigation .bouton:only-child { margin-left: auto; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 1em 0; }

/* Erreurs */
.erreur-texte { color: var(--erreur); font-weight: 600; margin: 6px 0 0; }
.en-erreur .option, .en-erreur .champ { border-color: var(--erreur); }
.resume-erreurs { border: 2px solid var(--erreur); background: var(--erreur-fond); border-radius: var(--rayon); padding: 12px 16px; margin-bottom: 20px; }
.resume-erreurs:focus { outline: 3px solid var(--texte); }

/* Consentement */
.consentement { border: 2px solid var(--violet); border-radius: var(--rayon); padding: 14px 16px; margin: 1.2em 0; }
.consentement .option { border: 0; padding: 0; background: transparent; font-weight: 600; }
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Fin */
.partage { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; background: var(--violet-pale); border-radius: var(--rayon); padding: 16px 18px; margin: 1.2em 0; }
.partage img { width: 140px; height: 140px; background: #fff; padding: 6px; border-radius: 6px; }
.lien-partage { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.lien-partage .champ { flex: 1 1 220px; font-size: 0.9rem; }
@media (max-width: 560px) {
  h1 { font-size: 1.4rem; }
  .partage { grid-template-columns: 1fr; }
  .partage img { justify-self: center; }
  .navigation .bouton { flex: 1 1 auto; }
  .logo-mba { height: 34px; }
  .logo-cd21 { height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .barre-remplie { transition: none; } }
@media print { .entete, .pied, .navigation, .bandeau-test { display: none; } }
