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

:root {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

/* ── Header ── */
header {
  background: var(--accent);
  color: #fff;
  padding: 48px 24px 40px;
  text-align: center;
}

.app-logo {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 500;
  opacity: 0.9;
  margin-bottom: 12px;
}

.meta {
  font-size: 0.85rem;
  opacity: 0.75;
}

/* ── Layout ── */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  padding: 48px 0 80px;
}

/* ── Table des matières ── */
nav.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 40px;
}

nav.toc h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

nav.toc ol {
  list-style: none;
  counter-reset: toc;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
}

nav.toc li { counter-increment: toc; }

nav.toc a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  gap: 8px;
}

nav.toc a::before {
  content: counter(toc) ".";
  color: var(--text-muted);
  font-size: 0.8rem;
  min-width: 18px;
  padding-top: 1px;
}

nav.toc a:hover { text-decoration: underline; }

/* ── Sections ── */
section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  margin-bottom: 20px;
}

section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-light);
}

section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 10px;
}

section h3:first-of-type { margin-top: 0; }

p { margin-bottom: 14px; }
p:last-child { margin-bottom: 0; }

ul, ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

li { margin-bottom: 6px; }

strong { font-weight: 600; }

/* ── Tableaux ── */
.table-wrap { overflow-x: auto; margin: 16px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead tr { background: var(--accent-light); }

th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background: #fafafa; }

/* ── Liens ── */
a { color: var(--accent); }
a:hover { text-decoration: underline; }

/* ── Badges ── */
.badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Contact box ── */
.contact-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin-top: 16px;
}

.contact-box p { margin: 0; font-size: 0.95rem; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  section { padding: 24px 20px; }
  nav.toc ol { grid-template-columns: 1fr; }
  header { padding: 36px 20px 28px; }
  .app-logo { font-size: 1.6rem; }
}
