:root {
  --fond: #f6f7f9; --carte: #ffffff; --texte: #1b1f24; --doux: #5b6573; --ligne: #dde2e8;
  --accent: #1f5fbf; --accent-fonce: #174a96; --accent-pale: #e8f0fc;
  --ok: #1d7a46; --ok-pale: #e7f5ed; --mal: #b3261e; --mal-pale: #fdecea; --alerte: #8a5a00; --alerte-pale: #fff4dc;
  --rayon: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #111418; --carte: #1a1f26; --texte: #e8ebef; --doux: #a3adba; --ligne: #2c343e;
    --accent: #6aa3ff; --accent-fonce: #8db8ff; --accent-pale: #1c2a40;
    --ok: #5fd08f; --ok-pale: #15291f; --mal: #ff8a80; --mal-pale: #331a19; --alerte: #f3c46b; --alerte-pale: #2e2614;
  }
}
* { box-sizing: border-box; }
html { font-size: 112.5%; }
body { margin: 0; background: var(--fond); color: var(--texte); line-height: 1.6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Noto Sans", sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-fonce); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 2rem; line-height: 1.2; margin: 1.5rem 0 .75rem; }
h2 { font-size: 1.4rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 0 0 .25rem; }
code { background: var(--accent-pale); padding: .1em .35em; border-radius: 6px; font-size: .95em; word-break: break-all; }
.largeur { max-width: 1040px; margin: 0 auto; padding: 0 1rem; }
.sauter { position: absolute; left: -9999px; }
.sauter:focus { left: 1rem; top: 1rem; background: var(--carte); padding: .5rem 1rem; z-index: 10; }

.entete { background: var(--carte); border-bottom: 1px solid var(--ligne); position: sticky; top: 0; z-index: 5; }
.entete-int { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; }
.marque { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.3rem; color: var(--texte); text-decoration: none; }
.entete nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; align-items: center; }
.entete nav a { text-decoration: none; color: var(--texte); padding: .25rem 0; }
.entete nav a[aria-current] { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px var(--accent); }
.entete nav a.bouton { color: #fff; box-shadow: none; }

.bouton { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: .75rem 1.3rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; margin: .25rem .5rem .25rem 0; }
.bouton:hover { background: var(--accent-fonce); color: #fff; }
.bouton.secondaire { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.bouton.secondaire:hover { background: var(--accent-pale); }
.bouton.petit { padding: .4rem .9rem; font-size: .9rem; }
.bouton:disabled { opacity: .6; cursor: wait; }

.heros { padding: 1.5rem 0 .5rem; }
.heros h1 { font-size: 2.4rem; }
.chapeau { font-size: 1.15rem; color: var(--doux); max-width: 46rem; }
.sous { color: var(--doux); font-weight: 400; }
.fil { color: var(--doux); font-size: .9rem; margin-top: 1rem; }
.petit-texte { font-size: .85rem; color: var(--doux); }

.avertissement { background: var(--alerte-pale); color: var(--texte); border-left: 5px solid var(--alerte); padding: .8rem 1rem; border-radius: 8px; }
.encart { background: var(--accent-pale); border-radius: var(--rayon); padding: .5rem 1.25rem 1rem; margin: 2rem 0; }
.encart h2, .encart h3 { margin-top: 1rem; }

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.carte { display: block; background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1.1rem 1.2rem;
  color: var(--texte); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.carte:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); color: var(--texte); }
.carte h3 { margin-top: .5rem; }
.carte .sous { margin: 0 0 .5rem; }
.carte p:last-child { margin-bottom: 0; color: var(--doux); font-size: .95rem; }
.icone { color: var(--accent); }
@media (prefers-color-scheme: dark) { .icone { filter: invert(1) hue-rotate(180deg) brightness(1.2); } }

.etapes-simples li { margin-bottom: .5rem; }
.tete-service { display: flex; gap: 1.2rem; align-items: flex-start; }
.tete-service h1 { margin-top: 0; }
.icone.grande { margin-top: .4rem; flex: none; }
.prerequis { list-style: none; padding: 0; display: grid; gap: .5rem; }
.prerequis li { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: .6rem 1rem; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.plus, .moins { border-radius: var(--rayon); padding: .2rem 1.2rem .6rem; }
.plus { background: var(--ok-pale); } .plus h2 { color: var(--ok); }
.moins { background: var(--mal-pale); } .moins h2 { color: var(--mal); }
.plus h2, .moins h2 { margin-top: 1rem; font-size: 1.2rem; }

.etapes { counter-reset: e; list-style: none; padding: 0; }
.etapes li { counter-increment: e; position: relative; padding: .9rem 1rem .9rem 3.6rem; background: var(--carte);
  border: 1px solid var(--ligne); border-radius: var(--rayon); margin-bottom: .75rem; }
.etapes li::before { content: counter(e); position: absolute; left: 1rem; top: .9rem; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; }
.etapes p { margin: .2rem 0 0; }

.applis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.appli { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .8rem 1rem; }
.appli p { margin: .1rem 0; }
.plateforme { color: var(--doux); font-size: .9rem; }
details summary { cursor: pointer; color: var(--accent); margin-top: .4rem; }
details img { display: block; margin-top: .6rem; background: #fff; border-radius: 8px; max-width: 100%; height: auto; }
.appel { text-align: center; background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .5rem 1rem 1.2rem; margin: 2.5rem 0; }

.tableau { width: 100%; border-collapse: collapse; background: var(--carte); border-radius: var(--rayon); overflow: hidden; }
.tableau th, .tableau td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.tableau th { background: var(--accent-pale); }

.onglets { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.onglets a { padding: .4rem .9rem; border-radius: 999px; text-decoration: none; background: var(--carte); border: 1px solid var(--ligne); }
.onglets a[aria-current] { background: var(--accent); color: #fff; border-color: var(--accent); }

.formulaire { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem 1.25rem; max-width: 44rem; }
.champ { margin: 0 0 1.2rem; border: 0; padding: 0; }
.champ > label, legend { display: block; font-weight: 600; margin-bottom: .3rem; }
input, select, textarea { width: 100%; font: inherit; color: var(--texte); background: var(--fond); border: 2px solid var(--ligne);
  border-radius: 10px; padding: .6rem .75rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
[aria-invalid="true"] { border-color: var(--mal); }
.requis, .facultatif { font-weight: 400; font-size: .8rem; margin-left: .3rem; color: var(--doux); }
.requis { color: var(--mal); }
.aide { margin: .25rem 0 0; font-size: .9rem; color: var(--doux); }
.erreur { margin: .25rem 0 0; color: var(--mal); font-weight: 600; min-height: 0; }
.erreur:empty { display: none; }
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4rem; }
.case { display: flex; gap: .5rem; align-items: baseline; padding: .5rem .6rem; border: 1px solid var(--ligne); border-radius: 10px; cursor: pointer; }
.case input { width: auto; transform: scale(1.3); }
.case:has(input:checked) { border-color: var(--accent); background: var(--accent-pale); }
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.etat { color: var(--doux); }
.succes { background: var(--ok-pale); border-radius: var(--rayon); padding: .5rem 1.25rem 1rem; max-width: 44rem; }
.succes h2 { color: var(--ok); }

.carte-acces { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .2rem 1.2rem 1rem; margin-bottom: 1rem; }
.carte-acces dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; }
.carte-acces dt { font-weight: 600; }
.carte-acces dd { margin: 0; }

.pied { margin-top: 3rem; border-top: 1px solid var(--ligne); background: var(--carte); color: var(--doux); font-size: .9rem; padding: 1rem 0; }

@media (max-width: 700px) {
  html { font-size: 106%; }
  .deux { grid-template-columns: 1fr; }
  .tete-service { flex-direction: column; gap: .2rem; }
  .heros h1 { font-size: 2rem; }
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau thead { display: none; }
  .tableau tr { border-bottom: 2px solid var(--ligne); }
  .tableau td { border: 0; padding: .3rem .8rem; }
}
