/* Questionnaire aux structures de Côte-d'Or : feuille de style.
   Même identité que le questionnaire aux aidants : couleurs du Département de la Côte-d'Or,
   l'or du logo pour les repères (bandeau, lettres des parties, numéros, progression),
   le bleu pour les actions, les réponses choisies et les fiches action, le rouge réservé aux erreurs.
   Texte de 18 px, contrastes AA au moins, grandes zones cliquables, focus toujours visible.
   Couleurs en hexadécimal : les anciens téléphones ne lisent pas l'OKLCH. */
:root {
  --or: #EEAD0F;          /* or du logo : repères seulement, jamais pour du texte */
  --or-fonce: #7A5A00;    /* texte doré sur fond clair (5,8:1 sur --or-pale) */
  --or-pale: #FCF4DC;
  --bleu: #0073A8;        /* bleu du site du Département : actions (5,2:1 sous un texte blanc) */
  --bleu-fonce: #005A84;
  --bleu-pale: #E5F1F8;
  --rouge: #AC3037;       /* erreurs (6,5:1) */
  --rouge-pale: #FBEEEF;
  --encre: #1B1A17;
  --encre-douce: #57534B; /* 7,6:1 */
  --texte-indice: #6E695E;
  --bord-champ: #857F72;  /* contour des champs (3,8:1) */
  --bord-option: #CFC8B9;
  --trait: #E6E0D4;
  --fond: #FBF9F4;
  --surface: #FFFEFC;
  --fond-doux: #F3EFE5;
  --rayon: 12px;
  --colonne: 44rem;
  --sortie: cubic-bezier(0.22, 1, 0.36, 1);
  --ombre: 0 18px 40px -30px rgba(122, 90, 0, 0.55), 0 1px 2px rgba(27, 26, 23, 0.04);
}
* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
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.55;
}
img { max-width: 100%; height: auto; }
a { color: var(--bleu); text-underline-offset: 3px; }
a:hover { color: var(--bleu-fonce); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--bleu-fonce); outline-offset: 3px; }
/* 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(--encre); color: var(--surface); padding: 8px 14px; z-index: 10; }
.evitement:focus { left: 8px; top: 8px; }

/* En-tête et pied */
.bandeau-test { background: var(--or-pale); border-bottom: 1px solid var(--or); padding: 10px 20px; text-align: center; font-weight: 600; }
.entete { background: var(--surface); border-top: 6px solid var(--or); border-bottom: 1px solid var(--trait); }
.entete-int { max-width: var(--colonne); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; }
.logo-cd21 { display: block; height: 58px; width: auto; }
.entete-titre {
  margin: 0; padding-left: 18px; border-left: 2px solid var(--trait); color: var(--encre-douce);
  font-size: 0.86rem; font-weight: 600; line-height: 1.35;
}
.entete-titre strong { display: block; color: var(--encre); font-size: 0.98rem; }
main { outline: none; }
.app { max-width: var(--colonne); margin: 0 auto; padding: 32px 20px 64px; }
.app > * { animation: apparition 0.35s var(--sortie) both; }
@keyframes apparition { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pied { background: var(--fond-doux); border-top: 1px solid var(--trait); color: var(--encre-douce); font-size: 0.88rem; }
.pied-int { max-width: var(--colonne); margin: 0 auto; padding: 20px 20px 36px; }
.pied p { margin: 0.3em 0; }
.pied a { color: var(--encre-douce); }
.pied a:hover { color: var(--encre); }
.chargement { color: var(--encre-douce); }

/* Titres et textes */
h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 750; letter-spacing: -0.01em; margin: 0 0 0.5em; outline: none; text-wrap: balance; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 1.8em 0 0.5em; text-wrap: balance; }
p { margin: 0 0 0.9em; }
ul { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: 0.4em; }
.petit { font-size: 0.88rem; color: var(--encre-douce); }
.message { border-radius: var(--rayon); padding: 16px 20px; margin: 1.4em 0; }
.message p:last-child { margin-bottom: 0; }
.message.info { background: var(--bleu-pale); }
.message.alerte { background: var(--or-pale); }
.message.erreur { background: var(--rouge-pale); border: 1px solid var(--rouge); }

/* Accueil : bloc d'ouverture */
.hero {
  position: relative; margin: 0 0 22px; padding: 30px 28px 24px; border: 1px solid var(--trait); border-radius: 20px;
  background: var(--surface) url("/img/motif.svg") no-repeat right 22px top 24px / 150px auto; box-shadow: var(--ombre);
}
.hero .surtitre, .hero h1, .hero .sous-titre { max-width: calc(100% - 150px); }
.surtitre {
  display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 999px; background: var(--or-pale);
  color: var(--or-fonce); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.hero h1 { font-size: 2rem; margin-bottom: 0.3em; }
.sous-titre { font-size: 1.05rem; font-weight: 600; color: var(--encre-douce); margin: 0 0 1.1em; }
.accroche { font-size: 1.12rem; line-height: 1.5; }
.faits { list-style: none; padding: 0; margin: 1.2em 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.faits li {
  display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 8px 16px 8px 12px;
  background: var(--or-pale); border-radius: 999px; font-weight: 600; font-size: 0.92rem;
}
.faits svg { flex: none; color: var(--or-fonce); }
.encadre { background: var(--bleu-pale); border-radius: 16px; padding: 18px 22px; margin: 0 0 0.5em; border-left: 6px solid var(--bleu); }
.encadre h2 { margin-top: 0; font-size: 1.05rem; color: var(--bleu-fonce); }
.encadre p:last-child { margin-bottom: 0; }

/* Accueil : les quatre parties */
.parcours h2, .section-accueil h2 { margin-top: 1.9em; }
.parcours h2::before, .section-accueil h2::before {
  content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--or); margin-bottom: 10px;
}
.parcours-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.parcours-liste li {
  display: flex; align-items: flex-start; gap: 14px; margin: 0; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: 16px;
}
.parcours-liste .lettre {
  flex: none; display: flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem;
  border-radius: 50%; background: var(--or); color: var(--encre); font-size: 1.05rem; font-weight: 800;
}
.parcours-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.parcours-texte strong { font-size: 1rem; line-height: 1.35; }
.parcours-texte > span { color: var(--encre-douce); font-size: 0.92rem; line-height: 1.4; }
@media (min-width: 620px) { .parcours-liste { grid-template-columns: 1fr 1fr; } }

.puces { list-style: none; padding-left: 0; }
.puces li { position: relative; padding-left: 1.5em; }
.puces li::before {
  content: ""; position: absolute; left: 0.25em; top: 0.6em; width: 0.5em; height: 0.5em;
  border-radius: 50%; background: var(--or);
}
.consentement {
  background: var(--surface); border: 2px solid var(--bleu); border-radius: 16px; padding: 18px 20px; margin: 2.2em 0 0;
  box-shadow: 0 14px 30px -26px rgba(0, 90, 132, 0.7);
}
.consentement .option, .consentement .option.coche { border: 0; padding: 0; background: transparent; box-shadow: none; font-weight: 600; }
.consentement + .navigation, .consentement ~ .navigation { border-top: 0; padding-top: 0; margin-top: 20px; }

/* Progression : les quatre parties puis une case par page */
.progression { margin: 0 0 26px; padding: 16px 18px 14px; background: var(--surface); border: 1px solid var(--trait); border-radius: 16px; }
.parties { list-style: none; margin: 0 0 12px; padding: 0; display: flex; gap: 10px; }
.parties li {
  flex: 1 1 0; display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0;
  color: var(--encre-douce); font-size: 0.84rem; font-weight: 600; line-height: 1.2;
}
.parties .lettre {
  flex: none; display: flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  border: 2px solid var(--bord-option); background: var(--surface); color: var(--encre-douce); font-weight: 800; font-size: 0.85rem;
}
.parties .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parties .fait .lettre { border-color: var(--or); background: var(--or-pale); color: var(--or-fonce); }
.parties .en-cours { color: var(--encre); }
.parties .en-cours .lettre { border-color: var(--or); background: var(--or); color: var(--encre); }
.parties .sautee { opacity: 0.5; }
.progression-texte { font-size: 0.84rem; font-weight: 700; letter-spacing: 0.02em; color: var(--or-fonce); margin: 0 0 8px; }
.segments { display: flex; gap: 5px; }
.segments span { flex: 1 1 0; height: 8px; border-radius: 4px; background: var(--trait); transition: background-color 0.3s var(--sortie); }
.segments .fait, .segments .en-cours { background: var(--or); }

/* Fiche action */
.fiche-entete {
  display: flex; flex-direction: column; gap: 3px; margin: -0.1em 0 1.4em; padding: 14px 18px;
  background: var(--bleu-pale); border-left: 6px solid var(--bleu); border-radius: 12px;
}
.fiche-rang { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--bleu-fonce); }
.fiche-intitule { margin: 0; font-size: 1.12rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.fiche-intitule.vide { font-size: 0.98rem; font-weight: 400; font-style: italic; color: var(--encre-douce); }

/* Questions */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.question { margin: 0; padding: 0; }
.bloc-question { margin: 0 0 44px; scroll-margin-top: 20px; }
.libelle { display: block; width: 100%; font-weight: 700; font-size: 1.1rem; line-height: 1.4; margin-bottom: 0.6em; }
.libelle-grille { display: grid; grid-template-columns: auto 1fr; column-gap: 0.7rem; align-items: start; }
.num {
  display: inline-block; min-width: 2.3rem; padding: 0.05rem 0.5rem; border-radius: 8px; background: var(--or);
  color: var(--encre); font-size: 0.9rem; font-weight: 800; line-height: 1.6; text-align: center; white-space: nowrap;
  font-variant-numeric: tabular-nums; margin-top: 0.05rem;
}
.facultatif { font-weight: 400; color: var(--encre-douce); }
.aide { color: var(--encre-douce); font-size: 0.95rem; margin: -0.2em 0 0.9em; }
.intro-etape { color: var(--encre-douce); margin: -0.2em 0 1.8em; }
.options { display: grid; gap: 10px; }
.groupe { font-weight: 700; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--or-fonce); margin: 14px 0 0; }
.groupe:first-child { margin-top: 0; }
.option {
  display: flex; align-items: flex-start; gap: 14px; padding: 13px 16px; cursor: pointer; line-height: 1.4;
  border: 1.5px solid var(--bord-option); border-radius: var(--rayon); background: var(--surface);
  transition: border-color 0.15s var(--sortie), background-color 0.15s var(--sortie), opacity 0.15s var(--sortie);
}
.option:hover { border-color: var(--bleu); }
.option.coche { border-color: var(--bleu); background: var(--bleu-pale); box-shadow: inset 0 0 0 1px var(--bleu); }
.option input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--bleu); cursor: pointer; }
.option.desactive { opacity: 0.5; cursor: not-allowed; }
.option.desactive:hover { border-color: var(--bord-option); }
.option.desactive input { cursor: not-allowed; }
.options.ligne { display: flex; flex-wrap: wrap; gap: 10px; }
.options.ligne .option { flex: 0 1 auto; }
.compteur-choix {
  display: inline-block; margin: -0.3em 0 0.9em; padding: 3px 12px; border-radius: 999px; background: var(--fond-doux);
  color: var(--encre-douce); font-size: 0.85rem; font-weight: 600;
}
.compteur-choix.plein { background: var(--or-pale); color: var(--or-fonce); }
.champ {
  display: block; width: 100%; min-height: 54px; font: inherit; color: inherit; padding: 12px 14px;
  border: 2px solid var(--bord-champ); border-radius: var(--rayon); background: var(--surface);
}
.champ:hover { border-color: var(--encre-douce); }
.champ:focus { border-color: var(--bleu); }
.champ::placeholder { color: var(--texte-indice); opacity: 1; }
select.champ {
  -webkit-appearance: none; appearance: none; padding-right: 46px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2357534B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 22px;
}
textarea.champ { min-height: 8em; resize: vertical; }
.precision { margin: -2px 0 4px 2.25rem; width: calc(100% - 2.25rem); }
.etiquette { display: block; font-weight: 600; margin: 0 0 6px; }
.compteur { font-size: 0.82rem; color: var(--encre-douce); text-align: right; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.champs-contact { display: grid; gap: 14px; padding: 16px 18px; background: var(--fond-doux); border-radius: var(--rayon); }
@media (min-width: 620px) {
  .champs-contact { grid-template-columns: 1fr 1fr; }
  .champs-contact .sous-champ:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Commune : liste déroulante. La liste s'insère sous le champ (elle ne recouvre jamais le bouton Suivant) ;
   la ligne « hors de Côte-d'Or » reste visible en bas pendant le défilement. */
.combo { position: relative; }
.combo .champ { padding-right: 3.4rem; text-overflow: ellipsis; }
.combo-bouton {
  position: absolute; top: 2px; right: 2px; bottom: 2px; width: 3rem; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 0 10px 10px 0; background: transparent; color: var(--encre-douce); cursor: pointer; padding: 0;
}
.combo-bouton:hover { color: var(--bleu); }
.combo-bouton svg { transition: transform 0.2s var(--sortie); }
.combo-bouton[aria-expanded="true"] svg { transform: rotate(180deg); }
.propositions {
  list-style: none; margin: 6px 0 0; padding: 6px; border: 2px solid var(--bleu); border-radius: var(--rayon);
  background: var(--surface); max-height: 20rem; max-height: min(20rem, 55vh); overflow-y: auto;
  overscroll-behavior: contain; box-shadow: 0 10px 24px rgba(27, 26, 23, 0.08);
}
.propositions li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  margin: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.propositions .detail { flex: none; max-width: 55%; color: var(--encre-douce); font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }
.propositions li:hover { background: var(--bleu-pale); }
.propositions li[aria-selected="true"] { background: var(--bleu); color: var(--surface); }
.propositions li[aria-selected="true"] .detail { color: var(--surface); }
.propositions .vide { display: block; cursor: default; color: var(--encre-douce); }
.propositions .vide:hover { background: transparent; }
.propositions .option-autre {
  position: -webkit-sticky; position: sticky; bottom: -6px; margin: 6px -6px -6px; padding: 12px 18px;
  border-radius: 0 0 10px 10px; background: var(--fond-doux); box-shadow: 0 -1px 0 var(--trait);
  font-weight: 600; color: var(--bleu-fonce);
}
.propositions .option-autre:hover { background: var(--bleu-pale); }
.commune-choisie { margin: 8px 0 0; color: var(--bleu-fonce); font-weight: 600; }
.commune-choisie:not(:empty)::before {
  content: ""; display: inline-block; width: 20px; height: 20px; margin-right: 8px; vertical-align: -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23005A84'/%3E%3Cpath d='M7 12.5l3.2 3.2L17 9' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.zone-autre { display: grid; gap: 14px; margin-top: 14px; padding: 16px 18px; background: var(--fond-doux); border-radius: var(--rayon); }
@media (min-width: 600px) { .zone-autre { grid-template-columns: 1fr 1fr; } }

/* Navigation */
.navigation {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--trait);
}
.bouton {
  font: inherit; font-weight: 700; line-height: 1.2; padding: 15px 28px; min-height: 56px; border-radius: 14px;
  border: 2px solid var(--bleu); background: var(--bleu); color: var(--surface); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  transition: background-color 0.15s var(--sortie), border-color 0.15s var(--sortie), box-shadow 0.15s var(--sortie);
}
.bouton:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); color: var(--surface); box-shadow: 0 10px 20px -14px rgba(0, 90, 132, 0.9); }
.bouton:active { transform: translateY(1px); }
.bouton.secondaire { background: transparent; color: var(--bleu); }
.bouton.secondaire:hover { background: var(--bleu-pale); color: var(--bleu-fonce); box-shadow: none; }
.bouton[disabled] { opacity: 0.6; cursor: wait; }
#suivant::after, #commencer::after, #reprendre::after {
  content: ""; flex: none; width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6' fill='none' stroke='%23FFFEFC' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
#precedent::before {
  content: ""; flex: none; width: 20px; height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 12H6M11 6l-6 6 6 6' fill='none' stroke='%230073A8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.navigation .bouton:only-child { margin-left: auto; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 1.4em 0; }

/* Erreurs */
.erreur-texte { color: var(--rouge); font-weight: 600; margin: 8px 0 0; }
.erreur-texte::before {
  content: ""; display: inline-block; width: 20px; height: 20px; margin-right: 8px; vertical-align: -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23AC3037'/%3E%3Cpath d='M12 6.5v7' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='17.3' r='1.6' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
}
.en-erreur .option, .en-erreur .champ { border-color: var(--rouge); }
.resume-erreurs { border: 2px solid var(--rouge); background: var(--rouge-pale); border-radius: var(--rayon); padding: 14px 18px; margin-bottom: 24px; }
.resume-erreurs p { font-weight: 700; margin-bottom: 0.4em; }
.resume-erreurs ul { margin: 0; }
.resume-erreurs a { color: var(--rouge); }
.resume-erreurs:focus { outline: 3px solid var(--bleu-fonce); outline-offset: 3px; }
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Fin */
.fin-icone { display: flex; width: 64px; height: 64px; align-items: center; justify-content: center; border-radius: 50%; background: var(--or); color: var(--encre); margin: 4px 0 18px; }
.partage { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; background: var(--or-pale); border-radius: 16px; padding: 20px 22px; margin: 1.6em 0; }
.partage p { font-weight: 600; }
.partage img { width: 140px; height: 140px; background: var(--surface); padding: 8px; border-radius: 10px; }
.lien-partage { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.lien-partage .champ { flex: 1 1 220px; font-size: 0.9rem; }
.relais-aidants { background: var(--bleu-pale); border-left: 6px solid var(--bleu); border-radius: 12px; padding: 14px 18px; margin: 0 0 1.6em; }
.relais-aidants p { margin: 0; font-weight: 600; }
.remerciement { color: var(--encre-douce); font-style: italic; }

@media (max-width: 620px) {
  .hero { padding: 24px 20px 20px; background-image: none; }
  .hero .surtitre, .hero h1, .hero .sous-titre { max-width: none; }
  .hero h1 { font-size: 1.6rem; }
  .parties li:not(.en-cours) .nom { display: none; }
  .parties li { flex: 0 0 auto; }
  .parties li.en-cours { flex: 1 1 auto; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.5rem; }
  .app { padding-top: 22px; }
  .accroche { font-size: 1.06rem; }
  .partage { grid-template-columns: 1fr; }
  .partage img { justify-self: center; }
  .navigation .bouton { flex: 0 1 auto; padding-left: 20px; padding-right: 20px; }
  .navigation .bouton:not(.secondaire) { flex: 1 1 auto; }
  .logo-cd21 { height: 48px; }
  .entete-int { gap: 14px; }
  .entete-titre { padding-left: 14px; font-size: 0.8rem; }
  .entete-titre strong { font-size: 0.9rem; }
  .progression { padding: 14px 14px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print { .entete, .pied, .navigation, .bandeau-test { display: none; } }
