/* comparativ auto · formulaire de demande en 2 pas (/demande/ et fiches d'ateliers), CONTRAT §8.2.
   Couleurs : jetons.css seulement. Sans JavaScript, les 2 pas s'affichent l'un sous l'autre. */

.page-demande { background: var(--pierre); }
.demande { padding: 32px 0 80px; }
.demande__grille { display: grid; gap: 28px; }
.demande__grille > * { min-width: 0; }
.demande__tete h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); max-width: 16ch; }
.demande__sous { margin-top: 14px; font-size: 1.125rem; max-width: 34ch; }
.demande__gratuit { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-weight: 650; }
.demande__gratuit::before { content: ""; width: 14px; height: 3px; background: var(--orange); flex: none; }

@media (min-width: 960px) {
  .demande { padding: 56px 0 112px; }
  .demande__grille { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
  .demande__tete { position: sticky; top: 32px; }
}

/* Les étapes : liens d'ancrage sans JavaScript, fil d'avancement avec. */
.progression { display: flex; gap: 6px; margin-top: 24px; counter-reset: none; }
.progression li { flex: 1 1 0; min-width: 0; }
.progression a {
  display: flex; flex-direction: column; gap: 8px; padding-top: 10px;
  border-top: 4px solid var(--filet);
  color: var(--graphite-2); text-decoration: none; font-size: 0.875rem; font-weight: 600; line-height: 1.25;
}
.progression a[aria-current="step"] { border-top-color: var(--orange); color: var(--graphite); }
.progression a.est-fait { border-top-color: var(--graphite); color: var(--graphite); }
.progression__num { font-family: var(--police-titre); font-weight: 800; font-size: 1.125rem; }
@media (min-width: 960px) {
  .progression { flex-direction: column; gap: 0; margin-top: 40px; max-width: 320px; }
  .progression a { flex-direction: row; align-items: baseline; gap: 14px; padding: 14px 0 14px 18px; border-top: 0; border-left: 4px solid var(--filet); font-size: 1rem; }
  .progression a[aria-current="step"] { border-left-color: var(--orange); }
  .progression a.est-fait { border-left-color: var(--graphite); }
}

/* Le panneau du formulaire */
.formulaire { background: var(--blanc); border-radius: var(--rayon); box-shadow: 0 1px 0 var(--filet), 0 24px 48px -32px var(--ombre-feuille); }
/* La légende d'un fieldset se place dans la zone de bordure, au-dessus du padding :
   l'espace du haut du panneau est donc porté par la légende, pas par le fieldset. */
.pas { border: 0; padding: 0 20px 32px; min-width: 0; }
/* Filet entre les pas (sans JS, les 2 pas se suivent). Il est porté par la légende : un filet sur le
   fieldset passerait au milieu de la légende, qui chevauche le bord haut. */
html:not(.js) .pas + .pas > .pas__titre { border-top: 1px solid var(--filet); margin-top: 12px; }
.js .pas[hidden] { display: none; }
.pas__titre { display: block; width: 100%; padding: 28px 0 0; margin-bottom: 4px; }
.pas__titre h2 { font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem); }
.pas__titre:focus { outline: none; }
.pas__titre:focus-visible h2 { outline: 3px solid var(--graphite); outline-offset: 4px; }
.pas__etape { display: block; margin-bottom: 6px; font-size: 0.875rem; font-weight: 650; color: var(--graphite-2); }
@media (min-width: 700px) { .pas { padding: 0 44px 44px; } .pas__titre { padding-top: 40px; } }

.champ { margin-top: 26px; }
.champ__etiquette, .groupe__titre { display: block; font-weight: 700; font-size: 1.0625rem; line-height: 1.3; }
.groupe__titre { padding: 0; margin-bottom: 4px; }
.facultatif { font-weight: 500; color: var(--graphite-2); }
.aide { margin-top: 4px; font-size: 0.9375rem; color: var(--graphite-2); max-width: 52ch; }
.saisie {
  display: block; width: 100%; margin-top: 8px;
  min-height: 52px; padding: 12px 14px;
  border: 1.5px solid var(--filet-fort); border-radius: var(--rayon);
  background: var(--blanc); color: var(--graphite);
  font-size: 1.0625rem; line-height: 1.4;
  transition: border-color var(--duree) var(--courbe);
}
.saisie:hover { border-color: var(--graphite-2); }
.saisie:focus-visible { outline: 3px solid var(--graphite); outline-offset: 1px; border-color: var(--graphite); }
.saisie[aria-invalid="true"] { border-color: var(--orange-texte); border-width: 2px; }
textarea.saisie { min-height: 132px; resize: vertical; }
.compteur { margin-top: 6px; font-size: 0.875rem; color: var(--graphite-2); text-align: right; font-variant-numeric: tabular-nums; }
.npa { display: flex; align-items: center; gap: 8px 16px; margin-top: 8px; }
.npa .npa__saisie { flex: none; width: 7.5rem; margin-top: 0; }
.npa__commune { min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.npa__commune:empty { display: none; }

.erreur {
  display: flex; gap: 8px; align-items: flex-start;
  margin-top: 8px; font-size: 0.9375rem; font-weight: 600; color: var(--orange-texte);
}
.erreur::before {
  content: "!"; flex: none; display: grid; place-items: center;
  width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  background: var(--orange-texte); color: var(--blanc); font-size: 0.8125rem; font-weight: 800; line-height: 1;
}
.erreur[hidden] { display: none; }

/* Choix (radios et cases) : de grandes surfaces à toucher */
.groupe { border: 0; padding: 0; margin-top: 26px; min-width: 0; }
.options { display: grid; gap: 10px; margin-top: 10px; }
.options--3 { grid-template-columns: 1fr; }
@media (min-width: 560px) { .options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.option {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: start;
  padding: 14px 16px; min-height: 56px;
  border: 1.5px solid var(--filet-fort); border-radius: var(--rayon); background: var(--blanc);
  cursor: pointer; transition: border-color var(--duree) var(--courbe), background-color var(--duree) var(--courbe);
}
.option:hover { border-color: var(--graphite-2); }
.option:has(input:checked) { border-color: var(--graphite); box-shadow: inset 0 0 0 1px var(--graphite); background: var(--pierre); }
.option:has(input:focus-visible) { outline: 3px solid var(--graphite); outline-offset: 2px; }
.option:has(input:disabled) { cursor: not-allowed; opacity: 0.55; }
.option input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--orange-texte); flex: none; }
.option input:focus-visible { outline: none; }
.option__nom { font-weight: 700; line-height: 1.3; }
.option__detail { grid-column: 2; font-size: 0.9375rem; color: var(--graphite-2); line-height: 1.35; }
.groupe[aria-invalid="true"] .option { border-color: var(--orange-texte); }

/* Photos */
.fichier-natif { display: block; margin-top: 10px; width: 100%; max-width: 100%; min-width: 0; font-size: 1rem; }
.js .fichier-natif { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.galerie { display: none; }
.js .galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.galerie__case { position: relative; aspect-ratio: 1; border-radius: var(--rayon); overflow: hidden; background: var(--pierre); }
.galerie__case img { width: 100%; height: 100%; object-fit: cover; }
.galerie__retirer {
  position: absolute; top: 0; right: 0; width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center; border: 0; background: transparent; cursor: pointer;
}
.galerie__retirer span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--graphite); color: var(--blanc); }
.galerie__retirer svg { width: 14px; height: 14px; }
.galerie__retirer:focus-visible { outline: 3px solid var(--graphite); outline-offset: -3px; }
.galerie__ajout {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 100%; height: 100%; padding: 6px; text-align: center;
  border: 1.5px dashed var(--graphite-2); border-radius: var(--rayon); background: var(--blanc);
  font-weight: 650; font-size: 0.875rem; line-height: 1.2; cursor: pointer;
  transition: background-color var(--duree) var(--courbe);
}
.galerie__ajout:hover { background: var(--pierre); }
.galerie__ajout svg { width: 20px; height: 20px; flex: none; }
.fichier-natif:focus-visible + .galerie .galerie__ajout,
.fichier-natif:focus-visible ~ .galerie .galerie__ajout { outline: 3px solid var(--graphite); outline-offset: 2px; }
.galerie__case--ajout { background: transparent; overflow: visible; }
.etat { margin-top: 8px; font-size: 0.9375rem; color: var(--graphite-2); min-height: 1.4em; }

.lien-bouton { border: 0; padding: 10px 0; background: none; font-weight: 650; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.lien-bouton:hover { color: var(--orange-texte); }

/* Liste des ateliers (pas 2) */
.ateliers { margin-top: 2px; }
.lien-discret {
  border: 0; padding: 10px 0; min-height: 44px; background: none; cursor: pointer;
  font-size: 0.9375rem; font-weight: 600; color: var(--graphite-2);
  text-decoration: underline; text-decoration-color: var(--filet-fort); text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.lien-discret:hover { color: var(--graphite); text-decoration-color: var(--orange); }
.lien-discret:focus-visible { outline: 3px solid var(--graphite); outline-offset: 2px; }
/* La liste ouverte : un panneau pierre. La légende flotte pour rester DANS le fond (sinon elle chevauche le bord). */
.choix { margin-top: 6px; padding: 0 16px 6px; background: var(--pierre); border-radius: var(--rayon); }
.choix > legend { float: left; width: 100%; padding-top: 16px; }
.choix > legend:focus { outline: none; }
.choix > legend + * { clear: both; }
.choix .ateliers__etat { padding-top: 4px; }
.ateliers__etat { margin-top: 14px; font-size: 0.9375rem; color: var(--graphite-2); }
.ateliers__etat:empty { display: none; }
.liste-choix { margin-top: 12px; display: grid; gap: 8px; }
.liste-choix .option { min-height: 0; padding: 12px 14px; }
.compte-choix { margin-top: 10px; font-weight: 650; font-variant-numeric: tabular-nums; }
.compte-choix:empty { display: none; }
.envoi-fiche { margin-top: 26px; padding: 16px 18px; background: var(--pierre); border-radius: var(--rayon); }
.envoi-fiche strong { font-weight: 700; }
.envoi-fiche p + p { margin-top: 8px; }

/* Actions de pas */
.actions-pas { display: flex; flex-wrap: wrap-reverse; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 34px; }
.actions-pas .bouton { min-width: 12rem; }
.actions-pas [data-retour] { min-height: 52px; }
@media (max-width: 559px) { .actions-pas .bouton { width: 100%; } }

/* « Qui paie ? » : 3 choix facultatifs, carrés et à plat comme les boutons (§6 : pas de pilule).
   Le rond du bouton radio est masqué à l'oeil, pas au clavier. */
.pastilles { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 10px; }
.pastille { position: relative; display: inline-flex; cursor: pointer; }
.pastille input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pastille span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 9px 18px;
  border: 1.5px solid var(--filet-fort); border-radius: var(--rayon); background: var(--blanc);
  font-weight: 650; line-height: 1.2; transition: border-color var(--duree) var(--courbe), background-color var(--duree) var(--courbe);
}
.pastille:hover span { border-color: var(--graphite-2); }
.pastille input:checked + span { background: var(--graphite); border-color: var(--graphite); color: var(--blanc); }
.pastille input:focus-visible + span { outline: 3px solid var(--graphite); outline-offset: 2px; }
.groupe[aria-invalid="true"] .pastille span { border-color: var(--orange-texte); }
.accord { margin-top: 14px; font-size: 0.9375rem; color: var(--graphite-2); max-width: 60ch; }
.accord a { color: var(--graphite); font-weight: 600; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.anti-robot { margin-top: 22px; min-height: 0; }
.piege { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.alerte {
  margin-top: 22px; padding: 14px 16px; border-radius: var(--rayon);
  box-shadow: inset 0 0 0 2px var(--orange-texte); background: var(--blanc);
  font-weight: 600; color: var(--graphite);
}
.alerte[hidden] { display: none; }

/* Fiche d'atelier */
.fiche__metier { font-weight: 650; color: var(--graphite-2); }
.fiche h1 { margin-top: 8px; font-size: clamp(2rem, 1.3rem + 2.4vw, 3rem); max-width: 20ch; overflow-wrap: anywhere; hyphens: auto; }
.fiche__adresse { margin-top: 16px; font-size: 1.125rem; line-height: 1.5; }
.fiche__envoi { margin-top: 22px; font-weight: 600; max-width: 34ch; }
.fiche__note { margin-top: 14px; max-width: 46ch; color: var(--graphite-2); font-size: 0.9375rem; }
