/* =====================================================================
   ShieldOne — PAGE LÉGÈRE /demande (LOT VITESSE1-A1, 27.09.2026)
   Le formulaire de demande SANS l'app Flutter : HTML + CSS + un script, rien d'autre.
   Référence visuelle : /home/sacha/photos-lp4/maquette-formulaire.png (elle prime).
   Ordinateur (≥ 960 px) : panneau photo à gauche, quatre étapes au centre, résumé à droite.
   Téléphone : UN écran par question, sans défilement ; en haut retour, titre court et fine
   barre ; « Continuer » fixe en bas ; les trois repères en petit sur le premier écran seul.
   Invariants (CLAUDE.md règle 8) : AA partout, cibles ≥ 44 px, rouge réservé aux erreurs.
   ===================================================================== */

@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('fonts/inter-700.woff2') format('woff2'); }

:root {
  --d-marine: #06234D;
  --d-marine-2: #0E2F5E;
  --d-texte: #0F1B33;
  --d-texte-2: #4A5874;
  --d-bordure: #D5DDEA;
  --d-bordure-forte: #9AA8BF;
  --d-fond: #FFFFFF;
  --d-fond-2: #F4F7FB;
  --d-accent: #1F4FD1;
  --d-accent-fond: #EAF0FD;
  --d-erreur: #B42318;
  --d-rayon: 10px;
  --d-police: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--d-police); color: var(--d-texte); background: var(--d-fond); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--d-accent); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.d-entete { height: 56px; background: var(--d-marine); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.d-logo { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; min-height: 44px; }
.d-logo img { width: 30px; height: 30px; }
.d-aide { color: #fff; text-decoration: none; font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
.d-aide:hover { text-decoration: underline; }

/* ---------- Mise en page ordinateur ---------- */
.d-cadre { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; min-height: calc(100vh - 56px); }
.d-panneau { position: relative; color: #fff; background: var(--d-marine) url('assets/hero-fond.webp') center / cover no-repeat; padding: 220px 28px 40px; }
.d-panneau::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,35,77,.35) 0%, rgba(6,35,77,.82) 35%, rgba(6,35,77,.92) 100%); }
.d-panneau > * { position: relative; }
.d-promesse { font-size: 30px; line-height: 1.2; font-weight: 700; margin: 0 0 16px; }
.d-promesse-texte { font-size: 15px; margin: 0 0 56px; color: #E6ECF5; }
.d-reperes { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.d-reperes li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; }
.d-reperes svg { width: 40px; height: 40px; }
.d-reperes strong { display: block; font-size: 15px; }
.d-reperes span { font-size: 14px; color: #E6ECF5; }
.d-slogan { margin: 56px 0 0; font-size: 16px; color: #E6ECF5; }

.d-centre { padding: 32px 40px 120px; max-width: 640px; width: 100%; justify-self: center; }
.d-resume-col { padding: 32px 24px 32px 0; }

/* ---------- Étapes ---------- */
.d-etapes { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 32px; padding: 0; counter-reset: etape; }
.d-etapes li { position: relative; text-align: left; font-size: 14px; color: var(--d-texte-2); padding-top: 40px; }
.d-etapes li::before { counter-increment: etape; content: counter(etape); position: absolute; top: 0; left: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--d-fond-2); color: var(--d-texte-2); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.d-etapes li::after { content: ''; position: absolute; top: 14px; left: 36px; right: 8px; height: 2px; background: var(--d-bordure); }
.d-etapes li:last-child::after { display: none; }
.d-etapes li[aria-current="step"] { color: var(--d-texte); font-weight: 600; }
.d-etapes li[aria-current="step"]::before, .d-etapes li.faite::before { background: var(--d-marine); color: #fff; }
.d-barre { display: none; }

/* ---------- Écrans ---------- */
.d-ecran { display: none; margin: 0 0 32px; border: 0; padding: 0; min-width: 0; }
.d-ecran.visible { display: block; }
.d-question { font-size: 18px; font-weight: 600; margin: 0 0 6px; padding: 0; }
.d-ecran[data-premier] .d-question { font-size: 24px; }
.d-aide-texte { margin: 0 0 16px; color: var(--d-texte-2); font-size: 15px; }
.d-reperes-mobile { display: none; }

.d-cartes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.d-carte { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 104px; padding: 16px 8px; border: 1px solid var(--d-bordure); border-radius: var(--d-rayon); background: #fff; cursor: pointer; text-align: center; font-size: 14px; }
.d-carte input { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; accent-color: var(--d-marine); margin: 0; }
.d-carte svg { width: 28px; height: 28px; color: var(--d-marine); }
.d-carte:has(input:checked) { border-color: var(--d-marine); background: var(--d-accent-fond); box-shadow: 0 0 0 1px var(--d-marine) inset; }
.d-carte:has(input:focus-visible) { outline: 3px solid var(--d-accent); outline-offset: 2px; }

.d-champ { display: grid; gap: 6px; margin: 0 0 16px; }
.d-champ > span, .d-etiquette { font-size: 14px; color: var(--d-texte-2); }
.d-saisie { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--d-bordure-forte); border-radius: 8px; background: #fff; font-size: 16px; }
.d-saisie:focus { border-color: var(--d-marine); outline: none; box-shadow: 0 0 0 3px var(--d-accent-fond); }
textarea.d-saisie { min-height: 112px; resize: vertical; }
.d-compteur { justify-self: end; font-size: 13px; color: var(--d-texte-2); }
.d-rangee { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.d-rangee-3 { display: grid; grid-template-columns: 110px 1fr 90px; gap: 12px; }
.d-position { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--d-bordure-forte); border-radius: 8px; background: #fff; cursor: pointer; font-size: 14px; }

.d-bascule { display: inline-grid; grid-auto-flow: column; background: var(--d-fond-2); border-radius: 999px; padding: 3px; margin: 0 0 16px; }
.d-bascule label { min-height: 44px; display: inline-flex; align-items: center; padding: 0 22px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.d-bascule input { position: absolute; opacity: 0; pointer-events: none; }
.d-bascule label:has(input:checked) { background: var(--d-marine); color: #fff; }
.d-bascule label:has(input:focus-visible) { outline: 3px solid var(--d-accent); }

.d-raccourcis { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.d-pastille { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--d-bordure-forte); background: #fff; cursor: pointer; font-size: 14px; }
.d-pastille:hover { border-color: var(--d-marine); }
.d-jours { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.d-jours label { min-width: 52px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--d-bordure-forte); border-radius: 8px; cursor: pointer; font-size: 14px; padding: 0 8px; }
.d-jours input { position: absolute; opacity: 0; pointer-events: none; }
.d-jours label:has(input:checked) { background: var(--d-marine); color: #fff; border-color: var(--d-marine); }
.d-jours label:has(input:focus-visible) { outline: 3px solid var(--d-accent); }
.d-phrase { margin: 0 0 16px; padding: 12px 14px; background: var(--d-accent-fond); border-radius: 8px; font-size: 15px; }
.d-phrase:empty { display: none; }

.d-cases { display: grid; gap: 4px; }
.d-case { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; cursor: pointer; font-size: 15px; }
.d-case input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--d-marine); flex: none; }

.d-oui-non { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 360px; }
.d-oui-non label { min-height: 52px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--d-bordure-forte); border-radius: var(--d-rayon); cursor: pointer; font-weight: 500; }
.d-oui-non input { position: absolute; opacity: 0; pointer-events: none; }
.d-oui-non label:has(input:checked) { border-color: var(--d-marine); background: var(--d-accent-fond); box-shadow: 0 0 0 1px var(--d-marine) inset; }
.d-oui-non label:has(input:focus-visible) { outline: 3px solid var(--d-accent); }

.d-compteur-agents { display: inline-grid; grid-template-columns: 44px 64px 44px; align-items: center; border: 1px solid var(--d-bordure-forte); border-radius: 8px; }
.d-compteur-agents button { height: 44px; border: 0; background: none; cursor: pointer; font-size: 20px; }
.d-compteur-agents input { border: 0; text-align: center; height: 44px; width: 64px; font-size: 16px; -moz-appearance: textfield; }
.d-compteur-agents input::-webkit-inner-spin-button { -webkit-appearance: none; }

.d-depot { display: grid; place-items: center; gap: 4px; padding: 24px; border: 1px dashed var(--d-bordure-forte); border-radius: var(--d-rayon); text-align: center; font-size: 14px; color: var(--d-texte-2); }
.d-depot small { font-size: 12px; }
.d-note { font-size: 13px; color: var(--d-texte-2); margin: 8px 0 0; }
.d-erreur { color: var(--d-erreur); font-size: 14px; margin: 8px 0 0; }
.d-erreur:empty { display: none; }
.d-lien { color: var(--d-accent); }

/* ---------- Navigation ---------- */
.d-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.d-retour { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--d-texte); cursor: pointer; font-size: 15px; }
.d-retour[hidden] { display: none; }
.d-continuer { min-height: 48px; padding: 0 28px; border: 0; border-radius: 8px; background: var(--d-marine); color: #fff; font-weight: 600; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.d-continuer:hover { background: var(--d-marine-2); }
.d-continuer[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ---------- Résumé ---------- */
.d-resume { background: var(--d-fond-2); border-radius: 12px; padding: 20px; }
.d-resume h2 { font-size: 17px; margin: 0 0 6px; }
.d-resume > p { margin: 0 0 16px; font-size: 14px; color: var(--d-texte-2); }
.d-resume dl { margin: 0; }
.d-resume dl > dt, .d-resume dl > div { margin-top: 14px; }
.d-resume dt { font-size: 14px; font-weight: 600; }
.d-resume dd { margin: 2px 0 0; font-size: 14px; color: var(--d-texte-2); overflow-wrap: anywhere; }
.d-anonyme { margin-top: 20px; padding: 12px 14px; border-radius: 8px; background: var(--d-accent-fond); font-size: 13px; }

.d-brouillon { font-size: 13px; color: var(--d-texte-2); margin: 16px 0 0; }
.d-brouillon:empty { display: none; }

/* ---------- Écran intermédiaire (ordinateur étroit) ---------- */
@media (max-width: 1180px) {
  .d-cadre { grid-template-columns: 260px minmax(0, 1fr); }
  .d-resume-col { display: none; }
  .d-ecran-resume.visible { display: block; }
  .d-cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Téléphone : un écran par question ---------- */
@media (max-width: 959px) {
  html, body { height: 100%; }
  body { display: flex; flex-direction: column; min-height: 100dvh; }
  .d-entete, .d-panneau, .d-etapes { display: none; }
  .d-cadre { display: block; min-height: 0; flex: 1; }
  .d-centre { padding: 0 20px calc(96px + env(safe-area-inset-bottom)); max-width: none; }
  .d-haut { position: sticky; top: 0; background: #fff; z-index: 2; padding: 8px 0 0; }
  .d-haut-ligne { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-height: 48px; }
  .d-haut-titre { text-align: center; font-size: 15px; font-weight: 600; margin: 0; }
  .d-barre { display: block; height: 3px; background: var(--d-fond-2); border-radius: 2px; overflow: hidden; margin: 4px 0 20px; }
  .d-barre span { display: block; height: 100%; background: var(--d-marine); width: 0; transition: width 200ms ease; }
  .d-ecran[data-premier] .d-question, .d-question { font-size: 22px; line-height: 1.25; }
  .d-reperes-mobile { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--d-texte-2); }
  .d-cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .d-carte { min-height: 76px; padding: 10px 6px; font-size: 13px; gap: 6px; }
  .d-carte svg { width: 24px; height: 24px; }
  .d-rangee-3 { grid-template-columns: 1fr 1fr; }
  .d-rangee-3 > :last-child { grid-column: 1 / -1; }
  .d-nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--d-bordure); z-index: 3; }
  .d-nav .d-retour { display: none; }
  .d-continuer { width: 100%; justify-content: center; }
}
@media (min-width: 960px) {
  .d-haut { display: none; }
}
@media (prefers-reduced-motion: reduce) { .d-barre span { transition: none; } }

/* ---------- Suggestions de lieu, fichiers ---------- */
[data-lieu-recherche] { position: relative; display: grid; gap: 8px; }
.d-suggestions { list-style: none; margin: -8px 0 0; padding: 4px 0; border: 1px solid var(--d-bordure-forte); border-radius: 8px; background: #fff; max-height: 280px; overflow-y: auto; }
.d-suggestions li { min-height: 44px; display: flex; align-items: center; padding: 0 12px; cursor: pointer; font-size: 15px; }
.d-suggestions li[aria-selected="true"], .d-suggestions li:hover { background: var(--d-accent-fond); }
.d-fichiers { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.d-fichiers li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0 4px 12px; background: var(--d-fond-2); border-radius: 8px; }
.d-fichiers button { min-width: 44px; min-height: 44px; border: 0; background: none; cursor: pointer; }
.d-resume-ligne { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; }
.d-ecran-resume .d-resume { margin-bottom: 16px; }
/* Le retour masqué du premier écran garde sa place (sinon le titre glisse à gauche). */
.d-haut .d-retour[hidden] { display: inline-flex; visibility: hidden; }
/* La question reçoit le focus au changement d'écran (lecteurs d'écran) : pas de cadre. */
.d-question:focus { outline: none; }
.d-brouillon .d-retour { min-height: 44px; padding: 0 4px; text-decoration: underline; color: var(--d-accent); }
.d-date { position: relative; display: block; }
.d-date .d-saisie { padding-right: 52px; }
.d-calendrier { position: absolute; right: 0; top: 0; width: 48px; height: 100%; min-height: 44px; border: 0; background: none; color: var(--d-marine); cursor: pointer; display: grid; place-items: center; }
/* Téléphone : le sélecteur natif, transparent, couvre le champ et l'icône — le toucher l'ouvre. */
.d-heure { position: relative; display: block; }
.d-natif-couvrant { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; z-index: 2; font-size: 16px; -webkit-appearance: none; appearance: none; cursor: pointer; }
.d-saisie[aria-invalid="true"] { border-color: var(--d-erreur); }

/* A2 — envoi : panneau de fin, issues des documents */
.d-envoyee { max-width: 560px; padding: 8px 0 32px; }
.d-envoyee p { font-size: 15px; line-height: 1.5; }
.d-issues { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; font-size: 14px; }
.d-issues li.non-joint { color: var(--d-erreur); }
.d-lien-bouton { display: inline-flex; text-decoration: none; margin-top: 16px; position: static; }
.d-continuer[aria-busy="true"] { opacity: .7; cursor: progress; }
.d-envoyee:focus { outline: none; }
