/* Page d'accueil du client : bandeau, rail d'avancement, étapes, cartes de voies, messages, paramètres. */

@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("atkinson-400.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("atkinson-700.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap; src: url("atkinson-400-italique.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 500; font-display: swap; src: url("lexend-500.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 600; font-display: swap; src: url("lexend-600.woff2") format("woff2"); }

:root {
  --fond: #f3f6f4;
  --surface: #ffffff;
  --encre: #0c232c;
  --encre-2: #4a626b;
  --trait: #d3dedb;
  --trait-fort: #6f8584;
  --vert: #80bc00;
  --sur-vert: #0c232c;
  --vert-texte: #3d6800;
  --vert-doux: #edf6da;
  --info-fond: #e8eff1;
  --alerte: #9e3218;
  --alerte-fond: #fbece7;
  --focus: #0b6fa4;
  --plaque: transparent;
  --f-titre: "Lexend", "Segoe UI", system-ui, sans-serif;
  --f-texte: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0a1a20; --surface: #10262e; --encre: #e4edef; --encre-2: #9fb3b9; --trait: #23414b; --trait-fort: #668892;
    --vert: #80bc00; --sur-vert: #0c232c; --vert-texte: #a8db4c; --vert-doux: #18311d; --info-fond: #132f38;
    --alerte: #ffa48d; --alerte-fond: #3b1e17; --focus: #6cc6ff; --plaque: #f3f6f4;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0a1a20; --surface: #10262e; --encre: #e4edef; --encre-2: #9fb3b9; --trait: #23414b; --trait-fort: #668892;
  --vert: #80bc00; --sur-vert: #0c232c; --vert-texte: #a8db4c; --vert-doux: #18311d; --info-fond: #132f38;
  --alerte: #ffa48d; --alerte-fond: #3b1e17; --focus: #6cc6ff; --plaque: #f3f6f4;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--fond); color: var(--encre); font: 400 1.0625rem/1.6 var(--f-texte); }
main { flex: 1 0 auto; }
.gouttiere { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--f-titre); font-weight: 500; line-height: 1.25; text-wrap: balance; margin: 0; }
h1 { font-size: 2rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.mono { font-family: var(--f-mono); font-size: 0.875rem; overflow-wrap: anywhere; word-break: break-all; }
svg { flex: none; }

/* Lien d'évitement, visible seulement au focus */
.evitement { position: absolute; left: 16px; top: -100px; z-index: 50; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 8px; background: var(--encre); color: var(--surface); font-weight: 700; text-decoration: none; }
.evitement:focus { top: 8px; }

/* ---------- Bandeau ---------- */
.tete { background: var(--surface); border-bottom: 1px solid var(--trait); }
.tete-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; padding-block: 12px; flex-wrap: wrap; }
.plaque { display: inline-flex; background: var(--plaque); border-radius: 8px; padding: 6px 10px; }
.plaque img { display: block; height: 34px; width: auto; }
.tete-droite { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.tete-service { font-family: var(--f-titre); font-size: 0.95rem; color: var(--encre-2); }
.langues { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.langues button { min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--encre-2); font-size: 0.875rem; }
.langues button:hover { border-color: var(--trait); color: var(--encre); }
.langues button[aria-pressed="true"] { border-color: var(--trait-fort); color: var(--encre); font-weight: 700; }

/* ---------- Cadre ---------- */
.cadre { width: 100%; max-width: 1080px; margin: 0 auto; padding-block: 40px 56px; }
.cadre:focus { outline: none; }
.intro { display: grid; gap: 12px; max-width: 46rem; margin-bottom: 36px; }
.intro .espace { font-family: var(--f-titre); font-size: 0.95rem; color: var(--encre-2); overflow-wrap: anywhere; }
.chapo { font-size: 1.15rem; }
.seule { max-width: 40rem; display: grid; gap: 20px; }

/* ---------- Rail d'avancement ---------- */
.parcours { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; align-items: start; }
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; position: sticky; top: 24px; }
.rail-pas { width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 10px; min-height: 56px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--encre); }
.rail-pas:hover:not(:disabled) { background: var(--surface); border-color: var(--trait); }
.rail-pas[aria-current="step"] { background: var(--surface); border-color: var(--trait-fort); }
.rail-pas:disabled { cursor: default; color: var(--encre-2); }
.rail-num { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--trait-fort); font-family: var(--f-titre); font-weight: 600; font-size: 0.95rem; background: var(--surface); }
.rail-num svg { display: none; }
.rail-pas[aria-current="step"] .rail-num { background: var(--encre); color: var(--surface); border-color: var(--encre); }
.rail-pas.fait .rail-num { background: var(--vert); border-color: var(--vert); color: var(--sur-vert); }
.rail-pas.fait .rail-num span { display: none; }
.rail-pas.fait .rail-num svg { display: block; }
.rail-txt { display: grid; gap: 2px; min-width: 0; }
.rail-titre { font-family: var(--f-titre); font-weight: 500; line-height: 1.3; }
.rail-etat { font-size: 0.875rem; color: var(--encre-2); }
.rail-pas.fait .rail-etat { color: var(--vert-texte); font-weight: 700; }

/* ---------- Étapes ---------- */
.etapes { min-width: 0; }
.etape { display: grid; gap: 20px; min-width: 0; }
.bloc { display: grid; gap: 20px; min-width: 0; }
.etape-num { font-family: var(--f-titre); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--encre-2); }
.prose { max-width: 42rem; }
.accord-outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.accord-version { font-size: 0.875rem; color: var(--encre-2); }
.accord { max-height: 24rem; overflow-y: auto; background: var(--surface); border: 1px solid var(--trait-fort); border-radius: 10px; padding: 22px 24px; font-size: 0.98rem; line-height: 1.65; display: grid; gap: 14px; }
.accord p { white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Formulaires ---------- */
form { display: grid; gap: 18px; min-width: 0; }
.champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; max-width: 46rem; }
.case-bloc { display: grid; gap: 4px; max-width: 46rem; }
.case-bloc .aide-champ { padding-left: 36px; }
.champ { display: grid; gap: 6px; min-width: 0; }
.champ label { font-weight: 700; }
.aide-champ { font-size: 0.925rem; color: var(--encre-2); }
input[type="text"], input[type="email"], input[type="password"], textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--trait-fort); border-radius: 8px; background: var(--surface); color: var(--encre); font: inherit; }
textarea { font-family: var(--f-mono); font-size: 0.85rem; line-height: 1.5; resize: vertical; min-height: 110px; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--alerte); }
.mdp-ligne { display: flex; gap: 8px; }
.mdp-ligne input { flex: 1; min-width: 0; }
.etat-champ { font-size: 0.925rem; color: var(--encre-2); min-height: 1.5em; }
.etat-champ.ok { color: var(--vert-texte); font-weight: 700; }
.err { color: var(--alerte); background: var(--alerte-fond); border-radius: 8px; padding: 10px 12px; font-size: 0.95rem; overflow-wrap: anywhere; }
.avis { background: var(--info-fond); border-radius: 8px; padding: 10px 12px; font-size: 0.95rem; }
.ok-ligne { color: var(--vert-texte); font-weight: 700; font-size: 0.95rem; overflow-wrap: anywhere; }
.case { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; cursor: pointer; padding-top: 2px; }
.case input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--vert); }
.info-code { font-size: 0.95rem; color: var(--encre-2); max-width: 40rem; }

/* ---------- Boutons ---------- */
.btn { min-height: 48px; padding: 0 24px; border-radius: 10px; border: 0; background: var(--vert); color: var(--sur-vert); font-family: var(--f-titre); font-weight: 600; font-size: 1rem; justify-self: start; display: inline-flex; align-items: center; gap: 10px; text-align: left; }
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:disabled { background: var(--trait); color: var(--encre-2); cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn-second { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1.5px solid var(--trait-fort); background: var(--surface); color: var(--encre); font-weight: 700; }
.btn-second:hover { border-color: var(--encre); }
.lien { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--encre); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.lien:hover { color: var(--focus); }
.lien:disabled { color: var(--encre-2); cursor: progress; }
.suite { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Terminer ---------- */
.terminer { display: grid; gap: 16px; border-top: 1px solid var(--trait); padding-top: 20px; }
.avertissement { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; max-width: 44rem; }
.avertissement svg { color: var(--encre-2); margin-top: 2px; }
.confirmer { display: grid; gap: 12px; background: var(--surface); border: 1.5px solid var(--trait-fort); border-radius: 12px; padding: 16px 18px; max-width: 44rem; }
.principal { font-weight: 700; }

/* ---------- Messages ---------- */
.msg { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; background: var(--info-fond); border-radius: 12px; padding: 18px 20px; }
.msg svg { color: var(--encre); margin-top: 1px; }
.msg.fait { background: var(--vert-doux); }
.msg.fait svg { color: var(--vert-texte); }
.msg.alerte { background: var(--alerte-fond); }
.msg.alerte svg { color: var(--alerte); }
.msg-corps { display: grid; gap: 8px; min-width: 0; }
.msg-corps p { overflow-wrap: anywhere; }
.msg-corps .recours { font-size: 0.95rem; color: var(--encre-2); }
.zone-fin:focus { outline: none; }
.zone-fin:focus-visible > .msg { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Voies ---------- */
.voies { display: grid; gap: 16px; }
.voie { background: var(--surface); border: 1.5px solid var(--trait); border-radius: 14px; padding: 22px 24px; display: grid; gap: 16px; min-width: 0; }
.voie.choisie { border-color: var(--trait-fort); }
.voie-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; }
.voie-tete > div { display: grid; gap: 4px; min-width: 0; flex: 1 1 18rem; }
.voie-tete p { color: var(--encre-2); }
.pastille { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 0.875rem; font-weight: 700; border: 1.5px solid var(--trait-fort); color: var(--encre); }
.pastille.fait { border-color: var(--vert); background: var(--vert-doux); color: var(--vert-texte); }
.pastille.alerte { border-color: var(--alerte); background: var(--alerte-fond); color: var(--alerte); }
.choix { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--trait-fort); border-radius: 10px; cursor: pointer; font-weight: 700; }
.choix input { width: 22px; height: 22px; accent-color: var(--vert); margin: 0; flex: none; }
.voie-corps { display: grid; gap: 18px; border-top: 1px solid var(--trait); padding-top: 18px; min-width: 0; }

/* ---------- Clé ---------- */
.options { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.option { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; border: 1.5px solid var(--trait-fort); border-radius: 10px; cursor: pointer; font-weight: 700; }
.option:has(input:checked) { border-color: var(--encre); background: var(--info-fond); }
.option input { width: 22px; height: 22px; margin: 0; accent-color: var(--vert); flex: none; }
.sous-panneau { display: grid; gap: 16px; min-width: 0; }
.creee { display: grid; gap: 14px; background: var(--fond); border: 1px solid var(--trait); border-radius: 10px; padding: 16px 18px; min-width: 0; }
.fichier { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.nom-fichier { font-weight: 700; overflow-wrap: anywhere; }
.creee dl { margin: 0; display: grid; gap: 14px; }
.creee dl div { display: grid; gap: 2px; min-width: 0; }
.creee dt { font-size: 0.9rem; color: var(--encre-2); }
.creee dd { margin: 0; }

/* ---------- Paramètres ---------- */
.params { margin: 0; background: var(--surface); border: 1px solid var(--trait); border-radius: 14px; padding: 6px 24px; }
.param { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; padding-block: 16px; border-bottom: 1px solid var(--trait); }
.param:last-child { border-bottom: 0; }
.param dt { color: var(--encre-2); font-size: 0.95rem; }
.param dd { margin: 0; min-width: 0; }
.param .val { font-family: var(--f-mono); font-size: 0.95rem; overflow-wrap: anywhere; word-break: break-all; }
.param .val.empreintes { display: grid; gap: 4px; font-size: 0.82rem; }
.copier { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 8px; border: 1.5px solid var(--trait); background: var(--surface); color: var(--encre); font-size: 0.9rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.copier:hover { border-color: var(--trait-fort); }
.fiche-bloc { display: grid; gap: 8px; }
.acces-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.acces-liste li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: center; padding: 12px 16px; background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; }

/* ---------- Pied ---------- */
.pied { border-top: 1px solid var(--trait); color: var(--encre-2); font-size: 0.925rem; }
.pied-in { max-width: 1080px; margin: 0 auto; padding-block: 22px 32px; display: flex; flex-wrap: wrap; gap: 6px 18px; }

@media (max-width: 860px) {
  .parcours { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .rail ol { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .rail-pas { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px; }
  .rail-titre { font-size: 0.875rem; }
  .rail-etat { font-size: 0.78rem; }
  .champs { grid-template-columns: minmax(0, 1fr); }
  .param { grid-template-columns: minmax(0, 1fr) auto; }
  .param dt { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .cadre { padding-block: 28px 40px; }
  .options { grid-template-columns: minmax(0, 1fr); }
  .voie, .accord { padding: 18px 16px; }
  .params { padding: 4px 16px; }
  .plaque img { height: 28px; }
  .btn { padding: 0 18px; }
}
@media (prefers-reduced-motion: no-preference) {
  .etape, .seule { animation: entree 180ms ease-out; }
  @keyframes entree { from { opacity: 0.4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
