/* Opinion Radar — design system partagé pour les pages de démonstration.
   Deux thèmes (politique / marque) via la classe sur <body>. */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #181b22;
  --muted: #5c6472;
  --faint: #8a93a3;
  --line: #e7e9ee;
  --good: #1f9d6b;
  --good-soft: #e7f6ef;
  --warn: #bd7b15;
  --warn-soft: #fbf2e0;
  --bad: #cf4242;
  --bad-soft: #fae9e9;
  --accent: #2d3e64;
  --accent-soft: #eef1f8;
  --accent-ink: #2d3e64;
  --shadow: 0 1px 2px rgba(20, 25, 40, .04), 0 8px 24px rgba(20, 25, 40, .06);
  --radius: 16px;
  --radius-sm: 10px;
}

/* `.theme-brand` (et non `body.theme-brand`) : scopable à un sous-arbre (ex. le rapport) sans
   teinter le chrome app (sidebar). `<body class="theme-brand">` reste matché. */
.theme-brand {
  --accent: #b9651b;
  --accent-soft: #fbf1e6;
  --accent-ink: #9a5114;
}

/* `.theme-political` : ton « renseignement », sobre — l'accent navy (= défaut :root), posé
   explicitement pour scoper le rapport d'un archétype « personne » (cf. docs/ARCHETYPES.md). */
.theme-political {
  --accent: #2d3e64;
  --accent-soft: #eef1f8;
  --accent-ink: #2d3e64;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; }
.brand .brand-mark { width: 24px; height: 24px; flex: none; display: block; }
.nav { margin-left: auto; display: flex; gap: 6px; }
.nav a {
  font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none;
  padding: 6px 12px; border-radius: 20px; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--accent-soft) 100%);
  border-bottom: 1px solid var(--line);
  padding: 56px 0 48px;
}
.hero .wrap { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink);
}
.hero h1 {
  font-size: 34px; line-height: 1.18; letter-spacing: -.02em; margin: 14px 0 12px;
  max-width: 19ch;
}
.hero p.lede { font-size: 16px; color: var(--muted); max-width: 46ch; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 13px; color: var(--muted);
}
.chip b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Gauge */
.gauge { text-align: center; }
.gauge svg { display: block; }
.gauge .score-num { font-size: 30px; font-weight: 800; fill: var(--ink); }
.gauge .score-den { font-size: 13px; font-weight: 600; fill: var(--faint); }
.gauge .label { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.gauge .rank { margin-top: 2px; font-size: 13px; color: var(--accent-ink); font-weight: 700; }

/* Hero centré + bande d'aperçu produit */
.hero-centered { padding: 64px 0 0; }
/* La carte d'aperçu déborde de -44px : la section suivante dégage le dessus pour ne pas la chevaucher. */
.hero-centered + section.block { padding-top: 76px; }
/* Annule la grille deux-colonnes héritée de `.hero .wrap` (spécificité 0,2,0). */
.hero-centered .wrap { display: block; }
.hero-lead { text-align: center; max-width: 760px; }
.hero-centered h1 { margin: 16px auto 0; max-width: 17ch; font-size: 42px; line-height: 1.1; }
.hero-centered p.lede { margin: 16px auto 0; max-width: 56ch; font-size: 17px; }
.hero-actions { justify-content: center; margin-top: 28px; gap: 12px; }
.hero-points.hero-points-row {
  flex-direction: row; flex-wrap: wrap; justify-content: center;
  gap: 10px 22px; margin-top: 22px;
}
.hero-points.hero-points-row li { font-size: 13px; }

/* Carte d'aperçu : déborde légèrement sur la section suivante (effet « capture qui dépasse »). */
.hero-preview-wrap { margin-top: 44px; padding-bottom: 0; }
.hero-preview {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 8px 40px rgba(20, 25, 40, .10);
  padding: 18px 22px; margin-bottom: -44px; position: relative; z-index: 2;
}
.hp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.hp-entity { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.hp-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  color: #fff; background: var(--accent);
}
.hp-tag {
  font-size: 11px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 20px; padding: 3px 10px;
}
.hp-body {
  display: grid; grid-template-columns: auto 1.3fr 1fr; gap: 28px;
  align-items: center; padding-top: 16px;
}
.hp-cell-label {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 10px;
}
.hp-gauge { text-align: center; }
.hp-gauge .hp-cell-label { margin-top: 4px; margin-bottom: 0; }
.hp-gauge .score-num { font-size: 34px; font-weight: 800; fill: var(--ink); }
.hp-gauge .score-den { font-size: 14px; font-weight: 600; fill: var(--faint); }
.hp-bar {
  display: grid; grid-template-columns: 52px 1fr 38px; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.hp-bar:last-child { margin-bottom: 0; }
.hp-bar .hp-name { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.hp-bar.you .hp-name { color: var(--accent-ink); }
.hp-bar .hp-track { height: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.hp-bar .hp-track i { display: block; height: 100%; background: var(--faint); border-radius: 6px; }
.hp-bar.you .hp-track i { background: var(--accent); }
.hp-bar .hp-val { font-size: 12.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.hp-meter { height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.hp-meter i { display: block; height: 100%; background: var(--good); border-radius: 6px; }
.hp-meter-val { margin-top: 6px; font-size: 18px; font-weight: 800; color: var(--ink); }
.hp-models { display: flex; align-items: center; gap: 4px; margin-top: 16px; }
.hp-models .hp-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--surface); margin-left: -4px; }
.hp-models .hp-dot:first-child { margin-left: 0; }
.hp-models-label { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }

/* Sections */
section.block { padding: 40px 0; border-bottom: 1px solid var(--line); }
.sec-kicker { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.sec-title { font-size: 21px; letter-spacing: -.01em; margin: 6px 0 22px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { font-size: 15px; margin-bottom: 14px; }
.card .sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

/* Attribute tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.tag.neg { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

/* Sentiment meter */
.meter { margin-top: 18px; }
.meter .meter-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.meter .track { height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter .fill { height: 100%; border-radius: 6px; background: var(--good); }

/* Verbatim */
.quote {
  margin-top: 18px; padding: 14px 16px; background: var(--surface-2);
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
}
.quote p { font-style: italic; font-size: 14px; color: var(--ink); }
.quote cite { display: block; margin-top: 8px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--faint); }

/* Tone indicator */
.tone { margin-top: 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.tone .badge-half { font-weight: 700; color: var(--warn); }

/* Share of voice bars */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 42px; align-items: center; gap: 12px; }
.bar-row .name { font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; }
.bar-row.you .name { color: var(--accent-ink); }
.bar-row .bar-track { height: 22px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: #c7cdd8; border-radius: 6px; }
.bar-row.you .bar-fill { background: var(--accent); }
.bar-row .val { font-size: 13px; font-weight: 700; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
/* Présence par angle : labels multi-mots (≠ noms courts de part de voix) → colonne large, à gauche. */
.bars.by-angle .bar-row { grid-template-columns: minmax(140px, 40%) 1fr 44px; }
.bars.by-angle .name { text-align: left; }
.bars.by-angle .name .tag { margin-left: 6px; }

/* Chapitrage par angle (rapport adaptatif) : un bloc par angle, ses situations détaillées dessous. */
.angle-chapter { padding: 16px 18px; }
.angle-chapter + .angle-chapter { margin-top: 12px; }
.angle-moments { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.angle-moments li { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; }
.angle-moments .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.angle-moments li.fort .dot { background: var(--good); }
.angle-moments li.absent .dot { background: var(--bad); }
.angle-moments li small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.angle-moments li.sub { color: var(--muted); font-size: 12.5px; }

.callout {
  margin-top: 18px; padding: 14px 16px; border-radius: 12px;
  background: var(--accent-soft); font-size: 14px; color: var(--accent-ink); font-weight: 600;
  display: flex; gap: 10px; align-items: flex-start;
}
.callout .flag { flex: none; }

/* Terrain / occasion columns */
.col { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.col .col-top { height: 4px; }
.col.good .col-top { background: var(--good); }
.col.warn .col-top { background: var(--warn); }
.col.bad .col-top { background: var(--bad); }
.col .col-body { padding: 18px 20px; }
.col .col-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.col.good .col-label { color: var(--good); }
.col.warn .col-label { color: var(--warn); }
.col.bad .col-label { color: var(--bad); }
.col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.col li { font-size: 14px; color: var(--ink); padding-left: 16px; position: relative; }
.col li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.col li small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Tipping point */
.tip-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tip-card { border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); }
.tip-card.in { border-left: 4px solid var(--good); }
.tip-card.out { border-left: 4px solid var(--bad); }
.tip-card .q { font-size: 15px; color: var(--ink); margin-bottom: 12px; }
.tip-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.tip-badge.in { background: var(--good-soft); color: var(--good); }
.tip-badge.out { background: var(--bad-soft); color: var(--bad); }
.tip-note { margin-top: 18px; font-size: 15px; color: var(--ink); }
.tip-note b { color: var(--accent-ink); }

/* Fact-check / risk list */
.facts { display: flex; flex-direction: column; gap: 12px; }
.fact { display: flex; gap: 14px; padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.fact .src { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); width: 74px; }
.fact .txt { font-size: 14px; color: var(--ink); }
.fact.alert { background: var(--bad-soft); border-color: transparent; }
.fact.alert .src { color: var(--bad); }
.fact.alert .txt b { color: var(--bad); }

/* Actions */
.actions { counter-reset: a; display: flex; flex-direction: column; gap: 12px; }
.action { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.action::before {
  counter-increment: a; content: counter(a);
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: 14px;
  display: grid; place-items: center;
}
.action p { font-size: 14px; color: var(--ink); }

.frame-note { font-size: 13px; color: var(--muted); margin-bottom: 18px; max-width: 60ch; }

/* Footer */
footer { padding: 32px 0 64px; }
footer .wrap { font-size: 12.5px; color: var(--faint); }
footer .disclaimer { padding: 14px 16px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .tip-pair { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .hero-centered { padding-top: 44px; }
  .hero-centered h1 { font-size: 30px; }
  .hp-body { grid-template-columns: 1fr; gap: 20px; }
  .hp-gauge { display: flex; align-items: center; gap: 16px; text-align: left; }
  .hp-gauge .hp-cell-label { margin: 0; }
}

/* ── Pages légales (mentions, confidentialité, CGV) ──────────────────────────────────────────
   Document long : colonne de lecture étroite, hiérarchie calme, tableaux qui défilent seuls sur
   mobile (le corps de page ne doit jamais défiler horizontalement). */
.legal { padding: 48px 0 72px; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: 32px; letter-spacing: -.01em; margin-bottom: 6px; }
.legal h2 {
  font-size: 20px; margin: 40px 0 12px; padding-top: 20px;
  border-top: 1px solid var(--line);
}
.legal h3 { font-size: 16px; margin: 24px 0 8px; color: var(--ink); }
.legal p, .legal li { color: var(--muted); line-height: 1.65; }
.legal p { margin-bottom: 12px; }
.legal ul { margin: 0 0 16px 20px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent-ink); }
.legal code {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; font-size: 13px; color: var(--ink);
}
.legal-updated { font-size: 13px; color: var(--faint); margin-bottom: 28px; }
.legal-lede { font-size: 17px; line-height: 1.6; color: var(--ink); margin-bottom: 8px; }
.legal-note {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 14px;
}
.legal-table { overflow-x: auto; margin: 0 0 20px; }
.legal-table table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 420px; }
.legal-table th, .legal-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.legal-table th { color: var(--ink); font-weight: 600; background: var(--surface-2); }
.legal-table td { color: var(--muted); }

/* Liens légaux du pied de page (les deux chromes publics). */
.legal-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; }
.legal-links a { color: var(--faint); font-size: 13px; text-decoration: none; }
.legal-links a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 700px) {
  .legal { padding: 32px 0 56px; }
  .legal h1 { font-size: 26px; }
}
