/* ==========================================================================
   NeoRAG — feuille de style partagée des pages légales.

   Reprend à l'identique les tokens de design de index.html. Fichier séparé
   (et non inliné) uniquement parce qu'il est partagé par trois pages : le
   dupliquer trois fois rendrait toute retouche de palette faillible.
   Ressource same-origin : aucune dépendance externe, conformément au parti
   pris de la landing (pas de CDN, pas de police distante, pas de tracker).
   ========================================================================== */

:root {
  --bg: #fbfaf8;
  --bg-elev: #ffffff;
  --bg-sunk: #f3f1ec;
  --text: #101418;
  --text-soft: #333c44;
  --muted: #5a6470;
  --line: #e4e0d8;
  --line-strong: #cfc9bd;
  --accent: #0e7c66;
  --accent-text: #0b6252;
  --accent-soft: rgba(14, 124, 102, 0.07);
  --accent-line: rgba(14, 124, 102, 0.26);
  --amber: #a4560a;
  --shadow: 0 1px 2px rgba(16, 20, 24, 0.04), 0 8px 24px rgba(16, 20, 24, 0.05);
  --radius: 12px;
  --maxw: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #0b0f10;
  --bg-elev: #12181a;
  --bg-sunk: #0e1416;
  --text: #e8edea;
  --text-soft: #c6d0cb;
  --muted: #93a29c;
  --line: rgba(232, 237, 234, 0.12);
  --line-strong: rgba(232, 237, 234, 0.22);
  --accent: #3fd6af;
  --accent-text: #56e0bc;
  --accent-soft: rgba(63, 214, 175, 0.09);
  --accent-line: rgba(63, 214, 175, 0.28);
  --amber: #e0a24a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Bascule linguistique : les deux langues sont dans le DOM, l'attribut lang
   de <html> décide de ce qui s'affiche. Même mécanisme que la landing. */
html[lang="fr"] [data-i18n-only="en"],
html[lang="en"] [data-i18n-only="fr"] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- En-tête ---------- */

header {
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
  position: sticky;
  top: 0;
  z-index: 10;
}

.head-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.brand small {
  font-weight: 450;
  font-size: 12px;
  color: var(--muted);
}

.ctl {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lang {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}

.lang button,
.theme-btn {
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 5px 11px;
  line-height: 1.4;
}

.lang button.active {
  background: var(--accent);
  color: #fff;
}

html[data-theme="dark"] .lang button.active {
  color: #06110e;
}

.theme-btn {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
}

.back {
  font-size: 13px;
  color: var(--accent-text);
  text-decoration: none;
}

.back:hover {
  text-decoration: underline;
}

/* ---------- Corps du document ---------- */

main {
  padding: 48px 0 72px;
}

.doc-head {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.updated {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

h2 {
  font-size: 19px;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  padding-top: 4px;
}

h3 {
  font-size: 16px;
  margin: 26px 0 8px;
  color: var(--text-soft);
}

p,
li {
  color: var(--text-soft);
}

p {
  margin: 0 0 14px;
}

ul,
ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

li {
  margin-bottom: 7px;
}

a {
  color: var(--accent-text);
}

strong {
  color: var(--text);
  font-weight: 620;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

/* Encadré d'identité (éditeur, responsable de traitement, contact). */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 20px;
  box-shadow: var(--shadow);
}

.card p {
  margin: 0 0 4px;
}

.card p:last-child {
  margin-bottom: 0;
}

/* Encadré d'avertissement — sert notamment aux mentions à compléter. */
.note {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 20px;
  font-size: 14px;
}

.note p {
  margin: 0;
}

/* Tableau des sous-traitants. */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-weight: 620;
  color: var(--text);
  border-bottom-color: var(--line-strong);
  white-space: nowrap;
}

td {
  color: var(--text-soft);
}

/* Sommaire. */
.toc {
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 0 0 36px;
  font-size: 14px;
}

.toc p {
  margin: 0 0 8px;
  font-weight: 620;
  color: var(--text);
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 28px;
}

.toc li {
  margin-bottom: 4px;
  break-inside: avoid;
}

@media (max-width: 640px) {
  .toc ol {
    columns: 1;
  }
  h1 {
    font-size: 25px;
  }
  main {
    padding: 32px 0 56px;
  }
}

/* ---------- Pied de page ---------- */

footer {
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 22px 0;
  font-size: 13px;
  color: var(--muted);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  justify-content: space-between;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  background: var(--bg-elev);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  z-index: 20;
}
