/* =============================================================================
   Feuille de style des pages légales (mentions, CGU, confidentialité).
   Reprend les tokens du design system HubMedical — documents à lire et à
   imprimer, donc traitement sobre et thème clair.
   ============================================================================= */

@font-face {
  font-family: 'Nunito';
  src: url('fonts/nunito-variable.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary:   #4f46e5;
  --primary-b: #6366f1;
  --text:      #1e1b4b;
  --text-2:    #475569;
  --muted:     #64748b;
  --border:    #e0e7ff;
  --surface:   #ffffff;
  --bg:        #f9f9fd;
  --bg-subtle: #f0f1fe;
  --rose:      #c2185b;
  --rose-bg:   #fdf2f8;
  --shadow:    0 1px 3px rgba(99, 102, 241, .06), 0 4px 16px rgba(99, 102, 241, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.masthead { background: var(--surface); border-bottom: 1px solid var(--border); }

.masthead__inner {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.035em;
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 7px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: grid;
  place-items: center;
  font-size: .85rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.05em;
}

.masthead nav { display: flex; gap: 1.1rem; font-size: .85rem; font-weight: 600; flex-wrap: wrap; }
.masthead nav a { color: var(--muted); text-decoration: none; }
.masthead nav a:hover { color: var(--primary); }
.masthead nav a[aria-current="page"] { color: var(--primary); font-weight: 800; }

/* ── Document ─────────────────────────────────────────────── */

main { max-width: 52rem; margin: 0 auto; padding: 3rem 1.5rem 5rem; }

.doc-head { margin-bottom: 2.5rem; }

.eyebrow {
  margin: 0 0 .5rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--primary);
}

h1 {
  margin: 0 0 .6rem;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.05;
  text-wrap: balance;
}

.doc-head p { margin: 0; color: var(--muted); font-size: .92rem; }

h2 {
  margin: 2.6rem 0 .9rem;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  text-wrap: balance;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

h2:first-of-type { border-top: 0; padding-top: 0; }

h3 { margin: 1.6rem 0 .5rem; font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }

p { margin: 0 0 .9rem; }

ul, ol { margin: 0 0 .9rem; padding-left: 1.2rem; }
li { margin-bottom: .35rem; }

strong { font-weight: 700; }

a { color: var(--primary); }

section { scroll-margin-top: 1.5rem; }

/* ── Sommaire ─────────────────────────────────────────────── */

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
}

.toc h2 {
  margin: 0 0 .6rem;
  padding: 0;
  border: 0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  columns: 2;
  column-gap: 2rem;
  font-size: .9rem;
}

.toc li { margin-bottom: .25rem; break-inside: avoid; }

.toc a { text-decoration: none; color: var(--text-2); }
.toc a::before { counter-increment: toc; content: counter(toc) ". "; color: var(--muted); font-weight: 700; }
.toc a:hover { color: var(--primary); }

/* ── Encarts ──────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.2rem;
}

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

.callout {
  background: var(--bg-subtle);
  border-left: 3px solid var(--primary-b);
  border-radius: 0 10px 10px 0;
  padding: .9rem 1.2rem;
  margin-bottom: 1.2rem;
}

.callout > :last-child { margin-bottom: 0; }

.todo {
  background: var(--rose-bg);
  border: 1px dashed var(--rose);
  border-radius: 10px;
  padding: .9rem 1.2rem;
  margin-bottom: 1.2rem;
  font-size: .92rem;
}

.todo > :last-child { margin-bottom: 0; }
.todo strong { color: var(--rose); }

/* ── Fiche d'identité ─────────────────────────────────────── */

.identity { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.4rem; margin: 0; font-size: .95rem; }
.identity dt { font-weight: 700; color: var(--muted); }
.identity dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ── Tableaux ─────────────────────────────────────────────── */

.scroll-x {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 1.2rem;
}

table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 30rem; }

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

thead th {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-subtle);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }

/* ── Pied ─────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.foot__inner {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .84rem;
  color: var(--muted);
}

.foot__inner p { margin: 0; }
.foot nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--primary); }

:focus-visible { outline: 2px solid var(--primary-b); outline-offset: 3px; border-radius: 4px; }

@media (max-width: 40rem) {
  .toc ol { columns: 1; }
  .identity { grid-template-columns: 1fr; gap: .1rem 0; }
  .identity dd { margin-bottom: .5rem; }
}

@media print {
  body { background: #fff; }
  .masthead nav, .toc, .foot nav { display: none; }
  main { padding: 0; max-width: none; }
  h2 { break-after: avoid; }
  .card, .callout, .todo { break-inside: avoid; }
}
