/* Battery Rebate Calculator, direction A « énergie claire » : blanc, bleu nuit, accent ambre. */
@font-face {
  font-family: "Raleway";
  src: url("fonts/Raleway-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #0d1f3c;
  --navy-2: #16305a;
  --ink: #14233d;
  --muted: #52617a;
  --line: #dbe3ee;
  --sky: #eef4fb;
  --sky-2: #e2ecf8;
  --white: #ffffff;
  --amber: #f6a71a;
  --amber-ink: #0d1f3c;
  --amber-soft: #fff4dc;
  --alert: #a14a00;
  --radius: 18px;
  --shadow: 0 18px 40px -18px rgba(13, 31, 60, 0.35);
  --font: "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 500 17px/1.6 var(--font);
  font-variant-numeric: lining-nums tabular-nums;
}
a { color: var(--navy-2); text-underline-offset: 3px; }
a:hover { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 14px; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 24px 0 8px; }
p { margin: 0 0 14px; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 6px; }
.site-header :focus-visible, .hero :focus-visible, .page-head :focus-visible, .site-footer :focus-visible { outline-color: var(--amber); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.preview-banner { background: var(--amber); color: var(--amber-ink); text-align: center; font-weight: 700; font-size: 14px; padding: 6px 16px; }

/* Header */
.site-header { background: var(--navy); color: var(--white); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font-weight: 800; font-size: 1.05rem; }
.brand:hover { color: var(--white); }
.brand svg { width: 30px; height: 30px; flex: none; }
.site-header nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-header nav a { color: #d7e2f3; text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { background: var(--navy-2); color: var(--white); }

/* Hero */
.hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white);
  padding: 44px 0 120px;
  overflow: hidden;
}
.hero .wrap { display: grid; grid-template-columns: 1.3fr 0.7fr; align-items: center; gap: 24px; }
.hero h1 { color: var(--white); font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; margin: 14px 0 12px; }
.hero h1 em { font-style: normal; color: var(--amber); }
.hero .lead { color: #d7e2f3; font-size: 1.15rem; max-width: 40ch; margin: 0; }
.hero-fact { justify-self: end; text-align: right; }
.hero-fact p { margin: 0; }
.hero-fact-label { color: #d7e2f3; font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.hero-fact-figure { display: flex; align-items: baseline; justify-content: flex-end; gap: 14px; font-size: clamp(3rem, 7vw, 5.2rem); font-weight: 800; line-height: 1; color: var(--white); margin: 6px 0 8px !important; }
.hero-fact-figure .arrow { color: #8fa6c8; font-size: 0.6em; }
.hero-fact-figure .next { color: var(--amber); }
.hero-fact-note { color: #d7e2f3; font-weight: 600; }
.hero-fact-note strong { color: var(--white); }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white); font-size: 13.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
}
.badge svg { width: 16px; height: 16px; flex: none; }
.badge a { color: var(--white); }

/* Calculator card */
.calc-shell { margin-top: -90px; position: relative; z-index: 1; }
.calculator {
  display: grid; grid-template-columns: 1fr 1.05fr;
  background: var(--white); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
  overflow: hidden; margin: 0 0 40px;
}
.inputs { padding: 30px; }
.result { padding: 30px; background: var(--sky); border-left: 1px solid var(--line); }
.field { margin-bottom: 26px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.field-label .value { font-size: 1.5rem; font-weight: 800; color: var(--navy); white-space: nowrap; }
.field-label .value small { font-size: 0.95rem; font-weight: 700; color: var(--muted); }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; cursor: pointer; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--amber) var(--fill, 20%), #9fb3cf var(--fill, 20%)); }
input[type=range]::-moz-range-track { height: 10px; border-radius: 999px; background: #9fb3cf; }
input[type=range]::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--amber); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 50%; background: var(--white); border: 4px solid var(--navy); box-shadow: 0 2px 6px rgba(13, 31, 60, 0.3); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--white); border: 4px solid var(--navy); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  font: 700 14px var(--font); color: var(--navy); background: var(--white);
  border: 1.5px solid #8a9ab3; border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px;
}
.chip:hover { border-color: var(--navy-2); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }

select {
  width: 100%; min-height: 50px; padding: 10px 14px; font: 600 16px var(--font); color: var(--ink);
  background: var(--white); border: 1.5px solid #8a9ab3; border-radius: 12px;
}
select:hover { border-color: var(--navy-2); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two-col label { display: block; font-weight: 700; color: var(--navy); margin-bottom: 8px; }

.result-label { margin: 0; color: var(--muted); font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.result-amount { margin: 4px 0 2px; font-size: clamp(2.6rem, 5vw, 3.6rem); font-weight: 800; color: var(--navy); line-height: 1.05; }
.result-amount small { font-size: 1.1rem; font-weight: 700; color: var(--muted); }
.result-detail { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; }

.alert {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--amber-soft); border: 1px solid #f3d08a; border-radius: 14px; padding: 12px 14px; margin: 0 0 16px;
}
.alert svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.alert p { margin: 0; color: #5a3600; font-weight: 600; font-size: 15px; }
.alert strong { color: var(--alert); }
.alert[hidden] { display: none; }
.state-note { font-size: 14.5px; color: var(--muted); margin: 0 0 16px; }
.state-note:empty { display: none; }

.chart-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 8px; margin-bottom: 18px; }
.chart-title { font-size: 14px; font-weight: 700; color: var(--navy); margin: 0 0 6px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .bar { fill: #9fb3cf; }
.chart .bar.now { fill: var(--amber); }
.chart .bar.sel { fill: var(--navy); }
.chart text { font: 600 11px var(--font); fill: var(--muted); }
.chart .val { fill: var(--navy); font-weight: 800; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 4px 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--amber); color: var(--amber-ink); text-decoration: none; font-weight: 800; font-size: 1.05rem;
  padding: 16px 20px; border-radius: 14px; min-height: 56px; text-align: center; box-shadow: 0 8px 18px -10px rgba(246, 167, 26, 0.9);
}
.cta:hover { background: #ffb733; color: var(--amber-ink); }
.cta-ghost { background: var(--white); color: var(--navy); border: 2px solid var(--navy); box-shadow: none; }
.cta-ghost:hover { background: var(--navy); color: var(--white); }
.disclosure { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* Content */
main { display: block; }
.content { max-width: 820px; margin: 0 auto; padding: 0 20px 24px; }
.section { padding: 44px 0; }
.section.alt { background: var(--sky); }
.page-head { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: var(--white); padding: 40px 0 44px; margin-bottom: 32px; }
.page-head .wrap { max-width: 860px; }
.page-head h1 { color: var(--white); font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; margin: 12px 0 10px; max-width: 24ch; }
.page-head p { color: #d7e2f3; max-width: 60ch; margin: 0; }
.updated { color: var(--muted); font-size: 14.5px; }
.content > h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; margin: 32px 0 12px; }
.content h2 { margin-top: 34px; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 6px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; padding: 0; margin: 18px 0 8px; counter-reset: step; }
.steps li { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0; counter-increment: step; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: var(--white); font-weight: 800; margin-bottom: 10px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; list-style: none; padding: 0; margin: 18px 0 0; }
.cards li { margin: 0; }
.cards a { display: flex; gap: 14px; align-items: center; height: 100%; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); text-decoration: none; color: var(--navy); font-weight: 700; }
.cards a:hover { border-color: var(--navy-2); box-shadow: var(--shadow); }
.cards svg { width: 40px; height: 40px; flex: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin: 14px 0 24px; background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.table-wrap table { margin: 0; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--navy); color: var(--white); font-weight: 700; font-size: 14px; }
tbody tr:nth-child(even) td { background: #f7faff; }
tbody tr:last-child td { border-bottom: 0; }
tr.current td { font-weight: 800; background: var(--amber-soft) !important; }

details { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 10px; background: var(--white); }
summary { list-style: none; cursor: pointer; padding: 16px 48px 16px 18px; font-weight: 700; color: var(--navy); position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; border-right: 2.5px solid var(--navy); border-bottom: 2.5px solid var(--navy); transform: translateY(-70%) rotate(45deg); transition: transform 0.2s; }
details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
details > p { padding: 0 18px 16px; margin: 0; }

/* Footer */
.site-footer { background: var(--navy); color: #c6d3e8; margin-top: 48px; padding: 32px 0; font-size: 14.5px; }
.site-footer .wrap { display: grid; gap: 10px; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--white); }

@media (max-width: 860px) {
  .hero { padding: 32px 0 96px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-fact { justify-self: start; text-align: left; }
  .hero-fact-figure { justify-content: flex-start; }
  .calculator { grid-template-columns: 1fr; }
  .result { border-left: 0; border-top: 1px solid var(--line); }
  .steps, .cards { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .inputs, .result { padding: 22px 16px; }
  .two-col { grid-template-columns: 1fr; }
  .site-header .wrap { padding-top: 10px; padding-bottom: 10px; }
  .site-header nav a { padding: 6px 10px; font-size: 14px; }
  .content { padding: 0 16px 20px; }
  th, td { padding: 10px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.lg-now { background: var(--amber); }
.lg-sel { background: var(--navy); }
.lg-later { background: #9fb3cf; }
.legend [hidden] { display: none; }
.trust { list-style: none; padding: 20px 0 0; margin: 26px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.trust li { display: flex; gap: 10px; align-items: center; margin: 0; color: var(--muted); font-weight: 600; font-size: 15px; }
.trust svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 520px) {
  .hero { padding: 24px 0 92px; }
  .hero .lead { font-size: 1.02rem; }
  .badge { font-size: 12.5px; border-radius: 14px; align-items: flex-start; }
  .badge svg { margin-top: 2px; }
  .chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .chip { padding: 8px 4px; font-size: 13px; }
  .result-amount { font-size: 2.6rem; }
}
@media (max-width: 860px) { .trust { padding-top: 14px; margin-top: 18px; } .trust li + li { display: none; } }
.result-amount + .result-label { margin-top: 16px; }

/* Compact result under the slider: on small screens the amount is visible without scrolling */
.quick-result { display: none; margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--navy); color: #d7e2f3; font-weight: 600; font-size: 15px; }
.quick-result strong { color: var(--white); font-size: 1.25rem; font-weight: 800; margin-right: 4px; }
.quick-result .q-loss { display: block; color: var(--amber); font-weight: 700; font-size: 14px; }
@media (max-width: 860px) { .quick-result { display: block; } }

/* Reading list (editorial, no icon cards) */
.reading { list-style: none; padding: 0; margin: 18px 0 0; counter-reset: read; border-top: 1px solid var(--line); }
.reading li { counter-increment: read; display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; padding: 16px 0; margin: 0; border-bottom: 1px solid var(--line); }
.reading li::before { content: counter(read, decimal-leading-zero); grid-row: span 2; color: var(--amber); font-weight: 800; font-size: 1.15rem; line-height: 1.4; color: #b36b00; }
.reading a { font-weight: 800; font-size: 1.1rem; color: var(--navy); }
.reading span { color: var(--muted); font-size: 15px; }
.reading time { color: var(--muted); font-size: 14px; font-weight: 700; }

/* Blog template */
.crumbs { font-size: 14px; color: #d7e2f3; margin: 0 0 10px !important; }
.crumbs a { color: var(--white); }
.meta-dates { color: #d7e2f3; font-size: 14px; font-weight: 600; margin: 12px 0 0 !important; }
.figure-box { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--amber-soft); border: 1px solid #f3d08a; border-radius: 16px; padding: 16px 18px; margin: 22px 0; }
.figure-box p { margin: 0; color: #5a3600; font-weight: 600; }
.figure-box strong { display: block; color: var(--navy); font-size: 1.6rem; font-weight: 800; }
.figure-box a { font-weight: 800; color: var(--navy); }
.related { margin-top: 36px; padding-top: 8px; }
.related h2 { font-size: 1.25rem; }

/* Tables on phones: secondary columns are hidden (class hide-sm) */
@media (max-width: 520px) {
  .hide-sm { display: none; }
  .steps li { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; align-items: start; padding: 14px; }
  .steps li::before { margin: 0; }
  .site-header .wrap { flex-wrap: nowrap; flex-direction: column; align-items: stretch; gap: 6px; min-height: 0; }
  .site-header nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .site-header nav a { white-space: nowrap; flex: none; }
  .hero-fact { display: none; }
  .hero { padding: 18px 0 84px; }
  .hero h1 { font-size: 1.75rem; margin: 10px 0 6px; }
  .hero .wrap { gap: 12px; }
  .hero-fact-label { display: none; }
}
