/* Pages légales Sella — feuille unique, sans police ni ressource externe
   (une page de confidentialité ne transmet l'adresse IP de personne à un
   tiers). Polices système, arabe compris. */

:root {
  --bg: #fbfaff;
  --surface: #ffffff;
  --ink: #201643;
  --muted: #5b5378;
  --line: #e4def5;
  --accent: #6540e9;
  --accent-ink: #4b2bc4;
  --accent-soft: #efeafe;
  --focus: #d98e32;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, "Arabic Typesetting", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120d26;
    --surface: #1b1536;
    --ink: #ece8fb;
    --muted: #b3abd0;
    --line: #2e2652;
    --accent: #a993ff;
    --accent-ink: #c3b5ff;
    --accent-soft: #241c47;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
}

[lang="ar"], [lang="ar"] body { font-family: var(--font-ar); }
html[lang="ar"] body { font-size: 1.125rem; line-height: 1.85; }

.wrap { width: 100%; max-width: 46rem; margin-inline: auto; padding-inline: 1rem; }

a { color: var(--accent-ink); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem;
  background: var(--accent); color: #fff; padding: 0.5rem 0.9rem; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 1rem; }

/* ── En-tête ── */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; }
.brand {
  font-weight: 750; font-size: 1.35rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none;
  font-family: var(--font);
}
.brand::before {
  content: ""; display: inline-block; width: 0.7em; height: 0.7em; margin-inline-end: 0.45em;
  border-radius: 0.22em; background: var(--accent); vertical-align: 0.02em;
}
.lang { display: flex; gap: 0.35rem; align-items: center; font-size: 0.95rem; }
.lang a, .lang-current { padding: 0.3rem 0.75rem; border-radius: 999px; text-decoration: none; }
.lang-current { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.lang a { color: var(--accent-ink); border: 1px solid var(--line); }
.lang a:hover { border-color: var(--accent); }

.docs ul { list-style: none; margin: 0; padding: 0 0 0.6rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; font-size: 0.95rem; }
.docs a { color: var(--muted); text-decoration: none; padding-block: 0.25rem; display: inline-block; }
.docs a:hover { color: var(--ink); }
.docs a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* ── Contenu ── */
main { padding-block: 2rem 3rem; flex: 1 0 auto; }
main:focus { outline: none; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5rem; }
html[lang="ar"] h1 { letter-spacing: 0; line-height: 1.4; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 2.4rem 0 0.6rem; padding-top: 0.2rem; }
h3 { font-size: 1.08rem; margin: 1.5rem 0 0.4rem; }
p, ul, ol, table { margin: 0 0 1rem; }
ul, ol { padding-inline-start: 1.4rem; }
li + li { margin-top: 0.3rem; }
.docs li + li, .cards li + li, .contact-list li + li { margin-top: 0; }
.meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.intro { font-size: 1.08rem; }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.5rem 0 0.5rem; }
.toc p { font-weight: 650; margin: 0 0 0.4rem; }
.toc ol { margin: 0; padding: 0; list-style: none; font-size: 0.97rem; }

.note {
  background: var(--accent-soft); border-inline-start: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 0.9rem 1.1rem; margin: 0 0 1rem;
}
html[dir="rtl"] .note { border-radius: var(--radius) 0 0 var(--radius); }
.note > :last-child { margin-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-inline-start: 2.6rem; min-height: 2rem; }
.steps li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: 0.05rem;
  width: 1.85rem; height: 1.85rem; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 0.95rem; display: grid; place-items: center; font-family: var(--font);
}
.path { font-weight: 600; }

.table-scroll { overflow-x: auto; margin: 0 0 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 0; }
th, td { text-align: start; vertical-align: top; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-weight: 650; background: var(--accent-soft); }

.cards { list-style: none; padding: 0; display: grid; gap: 0.8rem; margin-top: 1.5rem; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.05rem 1.2rem; text-decoration: none; color: var(--ink);
}
.card:hover { border-color: var(--accent); }
.card-title { display: block; font-weight: 650; color: var(--accent-ink); margin-bottom: 0.2rem; }
.card-text { display: block; color: var(--muted); font-size: 0.97rem; }

.contact-list { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.contact-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; margin: 0; }
.contact-list strong { display: block; }

.notfound { padding-block: 2rem; }
.notfound .h1-like { font-size: 1.6rem; font-weight: 700; margin: 2rem 0 0.5rem; }

/* ── Pied de page ── */
.foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.92rem; padding-block: 1.5rem 2rem; }
.publisher { margin: 0 0 0.6rem; }
.publisher-title { font-weight: 650; color: var(--ink); margin: 0 0 0.4rem; }
.publisher dl { margin: 0; display: grid; gap: 0.15rem; }
.publisher dl div { display: flex; flex-wrap: wrap; gap: 0 0.5rem; }
.publisher dt::after { content: " :"; }
html[lang="ar"] .publisher dt::after { content: ":"; }
.publisher dd { margin: 0; color: var(--ink); }
.foot-meta { margin: 0; }

@media (min-width: 40rem) {
  .cards { grid-template-columns: 1fr 1fr; }
  main { padding-block: 2.75rem 4rem; }
}

@media print {
  .top nav, .skip, .toc { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: inherit; }
  .foot, .top { background: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
