/* ==============================================================
   Zcorps — feuille de style unique
   Principe : le thème visuel emprunte à la signalétique d'accessibilité.
   - Le jaune de vigilance n'est jamais une couleur de texte : il sert
     de fond sous du texte encre (contraste 11:1) et d'anneau de focus.
   - La bande podotactile (points sur jaune) est le seul décor du site.
   - L'indicateur de focus clavier est la signature visuelle.
   Contrastes vérifiés (WCAG 2.1) : voir commentaires sur chaque jeton.
   ============================================================== */


:root {
  --encre: #1c2230;     /* texte : 14,4:1 sur papier */
  --encre-2: #474f5f;   /* texte secondaire et bordures de champs : 7,5:1 */
  --papier: #f3f4ef;    /* fond de page */
  --surface: #ffffff;   /* fond des encadrés et des champs */
  --vert: #0a5e50;      /* liens : 7,0:1 sur papier, 7,7:1 sur surface */
  --jaune: #ffd23f;     /* vigilance : fond sous texte encre (11:1), focus */
  --filet: #8c9387;     /* séparateurs décoratifs uniquement */
  --points: #1c2230;    /* points de la bande podotactile */

  --police: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mesure: 40rem;
  --large: 68rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --encre: #eef0ea; --encre-2: #b9c0b3; --papier: #161b24; --surface: #1f2530;
    --vert: #7fd6c2; --filet: #6b7380; --points: #161b24;
  }
}
:root[data-theme="dark"] {
  --encre: #eef0ea; --encre-2: #b9c0b3; --papier: #161b24; --surface: #1f2530;
  --vert: #7fd6c2; --filet: #6b7380; --points: #161b24;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--police);
  font-size: 1.125rem;
  line-height: 1.6;
}
img, svg { max-width: 100%; height: auto; }
p, ul, ol, dl, table { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 0.35em; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; overflow-wrap: break-word; hyphens: auto; }
h1 { font-size: clamp(2.2rem, 6.5vw, 3.9rem); letter-spacing: -0.02em; line-height: 1.05; max-width: 20ch; }
h2 { font-size: clamp(1.55rem, 3.6vw, 2.2rem); letter-spacing: -0.01em; margin-top: 2.2em; }
h3 { font-size: 1.3rem; margin-top: 1.6em; }
h2:first-child, h3:first-child { margin-top: 0; }

a { color: var(--vert); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.18em; }

/* Signature : le focus clavier ressemble à une bande de vigilance */
:focus-visible {
  outline: 3px solid var(--encre);
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--jaune);
  border-radius: 2px;
}

.visuellement-masque {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Structure ---------- */
.conteneur { max-width: var(--large); margin-inline: auto; padding-inline: 1.25rem; }
.texte { max-width: var(--mesure); }

.lien-evitement {
  position: absolute; left: 1rem; top: -5rem; z-index: 10;
  background: var(--jaune); color: #1c2230; font-weight: 700;
  padding: 0.75rem 1rem; text-decoration: none;
}
.lien-evitement:focus { top: 1rem; }

.entete { border-bottom: 1px solid var(--filet); }
.entete .conteneur {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 2rem; padding-block: 1rem;
}
.marque {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--encre); text-decoration: none;
}
.marque span { display: block; font-size: 0.85rem; font-weight: 400; letter-spacing: 0; color: var(--encre-2); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.nav li + li { margin-top: 0; }
.nav a { color: var(--encre); text-decoration: none; display: inline-block; padding-block: 0.4rem; }
.nav a:hover { text-decoration: underline; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 0.2em; text-decoration-color: var(--jaune); font-weight: 700; }

.ariane { padding-top: 1.25rem; font-size: 0.95rem; }
.ariane ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.ariane li + li { margin-top: 0; }
.ariane li + li::before { content: "/"; margin-inline: 0.5rem; color: var(--encre-2); }
.ariane [aria-current] { color: var(--encre-2); }

main { display: block; padding-block: 2.5rem 4rem; }
main:focus { outline: none; }

/* ---------- La bande podotactile (décor unique) ---------- */
.bande {
  position: relative;
  padding-bottom: 3.5rem;
}
.bande::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.75rem;
  background:
    radial-gradient(circle at center, var(--points) 0 0.23rem, transparent 0.25rem) 0 50% / 1.1rem 1.1rem repeat-x,
    var(--jaune);
}
@media (forced-colors: active) { .bande::after { background: CanvasText; } }

/* ---------- Accueil ---------- */
.ouverture { padding-top: 2rem; }
.ouverture .chapeau { font-size: clamp(1.2rem, 2.4vw, 1.45rem); max-width: 36em; color: var(--encre-2); }
.actions { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin-block: 2rem 0.5rem; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-block;
  background: var(--jaune); color: #1c2230;
  border: 2px solid #1c2230;
  font: inherit; font-weight: 700;
  padding: 0.8rem 1.3rem; min-height: 44px;
  text-decoration: none; cursor: pointer;
  border-radius: 0.2rem;
}
.bouton:hover { text-decoration: underline; }
.lien-fort { font-weight: 700; }

/* ---------- Sections ---------- */
.section { padding-top: 3.5rem; }
.deux-colonnes { display: grid; gap: 2rem 3rem; }
@media (min-width: 56rem) { .deux-colonnes { grid-template-columns: 1fr 1fr; } }

.encadre {
  align-self: start;
  background: var(--surface);
  border-left: 0.5rem solid var(--jaune);
  padding: 1.25rem 1.5rem;
  max-width: var(--mesure);
}
.encadre > :last-child { margin-bottom: 0; }

.atouts { list-style: none; padding: 0; display: grid; gap: 1.5rem 3rem; }
@media (min-width: 48rem) { .atouts { grid-template-columns: repeat(2, 1fr); } }
.atouts li + li { margin-top: 0; }
.atouts h3 { margin: 0 0 0.3em; font-size: 1.2rem; }
.atouts p { margin: 0; }

/* ---------- Offres ---------- */
.offres { list-style: none; padding: 0; margin: 1.5rem 0 2rem; }
.offres > li { margin: 0; border-top: 2px solid var(--encre); padding-block: 1.25rem; }
.offres > li:last-child { border-bottom: 1px solid var(--filet); }
.offre { display: grid; gap: 0.5rem 2rem; }
@media (min-width: 48rem) { .offre { grid-template-columns: minmax(0, 1fr) 14rem; } }
.offre h3 { margin: 0; font-size: 1.25rem; }
.offre .prix { font-weight: 700; font-size: 1.2rem; margin: 0; }
@media (min-width: 48rem) { .offre .prix { text-align: right; grid-column: 2; grid-row: 1; } }
.offre .prix-bloque { font-weight: 400; font-size: 1rem; color: var(--encre-2); }
.offre ul { margin: 0.5rem 0 0; }
.offre .details { margin: 0.4rem 0 0; color: var(--encre-2); }
.ref { font-weight: 400; color: var(--encre-2); font-size: 0.95rem; }

/* ---------- Tableaux ---------- */
.defilement { overflow-x: auto; margin-bottom: 2rem; }
table { border-collapse: collapse; width: 100%; min-width: 32rem; background: var(--surface); }
caption { text-align: left; font-weight: 700; font-size: 1.2rem; padding-bottom: 0.5rem; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--filet); }
thead th { border-bottom: 2px solid var(--encre); }
td.montant, th.montant { text-align: right; white-space: nowrap; }

/* ---------- Formulaires ---------- */
.formulaire { max-width: var(--mesure); background: var(--surface); padding: 1.5rem; border-top: 0.5rem solid var(--jaune); }
.champ { margin-bottom: 1.4rem; }
.champ label, .champ legend { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.aide { display: block; color: var(--encre-2); font-size: 0.95rem; margin-bottom: 0.4rem; }
.obligatoire-note { color: var(--encre-2); }
input[type="text"], input[type="email"], input[type="url"], input[type="tel"], select, textarea {
  display: block; width: 100%; max-width: 100%;
  font: inherit; color: var(--encre); background: var(--surface);
  border: 2px solid var(--encre-2); border-radius: 0.2rem;
  padding: 0.6rem 0.7rem; min-height: 44px;
}
textarea { min-height: 9rem; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
.choix { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.4rem; }
.choix input { width: 1.3rem; height: 1.3rem; margin-top: 0.2rem; flex: none; accent-color: var(--vert); }
.choix label { font-weight: 400; margin: 0; }
.pot-de-miel { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Pied de page ---------- */
.pied { border-top: 1px solid var(--filet); padding-block: 2rem 3rem; font-size: 1rem; }
.pied ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.pied li + li { margin-top: 0; }
.pied p { color: var(--encre-2); margin: 0; }

/* ---------- Divers ---------- */
.note { color: var(--encre-2); font-size: 0.98rem; }
.a-completer { background: var(--jaune); color: #1c2230; padding: 0 0.2em; }
dl.faits { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.5rem; }
dl.faits dt { font-weight: 700; }
dl.faits dd { margin: 0; }
@media (max-width: 30rem) { dl.faits { grid-template-columns: 1fr; } dl.faits dd { margin-bottom: 0.6rem; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .entete .nav, .lien-evitement, .bande::after { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; }
}

/* ---------- Charte : engagements numérotés (la numérotation est celle de la charte) ---------- */
.engagements { list-style: none; counter-reset: eng; padding: 0; margin: 2rem 0 3rem; }
.engagements > li {
  counter-increment: eng; margin: 0;
  display: grid; grid-template-columns: 3.5rem 1fr; gap: 0 1rem;
  padding-block: 1.5rem; border-top: 2px solid var(--encre);
}
.engagements > li:last-child { border-bottom: 1px solid var(--filet); }
.engagements > li::before { content: counter(eng); font-size: 3rem; line-height: 1; font-weight: 700; }
.engagements > li > * { grid-column: 2; }
.engagements h2 { font-size: 1.45rem; margin: 0.2rem 0 0.5rem; }
.engagements p { margin: 0; }
@media (max-width: 30rem) {
  .engagements > li { grid-template-columns: 1fr; }
  .engagements > li > * { grid-column: 1; }
}

.chapeau { font-size: clamp(1.15rem, 2.2vw, 1.35rem); color: var(--encre-2); max-width: 36em; }

/* ---------- Bandeau de consentement (dans le flux, ne masque rien) ---------- */
.consentement { background: var(--surface); border-bottom: 0.5rem solid var(--jaune); padding-block: 1.25rem; }
.consentement p { max-width: var(--mesure); margin-bottom: 1rem; }
.consentement-titre { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.4rem; }
.consentement-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.bouton-lien {
  background: none; border: 0; padding: 0; min-height: 24px;
  font: inherit; color: var(--vert); text-decoration: underline;
  text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; cursor: pointer; text-align: left;
}
.bouton-lien:hover { text-decoration-thickness: 0.18em; }
[hidden] { display: none !important; }
