/* =============================================
   RentePerMaand.nl — Shared Stylesheet
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=Playfair+Display:wght@700;800&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #0F1F3D;
  --navy-mid:  #1A3260;
  --gold:      #E8A020;
  --gold-light:#F4C560;
  --cream:     #F7F6F2;
  --grey-light:#E8ECF0;
  --grey-mid:  #B8C4D0;
  --grey-text: #6B7A8D;
  --text:      #1A1A2E;
  --white:     #FFFFFF;
  --red-soft:  #E05A40;
  --green-soft:#2A9D6A;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(15,31,61,0.08);
  --shadow:    0 4px 20px rgba(15,31,61,0.12);
  --shadow-lg: 0 8px 40px rgba(15,31,61,0.16);

  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p  { color: var(--grey-text); line-height: 1.75; }

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }

/* ── Header / Nav ── */
.site-header {
  background: var(--navy);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { color: var(--gold); }
.logo-icon { font-size: 1.1rem; }

.site-nav { display: flex; gap: 24px; }
.site-nav a {
  color: var(--grey-mid);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.site-nav a:hover, .site-nav a.active { color: var(--gold); }

/* ── Page Hero ── */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 64px 24px 48px;
  color: white;
}
.page-hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.page-hero h1 { color: white; margin-bottom: 16px; }
.page-hero p { color: rgba(255,255,255,0.75); font-size: 1.05rem; max-width: 600px; }

/* ── Main Layout ── */
.main-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 860px) {
  .main-wrap { grid-template-columns: 1fr; }
}

/* ── Calculator Card ── */
.calc-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.calc-header {
  background: var(--navy);
  padding: 24px 32px;
  color: white;
}
.calc-header h2 { color: white; font-size: 1.4rem; }
.calc-header p { color: rgba(255,255,255,0.65); font-size: 0.9rem; margin-top: 4px; }
.calc-body { padding: 32px; }

/* ── Form Fields ── */
.field-group { margin-bottom: 24px; }
.field-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 540px) { .field-row { grid-template-columns: 1fr; } }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-prefix, .input-suffix {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--grey-mid);
  pointer-events: none;
}
.input-prefix { left: 12px; }
.input-suffix { right: 12px; }

input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--grey-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--navy);
  background: var(--cream);
  transition: border-color 0.2s, background 0.2s;
  -moz-appearance: textfield;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; }

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  background: white;
}
.has-prefix input { padding-left: 28px; }
.has-suffix input { padding-right: 36px; }

/* Slider */
.slider-wrap { margin-top: 8px; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--grey-light);
  border-radius: 2px;
  border: none;
  padding: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--gold);
  cursor: pointer;
}
input[type="range"]:focus { outline: none; }

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--grey-mid);
  margin-top: 4px;
}

/* ── Results ── */
.results-panel {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 28px;
  color: white;
  margin-top: 8px;
}
.results-panel h3 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.result-item {}
.result-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  margin-bottom: 4px;
}
.result-value {
  font-size: 1.6rem;
  font-weight: 600;
  color: white;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.result-value.accent { color: var(--gold); }
.result-value.large {
  font-size: 2rem;
  font-family: var(--font-display);
}

/* Split Bar */
.split-bar-wrap { margin-top: 24px; }
.split-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 8px;
}
.split-bar-label .lbl-aflossing { color: var(--gold); font-weight: 600; }
.split-bar-label .lbl-rente { color: var(--red-soft); font-weight: 600; }
.split-bar {
  height: 12px;
  border-radius: 6px;
  background: var(--red-soft);
  overflow: hidden;
  position: relative;
}
.split-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 6px;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}
.split-bar-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  margin-top: 6px;
  text-align: center;
}

/* ── Chart ── */
.chart-wrap {
  position: relative;
  height: 260px;
  margin-top: 24px;
  background: white;
  border-radius: var(--radius);
  padding: 16px;
}

/* ── Amortisatie Tabel ── */
.table-section { margin-top: 8px; }
.table-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 2px solid var(--grey-light);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: all 0.2s;
}
.table-toggle:hover { border-color: var(--gold); color: var(--gold); }
.table-toggle .icon { transition: transform 0.3s; }
.table-toggle.open .icon { transform: rotate(180deg); }

.amort-table-wrap {
  display: none;
  margin-top: 16px;
  overflow-x: auto;
}
.amort-table-wrap.visible { display: block; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
thead th {
  background: var(--navy);
  color: white;
  padding: 10px 12px;
  text-align: right;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}
thead th:first-child { text-align: left; border-radius: var(--radius-sm) 0 0 0; }
thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
tbody tr { border-bottom: 1px solid var(--grey-light); }
tbody tr:hover { background: var(--cream); }
tbody tr.milestone { background: rgba(232,160,32,0.08); }
tbody td {
  padding: 9px 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
tbody td:first-child { text-align: left; font-weight: 600; color: var(--navy); }
.td-rente { color: var(--red-soft); }
.td-aflossing { color: var(--green-soft); }

.export-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s;
}
.export-btn:hover { background: var(--navy-mid); }

/* ── Sidebar ── */
.sidebar {}
.sidebar-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}
.sidebar-card h3 {
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--grey-light);
}

.related-tools a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--grey-light);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--navy);
  transition: color 0.2s;
}
.related-tools a:last-child { border-bottom: none; padding-bottom: 0; }
.related-tools a:hover { color: var(--gold); }
.tool-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.tip-box {
  background: var(--cream);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.tip-box p { font-size: 0.85rem; color: var(--grey-text); line-height: 1.6; }
.tip-box strong { color: var(--navy); }

/* ── SEO Content ── */
.seo-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 64px;
}
.seo-content h2 {
  color: var(--navy);
  margin: 40px 0 16px;
  font-size: 1.6rem;
}
.seo-content h3 {
  color: var(--navy);
  margin: 28px 0 12px;
  font-size: 1.15rem;
}
.seo-content p { margin-bottom: 16px; }
.seo-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
  color: var(--grey-text);
}
.seo-content ul li { margin-bottom: 8px; line-height: 1.7; }

.formula-box {
  background: var(--navy);
  color: white;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
  font-family: 'Courier New', monospace;
}
.formula-box .formula-label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 10px;
}
.formula-box .formula { font-size: 1.05rem; line-height: 1.8; }
.formula-box .formula var { color: var(--gold-light); font-style: italic; }

.faq-item { margin-bottom: 20px; }
.faq-item dt {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  font-size: 1rem;
}
.faq-item dd { color: var(--grey-text); padding-left: 0; line-height: 1.7; }

/* ── Footer ── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 40px 24px;
  text-align: center;
  font-size: 0.85rem;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-nav { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-nav a { color: rgba(255,255,255,0.5); transition: color 0.2s; }
.footer-nav a:hover { color: var(--gold); }
.footer-disclaimer { font-size: 0.78rem; max-width: 600px; margin: 12px auto 0; line-height: 1.6; }

/* ── Index page hero ── */
.home-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #243B6E 100%);
  padding: 80px 24px 72px;
  text-align: center;
  color: white;
}
.home-hero h1 { color: white; margin-bottom: 20px; }
.home-hero p { color: rgba(255,255,255,0.7); font-size: 1.1rem; max-width: 560px; margin: 0 auto 32px; }
.hero-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); color: var(--navy); }

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* Tool Grid (homepage) */
.tools-section { padding: 64px 24px; max-width: 1100px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { color: var(--navy); margin-bottom: 8px; }
.section-header p { max-width: 500px; margin: 0 auto; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.tool-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--gold);
}
.tool-card.featured { border-color: var(--gold); background: linear-gradient(135deg, white, rgba(232,160,32,0.04)); }
.tool-card-icon { font-size: 2rem; margin-bottom: 16px; }
.tool-card h3 { font-family: var(--font-body); font-size: 1.05rem; color: var(--navy); margin-bottom: 8px; }
.tool-card p { font-size: 0.875rem; flex: 1; }
.tool-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--navy);
  transition: color 0.2s;
}
.tool-card-link:hover { color: var(--gold); }
.badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .calc-body { padding: 20px; }
  .result-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .result-value { font-size: 1.3rem; }
  .result-value.large { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
