:root {
  --bg: #0f1b2d;
  --bg-deep: #0b1524;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #b6c2d2;
  --soft: #8fa1b7;
  --gold: #d4af37;
  --green: #34d399;
  --orange: #fbbf24;
  --red: #f87171;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--bg-deep), var(--bg) 55%, #101827);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: inherit; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 22px;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  background: #fff;
  color: #111;
  padding: 8px 10px;
  border-radius: 8px;
  z-index: 20;
}

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 21, 36, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand span { color: var(--gold); }

.navlinks {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.navlinks a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.navlinks a:hover,
.navlinks a:focus-visible {
  color: var(--text);
}

.navlinks .active {
  color: var(--gold);
  font-weight: 700;
}

.navcta {
  background: var(--gold);
  color: #111 !important;
  padding: 9px 15px;
  border-radius: 999px;
  font-weight: 800;
}

.hero {
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #f4d37b;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.82rem;
  margin-bottom: 14px;
  background: rgba(212, 175, 55, 0.08);
}

h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}

.lead {
  font-size: clamp(1rem, 2vw, 1.12rem);
  color: var(--muted);
  max-width: 680px;
  margin: 0 0 12px;
}

.micro-disclaimer {
  font-size: 0.82rem;
  color: var(--soft);
  margin: 0;
}

section {
  padding: 48px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.15;
  margin: 0 0 10px;
}

.section-lead {
  margin: 0 0 22px;
  color: var(--muted);
  max-width: 760px;
}

.sim-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.sim-panel,
.results-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  border-radius: var(--radius);
  padding: 20px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--soft);
  margin-bottom: 8px;
}

.field output {
  font-weight: 700;
  color: var(--gold);
  font-size: 0.95rem;
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
}

.field input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.95rem;
}

.field input[type="number"]:focus-visible,
.field input[type="range"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.field.is-empty input[type="number"] {
  color: var(--soft);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.result-card strong {
  display: block;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--gold);
  line-height: 1.2;
}

.result-card span {
  font-size: 0.8rem;
  color: var(--soft);
}

.debt-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.debt-ok { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.debt-warn { background: rgba(251, 191, 36, 0.15); color: var(--orange); }
.debt-high { background: rgba(248, 113, 113, 0.12); color: var(--red); }

.alert-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 12px;
}

.chart-wrap {
  margin-top: 8px;
}

.chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--soft);
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.92rem;
}

.btn-primary {
  background: var(--gold);
  color: #111;
}

.btn-secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  font-weight: 600;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  border-radius: var(--radius);
  padding: 18px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--text);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.9rem;
}

table.data th,
table.data td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

table.data th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

table.data td { color: var(--muted); }

.table-meta {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--soft);
}

details.faq {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.035);
  margin-bottom: 10px;
}

details.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

details.faq summary::-webkit-details-marker { display: none; }

details.faq summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

details.faq p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.bio {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.bio img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  display: block;
}

.bio p { color: var(--muted); margin: 0 0 12px; }

footer {
  padding: 28px 0 36px;
  color: var(--soft);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
  text-align: center;
  line-height: 1.8;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover { color: var(--gold); }

.share-row {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.share-row input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .sim-grid,
  .grid-3,
  .bio {
    grid-template-columns: 1fr;
  }

  .navlinks a:not(.navcta):not(.active) {
    display: none;
  }
}

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 56px 0 32px; }
  .results-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .navcta { padding: 8px 12px; font-size: 0.82rem; }
}

.compare-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.06);
  font-size: 0.9rem;
  color: var(--muted);
}

.compare-box p { margin: 0 0 8px; }
.compare-box strong { color: var(--text); }
.compare-warn { font-size: 0.78rem; color: var(--soft); margin-top: 10px !important; }

.taux-source {
  font-size: 0.82rem;
  color: var(--soft);
  margin: 0 0 16px;
}

.taux-source a { color: var(--gold); }

.lead-box {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.lead-box h3 { margin: 0 0 12px; font-size: 1rem; }

.lead-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lead-grid input,
.lead-grid select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.9rem;
}

.lead-grid label { font-size: 0.78rem; color: var(--soft); display: block; margin-bottom: 4px; }

.lead-full { grid-column: 1 / -1; }

.lead-success {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
  font-size: 0.9rem;
}

.lead-error {
  margin-top: 10px;
  color: var(--red);
  font-size: 0.85rem;
}

.amort-details { margin-top: 16px; }

.amort-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--gold);
  list-style: none;
}

.amort-details summary::-webkit-details-marker { display: none; }

.amort-scroll {
  max-height: 320px;
  overflow: auto;
  margin-top: 12px;
}

table.amort {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

table.amort th,
table.amort td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

table.amort th { color: var(--text); background: rgba(255, 255, 255, 0.04); }
table.amort td { color: var(--muted); }

.print-only { display: none; }

@media print {
  nav, footer, .no-print, .skip, .share-row, .lead-box, .navcta, .cta-row .btn-secondary { display: none !important; }
  body { background: #fff; color: #111; }
  .wrap { max-width: 100%; }
  .sim-panel, .results-panel, .compare-box { border: 1px solid #ccc; background: #fff; }
  .result-card strong, .compare-box strong { color: #111; }
  .print-only { display: block !important; }
  .print-header {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #111;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }
  .print-header img { width: 100px; height: 100px; }
}

@media (max-width: 560px) {
  .lead-grid { grid-template-columns: 1fr; }
}
