:root {
  --bg: #edf2f6;
  --surface: #ffffff;
  --ink: #0e2a3f;
  --muted: #53687b;
  --line: #d2dde6;
  --brand: #0a6f8f;
  --brand-ink: #07495f;
  --gold: #f1b12e;
  --good: #177a4c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
}

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 700;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); max-width: 24ch; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; max-width: 65ch; }
a { color: var(--brand-ink); }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.wrap { width: min(1100px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* ---------- En-tête ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 0.9rem; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; font: 700 1.45rem var(--serif); color: var(--ink); text-decoration: none; }
.logo svg { width: 34px; height: 24px; }
.logo svg circle { fill: var(--brand); }
.logo svg path { stroke: var(--gold); stroke-width: 3; stroke-linecap: round; fill: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.nav a { color: var(--ink); text-decoration: none; padding: 0.3rem 0; border-bottom: 3px solid transparent; font-weight: 500; }
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--brand); font-weight: 700; }

/* ---------- Accueil ---------- */
.hero { padding: 3rem 0 1.5rem; }
.hero .lead { font-size: 1.2rem; color: var(--muted); margin-bottom: 1.75rem; }

.route {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 1.5rem minmax(9rem, 12rem) 1.5rem minmax(0, 1.2fr);
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem;
}
.line { height: 3rem; display: flex; align-items: center; }
.line::before { content: ""; flex: 1; border-top: 2px dashed var(--brand); opacity: 0.55; }
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field label { font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.route-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-top: 1.1rem; }
.route-actions .field { min-width: 14rem; flex: 0 1 20rem; }

select, input[type="number"], input[type="text"], input[type="email"], textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  min-height: 3rem;
  width: 100%;
}
textarea { min-height: 7rem; resize: vertical; }
select:hover, input:hover, textarea:hover { border-color: var(--brand); }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.85rem 1.5rem;
  min-height: 3rem;
  font: 600 1rem var(--sans);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn:hover { background: var(--brand-ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand-ink); border: 1.5px solid var(--brand); }
.btn-ghost:hover { background: var(--brand); color: #fff; }
.btn-small { padding: 0.55rem 1rem; min-height: 2.5rem; font-size: 0.95rem; }

/* ---------- Résultats ---------- */
.results-wrap { padding: 1.5rem 0 1rem; }
.status { font-size: 0.9rem; color: var(--muted); margin: 0.9rem 0 0; }
.results { margin-top: 1.5rem; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 1.5rem; }
.results-head h2 { margin-bottom: 0.2em; }
.sort { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.sort label { font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.sort select { width: auto; min-height: 2.5rem; padding-block: 0.4rem; }

.notice { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: 8px; padding: 0.9rem 1.1rem; max-width: none; }

.combo { background: var(--brand-ink); color: #fff; border-radius: 14px; padding: 1.5rem 1.6rem; margin-bottom: 1.75rem; }
.combo h2 { color: #fff; margin-bottom: 0.3em; }
.combo-gain { font-size: 1.15rem; color: #ffe3a3; }
.combo-steps { padding-left: 1.3rem; margin: 0 0 1rem; max-width: 65ch; }
.combo-steps li { margin-bottom: 0.5rem; }
.combo-note { font-size: 0.92rem; color: #cfe3ea; margin: 0; }

.offers { list-style: none; margin: 0; padding: 0; }
.offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  grid-template-areas: "name amount" "bar side" "meta side";
  gap: 0.4rem 1.75rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.offer.is-best { border: 2px solid var(--brand); }
.offer-name { grid-area: name; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.6rem; font-weight: 700; font-size: 1.1rem; }
.offer-amount { grid-area: amount; text-align: right; font: 700 1.5rem var(--serif); }
.bar { grid-area: bar; height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width 0.6s ease; }
.is-best .bar span { background: var(--good); }
.offer-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 0.15rem 1.4rem; font-size: 0.9rem; color: var(--muted); }
.offer-side { grid-area: side; display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; text-align: right; }
.tag { font-size: 0.78rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--bg); color: var(--muted); }
.tag-best { background: var(--gold); color: #3a2a00; }
.tag-fast { background: #d8efe4; color: #0d5a37; }

.disclaimer { font-size: 0.9rem; color: var(--muted); margin-top: 1.25rem; max-width: 75ch; }

/* ---------- Sections ---------- */
.section { padding: 3rem 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem 2.5rem; margin-top: 1.5rem; }
.cols h3 { padding-top: 0.6rem; border-top: 3px solid var(--brand); }
.steps { padding-left: 1.4rem; max-width: 65ch; }
.steps li { margin-bottom: 0.9rem; padding-left: 0.4rem; }
.band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--gold); border-radius: 10px; padding: 1.5rem 1.75rem; }
.band h2 { margin-bottom: 0.2em; }
.band p { margin-bottom: 0; }

details { border-bottom: 1px solid var(--line); padding: 0.9rem 0; max-width: 75ch; }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 0.7rem 0 0; }

.providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; margin: 1.25rem 0 2.5rem; }
.provider { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.4rem; }
.provider-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.provider-top h3 { margin: 0; }
.facts { margin: 0.4rem 0 0.8rem; font-size: 0.92rem; }
.facts div { display: grid; grid-template-columns: 6rem 1fr; gap: 0.5rem; padding: 0.2rem 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }
.provider .btn { align-self: flex-start; margin-top: auto; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem 1.25rem; max-width: 820px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.92rem; }
.check input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; }
.hidden { display: none; }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 2rem; }
.page-title { padding: 3rem 0 0.5rem; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ink); color: #d5e2ea; padding: 2.5rem 0; margin-top: 3rem; font-size: 0.95rem; }
.site-footer a { color: #fff; }
.site-footer .cols { margin-top: 0; }
.site-footer h3 { font-size: 1rem; color: #fff; border-top: 0; padding-top: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer .fine { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid #2b4a63; font-size: 0.85rem; color: #a9bfcd; max-width: 90ch; }

/* ---------- Petits écrans ---------- */
@media (max-width: 760px) {
  .route { grid-template-columns: 1fr; gap: 0.9rem; }
  .line { display: none; }
  .offer { grid-template-columns: 1fr; grid-template-areas: "name" "amount" "bar" "meta" "side"; }
  .offer-amount, .offer-side { text-align: left; align-items: flex-start; }
  .hero { padding-top: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

.meta-strong { color: var(--ink); font-weight: 700; }
