:root {
  --bg: #f2f4f1;
  --ink: #16211c;
  --ink-2: #44524b;
  --paper: #ffffff;
  --rule: #c9d1cb;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --crit: #b3261e;
  --imp: #a85a00;
  --min: #4a6572;
  --ok: #17703f;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101613;
    --ink: #e6ece8;
    --ink-2: #aab8b0;
    --paper: #18201c;
    --rule: #2e3a34;
    --accent: #7aa2ff;
    --accent-ink: #0b1220;
    --crit: #ff8a80;
    --imp: #f5b25c;
    --min: #9db4bf;
    --ok: #6fd39a;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
}

.wrap { width: min(100% - 2rem, 68rem); margin-inline: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; }

.nb { white-space: nowrap; }

/* En-tête */
.top { border-bottom: 1px solid var(--rule); }
.top-in { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; align-items: center; justify-content: space-between; padding-block: 0.9rem; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.brand span { font-family: var(--sans); font-weight: 400; font-size: 0.85rem; color: var(--ink-2); }
.top nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; align-items: center; }
.top nav a { color: var(--ink); text-decoration: none; padding-block: 0.35rem; }
.top nav a:hover { text-decoration: underline; }
.top nav .nav-cta { color: var(--accent); font-weight: 600; }

/* Héros */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem); }
.hero-in { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 56rem) { .hero-in { grid-template-columns: 1.1fr 0.9fr; gap: 3.5rem; } }
.lede { font-size: 1.2rem; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-top: 1.75rem; }

.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  font: 600 1rem/1 var(--sans); padding: 0.95rem 1.4rem; border-radius: 6px;
  border: 0; text-decoration: none; cursor: pointer; min-height: 2.75rem;
}
.btn:hover { filter: brightness(1.08); }
.link-plain { color: var(--ink); font-weight: 600; }

/* Extrait de rapport */
.sheet { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 1.25rem 1.25rem 0.5rem; box-shadow: 0 1px 0 var(--rule); }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.85rem; margin-bottom: 0.25rem; }
.sheet-head strong { font-family: var(--serif); font-size: 1.05rem; }
.sheet-head small { color: var(--ink-2); }
.score { font-family: var(--serif); font-size: 2.2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.score small { font: 400 0.95rem var(--sans); color: var(--ink-2); }
.finding { list-style: none; margin: 0; padding: 0.8rem 0 0.8rem 0.85rem; border-left: 4px solid var(--min); }
.finding + .finding { margin-top: 0.15rem; }
.finding b { display: block; font-size: 0.9rem; font-weight: 700; }
.finding span { display: block; font-size: 0.98rem; }
.finding.crit { border-color: var(--crit); } .finding.crit b { color: var(--crit); }
.finding.imp { border-color: var(--imp); } .finding.imp b { color: var(--imp); }
.finding.min { border-color: var(--min); } .finding.min b { color: var(--min); }
.sheet ul { margin: 0; padding: 0; }
.sheet-foot { margin: 0.5rem 0 0.75rem; font-size: 0.88rem; color: var(--ink-2); }

/* Sections */
section { padding-block: clamp(2.25rem, 5vw, 3.75rem); border-top: 1px solid var(--rule); }
.hero + section { border-top: 1px solid var(--rule); }

/* Offres : liste ruled, pas des cartes identiques */
.offers { margin: 1.5rem 0 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.offer { display: grid; gap: 0.35rem 2rem; padding: 1.4rem 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 48rem) { .offer { grid-template-columns: 1.1fr 2fr auto; align-items: baseline; } }
.offer h3 { margin: 0; }
.offer p { margin: 0; color: var(--ink-2); }
.price { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price small { font: 400 0.95rem var(--sans); color: var(--ink-2); }
.fine { font-size: 0.92rem; color: var(--ink-2); margin-top: 1rem; }

/* Étapes (vraie séquence) */
.steps { counter-reset: s; margin: 1.5rem 0 0; padding: 0; list-style: none; display: grid; gap: 1.1rem; max-width: 46rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.25rem 0.75rem; }
.steps li::before { content: counter(s); font-family: var(--serif); font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--accent); }
.steps b { display: block; }

/* Ce qui est analysé */
.checks { display: grid; gap: 2rem; margin-top: 1.5rem; }
@media (min-width: 48rem) { .checks { grid-template-columns: repeat(3, 1fr); } }
.checks h3 { border-bottom: 1px solid var(--rule); padding-bottom: 0.4rem; }
.checks ul { margin: 0; padding-left: 1.1rem; color: var(--ink-2); }
.checks li { margin-bottom: 0.35rem; }

/* Limites */
.limits { background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--min); padding: 1.25rem 1.4rem; border-radius: 4px; max-width: 46rem; }
.limits h2 { font-size: 1.3rem; }
.limits ul { margin: 0; padding-left: 1.1rem; }
.limits li { margin-bottom: 0.4rem; }

/* FAQ */
details { border-bottom: 1px solid var(--rule); max-width: 46rem; }
details:first-of-type { border-top: 1px solid var(--rule); }
summary { cursor: pointer; padding: 1rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--serif); font-size: 1.4rem; line-height: 1; color: var(--accent); }
details[open] summary::after { content: "\2212"; }
details p { color: var(--ink-2); }

/* Formulaire */
form.ask { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 1.5rem; max-width: 40rem; margin-top: 1.5rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field small { display: block; color: var(--ink-2); margin-top: 0.25rem; }
.field input[type="text"], .field input[type="email"], .field input[type="url"] {
  width: 100%; font: inherit; padding: 0.7rem 0.8rem; border: 1px solid var(--ink-2); border-radius: 6px; background: var(--bg); color: var(--ink); min-height: 2.75rem;
}
.consent { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.6rem; align-items: start; }
.consent input { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; accent-color: var(--accent); }
.consent label { font-weight: 400; margin: 0; }

/* Pages légales */
.legal { padding-block: clamp(2rem, 5vw, 3.5rem); }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.legal h2 { font-size: 1.35rem; margin-top: 2.2rem; }
.legal ul { max-width: 68ch; padding-left: 1.2rem; }
.legal li { margin-bottom: 0.35rem; }
.legal table { border-collapse: collapse; width: 100%; max-width: 60rem; margin: 0.5rem 0 1.2rem; font-size: 0.97rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--rule); }
.legal th { font-weight: 700; border-bottom: 2px solid var(--ink); }
.table-wrap { overflow-x: auto; }
.note { background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--min); border-radius: 4px; padding: 0.9rem 1.1rem; max-width: 68ch; }

/* Pied */
.foot { border-top: 1px solid var(--rule); padding-block: 2rem; color: var(--ink-2); font-size: 0.95rem; }
.foot-in { display: grid; gap: 1rem 2.5rem; }
@media (min-width: 48rem) { .foot-in { grid-template-columns: repeat(3, 1fr); } }
.foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print { .top nav, .skip, form.ask, .actions { display: none; } body { background: #fff; } }
