/* ComptesAD - lot E (E4). Feuille commune des notices de docs/ : aucun style en ligne, car l'outil sert ces pages
   sous /docs/ avec la CSP du §9.5 (style-src 'self'). Clair, sombre (préférence du système) et impression. */

:root {
  --fond: #f4f5f7;
  --page: #ffffff;
  --texte: #1c1f24;
  --texte-doux: #4a5160;
  --accent: #1f4fbf;
  --accent-texte: #ffffff;
  --bordure: #cfd4dc;
  --code-fond: #eef0f4;
  --info-fond: #e8effb;
  --info-bord: #1f4fbf;
  --alerte-fond: #fff3df;
  --alerte-bord: #a85a00;
  --danger-fond: #fcebea;
  --danger-bord: #b3261e;
  --ok-fond: #e7f4ea;
  --ok-bord: #23753a;
  --entete-tableau: #eceff4;
  --ombre: 0 1px 3px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #121418;
    --page: #1b1e24;
    --texte: #e6e8ec;
    --texte-doux: #a9b0bd;
    --accent: #8db0ff;
    --accent-texte: #0f1730;
    --bordure: #3a404b;
    --code-fond: #262a32;
    --info-fond: #1a2640;
    --info-bord: #8db0ff;
    --alerte-fond: #3a2a10;
    --alerte-bord: #f0b35a;
    --danger-fond: #3d1b1a;
    --danger-bord: #f08f87;
    --ok-fond: #17311f;
    --ok-bord: #74c98b;
    --entete-tableau: #262a32;
    --ombre: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans", "DejaVu Sans", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

.page {
  max-width: 60rem;
  margin: 1.5rem auto;
  padding: 2rem 2.5rem 3rem;
  background: var(--page);
  border-radius: 10px;
  box-shadow: var(--ombre);
}

header.titre { border-bottom: 2px solid var(--bordure); margin-bottom: 1.5rem; padding-bottom: 1rem; }
header.titre h1 { margin: 0 0 0.3rem; font-size: 1.9rem; line-height: 1.2; }
header.titre p { margin: 0.2rem 0; color: var(--texte-doux); }

h2 {
  margin: 2.6rem 0 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--bordure);
  font-size: 1.45rem;
  line-height: 1.25;
}
h3 { margin: 1.8rem 0 0.5rem; font-size: 1.15rem; }
h4 { margin: 1.3rem 0 0.4rem; font-size: 1rem; }

p, ul, ol, dl, table, figure, pre, .encadre { margin-top: 0.6rem; margin-bottom: 0.9rem; }
li { margin: 0.25rem 0; }
li > ul, li > ol { margin: 0.25rem 0; }

a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

code, kbd, pre, .identifiant {
  font-family: Consolas, "Cascadia Mono", "DejaVu Sans Mono", "Courier New", monospace;
  font-size: 0.92em;
}
code, kbd {
  background: var(--code-fond);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}
kbd { border: 1px solid var(--bordure); border-bottom-width: 2px; }
pre {
  background: var(--code-fond);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
pre code { background: none; padding: 0; font-size: 1em; }

.menu { font-weight: 600; }

/* Sommaire */
nav.sommaire {
  background: var(--code-fond);
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
}
nav.sommaire h2 { margin: 0 0 0.4rem; padding: 0; border: 0; font-size: 1.1rem; }
nav.sommaire ol { margin: 0; padding-left: 1.4rem; columns: 2; column-gap: 2rem; }
nav.sommaire li { break-inside: avoid; margin: 0 0 0.25rem; }

/* Encadrés */
.encadre {
  border-left: 5px solid var(--info-bord);
  background: var(--info-fond);
  border-radius: 6px;
  padding: 0.7rem 1rem;
}
.encadre > :first-child { margin-top: 0; }
.encadre > :last-child { margin-bottom: 0; }
.encadre.alerte { border-left-color: var(--alerte-bord); background: var(--alerte-fond); }
.encadre.danger { border-left-color: var(--danger-bord); background: var(--danger-fond); }
.encadre.ok { border-left-color: var(--ok-bord); background: var(--ok-fond); }
.encadre .titre-encadre { font-weight: 700; display: block; margin-bottom: 0.2rem; }

/* Étapes numérotées */
ol.etapes { padding-left: 0; list-style: none; counter-reset: etape; }
ol.etapes > li {
  counter-increment: etape;
  position: relative;
  padding-left: 2.6rem;
  margin: 0.7rem 0;
}
ol.etapes > li::before {
  content: counter(etape);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-texte);
  font-weight: 700;
  text-align: center;
  line-height: 1.8rem;
}

/* Tableaux */
.tableau-defilant { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { border: 1px solid var(--bordure); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
thead th { background: var(--entete-tableau); }
caption { text-align: left; font-weight: 600; padding-bottom: 0.3rem; }

/* Captures */
figure { margin-left: 0; margin-right: 0; }
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--bordure);
  border-radius: 6px;
}
figure img.etroite { width: 36rem; max-width: 100%; }
figcaption { color: var(--texte-doux); font-size: 0.9rem; margin-top: 0.35rem; }

/* Formulaires à remplir (fiche RGPD, procès-verbal) */
.a-remplir {
  display: inline-block;
  min-width: 12rem;
  border-bottom: 1px dotted var(--texte-doux);
  color: var(--texte-doux);
}
td.a-remplir-cellule { min-width: 14rem; height: 2.4rem; }
.case { font-family: inherit; }

.pied { margin-top: 3rem; color: var(--texte-doux); font-size: 0.9rem; border-top: 1px solid var(--bordure); padding-top: 0.8rem; }

/* Téléphone et petites fenêtres */
@media (max-width: 720px) {
  .page { margin: 0; padding: 1rem 16px 2rem; border-radius: 0; box-shadow: none; }
  header.titre h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  nav.sommaire ol { columns: 1; }
  th, td { padding: 0.3rem 0.4rem; }
}

/* Impression : noir sur blanc, pas de coupure dans une capture ou un encadré */
@media print {
  :root {
    --fond: #ffffff;
    --page: #ffffff;
    --texte: #000000;
    --texte-doux: #333333;
    --accent: #000000;
    --accent-texte: #ffffff;
    --bordure: #999999;
    --code-fond: #f2f2f2;
    --info-fond: #ffffff;
    --alerte-fond: #ffffff;
    --danger-fond: #ffffff;
    --ok-fond: #ffffff;
    --entete-tableau: #eeeeee;
  }
  body { font-size: 10.5pt; }
  .page { max-width: none; margin: 0; padding: 0; box-shadow: none; }
  a { color: #000000; text-decoration: none; }
  figure, .encadre, table, pre, ol.etapes > li { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
  figure img { max-height: 16cm; width: auto; }
  nav.sommaire ol { columns: 2; }
  .ecran-seulement { display: none; }
}
