/* Laoud — pages publiques (confidentialité, conditions, aide, suppression de compte).
   Design system v2 (design-system/laoud/MASTER.md) : une seule couleur de marque, le noir bleuté #090F1D, blanc le jour, gris-bleu profond la nuit,
   Lexend (titres) + Source Sans 3 (texte), polices servies localement : aucune requête vers un tiers, aucun traceur. */

@font-face { font-family: 'Lexend'; src: url('fonts/Lexend_500Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('fonts/Lexend_600SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('fonts/SourceSans3_400Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('fonts/SourceSans3_600SemiBold.ttf') format('truetype'); font-weight: 600 700; font-display: swap; }

:root {
  color-scheme: light dark;
  --brand: #090F1D;
  --brand-pressed: #1E2638;
  /* Règle de Mohamed (QUALITY §7, 22 oct. 2026) : en clair, jamais de gris ni de bleu clair grisé. Pages, bandeaux, cartes et
     pastilles restent blanc pur, séparés par un filet ; seul l'état appuyé (--pressed) fonce légèrement. Sombre inchangé. */
  --brand-soft: #FFFFFF;
  --brand-text: #090F1D;
  --on-brand: #FFFFFF;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #FFFFFF;
  --pressed: #EDF0F7;
  --border: #DCE1EC;
  --border-strong: #B8C1D6;
  --text: #0E1730;
  --text-muted: #4B5875;
  --ink: #0B1220;
  --on-ink: #F3F6FF;
  --on-ink-muted: #AAB6D3;
  --warning-bg: #FEF3C7;
  --warning-text: #78350F;
  --radius: 20px;
  --radius-pill: 999px;
  --gutter: 20px;
  --measure: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #2A3550;
    --brand-pressed: #36446A;
    --brand-soft: #1C2537;
    --brand-text: #D6DCEB;
    --bg: #0B1220;
    --surface: #111A2E;
    --surface-alt: #19243C;
    --pressed: #19243C;
    --border: #243049;
    --border-strong: #36446A;
    --text: #EEF2FF;
    --text-muted: #A3AFC8;
    --ink: #060B16;
    --warning-bg: #2E2308;
    --warning-text: #FDE68A;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--brand); color: var(--on-brand); padding: 10px 16px; border-radius: var(--radius-pill); z-index: 10; }
.skip:focus { left: 12px; }

.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- En-tête ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 30px; height: auto; }
.brand span { font-family: 'Lexend', system-ui, sans-serif; font-weight: 600; font-size: 21px; letter-spacing: -0.01em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-pill); text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 15px; }
/* Survol : couleur + soulignement (pas d'aplat) ; appui : léger aplat ; page en cours : filet + couleur de marque. */
.nav a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.nav a:active { background: var(--pressed); }
.nav a[aria-current='page'] { background: var(--brand-soft); color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--border); }

/* Logo clair / sombre */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .logo-light { display: none; }
  .logo-dark { display: block; }
}

/* ---------- Contenu ---------- */
main { padding: 40px 0 64px; }
main.home { padding-top: 0; }
h1, h2, h3 { font-family: 'Lexend', system-ui, sans-serif; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: clamp(30px, 6vw, 42px); margin: 0 0 12px; }
h2 { font-size: 23px; margin: 44px 0 12px; padding-top: 4px; }
h3 { font-size: 18px; font-weight: 500; margin: 28px 0 8px; }
p, ul, ol, dl { margin: 0 0 14px; max-width: var(--measure); }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }
strong { font-weight: 600; }
.lead { font-size: 19px; color: var(--text-muted); max-width: 60ch; }
.meta { font-size: 15px; color: var(--text-muted); }
.label { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 10px; }

/* Table des matières */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 28px 0 8px; max-width: var(--measure); }
.toc ol { margin: 0; columns: 2 220px; column-gap: 28px; }
.toc li { break-inside: avoid; }

/* Tableaux (durées de conservation, sous-traitants) */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 14px; max-width: 100%; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 16px; background: var(--surface); }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { font-weight: 600; background: var(--surface-alt); color: var(--text); }
tr:last-child td { border-bottom: 0; }

/* Encadrés */
.note { background: var(--brand-soft); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; margin: 0 0 18px; max-width: var(--measure); }
.note p:last-child { margin-bottom: 0; }

/* Accueil : bandeau encre + deux apps */
.hero { background: var(--ink); color: var(--on-ink); padding: 56px 0 60px; }
.hero h1 { color: var(--on-ink); }
.hero .lead { color: var(--on-ink-muted); }
.hero-logo { width: 150px; margin-bottom: 26px; }
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 8px 0 0; }
.app { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.app h2 { margin-top: 0; font-size: 21px; }
.app p { margin-bottom: 0; color: var(--text-muted); }
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 0; list-style: none; max-width: none; }
.links li { margin: 0; }
.links a { display: flex; flex-direction: column; gap: 2px; min-height: 56px; padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.links a strong { font-family: 'Lexend', system-ui, sans-serif; font-weight: 500; color: var(--brand-text); }
.links a span { color: var(--text-muted); font-size: 15px; }
.links a:hover { border-color: var(--brand-text); }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin: 0 0 10px; max-width: var(--measure); }
summary { cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; font-weight: 600; position: relative; min-height: 56px; display: flex; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-family: 'Lexend', sans-serif; font-size: 22px; color: var(--brand-text); }
details[open] summary::after { content: '–'; }
details > div { padding: 0 18px 16px; }
details > div p:last-child, details > div ol:last-child, details > div ul:last-child { margin-bottom: 0; }

/* Étapes numérotées */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: 16px; min-height: 34px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-family: 'Lexend', sans-serif; font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; border-radius: var(--radius-pill); background: var(--brand); color: var(--on-brand); font-weight: 600; text-decoration: none; }
.button:hover { background: var(--brand-pressed); }

/* ---------- Pied de page (mentions légales) ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 32px 0 40px; font-size: 15px; color: var(--text-muted); }
.site-footer h2 { font-size: 15px; font-family: 'Source Sans 3', system-ui, sans-serif; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); margin: 0 0 8px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.site-footer p { margin: 0 0 6px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 4px; }

/* Tableaux empilés sur téléphone : une carte par ligne, intitulé de colonne au-dessus de chaque valeur. */
@media (max-width: 600px) {
  .table-wrap { border: 0; overflow: visible; }
  table { min-width: 0; background: transparent; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin: 0 0 10px; padding: 4px 0; }
  td { border: 0; padding: 8px 16px; }
  td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 2px; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  main { padding: 28px 0 48px; }
  main.home { padding-top: 0; }
  h2 { margin-top: 36px; }
  .hero { padding: 40px 0 44px; }
  .hero-logo { width: 120px; }
}

@media (prefers-reduced-motion: no-preference) {
  .nav a, .links a, .button { transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
}

@media print {
  .site-header nav, .skip { display: none; }
  body { background: #fff; color: #000; }
}
