/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #111;
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* =====================
   UTILITY
   ===================== */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.container--wide {
  max-width: 1080px;
}

.content-narrow {
  max-width: 640px;
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* =====================
   HERO
   ===================== */
.hero {
  background: #000;
  color: #fff;
  padding: 48px 0 36px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero .subtitle {
  margin-top: 10px;
  font-size: 1.05rem;
  color: #ccc;
}

/* =====================
   CALCULATOR SECTION
   ===================== */
.calculator-section {
  padding: 40px 0 32px;
}

.card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 28px 32px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

/* =====================
   STEP BLOCKS
   ===================== */
.step-block {
  margin-bottom: 32px;
}

.step-block:last-child {
  margin-bottom: 0;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #999;
  margin-bottom: 14px;
}

/* =====================
   GOAL GRID
   ===================== */
.goal-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.goal-card {
  flex: 1;
  min-width: 160px;
  cursor: pointer;
  padding: 16px;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #111;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goal-card:hover {
  border-color: #bbb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.goal-card--active {
  border-color: #000;
  background: #000;
  color: #fff;
}

.goal-card--active:hover {
  border-color: #000;
  background: #111;
}

.goal-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 4px;
}

.goal-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.goal-desc {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.4;
}

.goal-card--active .goal-desc {
  color: #aaa;
}

/* =====================
   INPUTS
   ===================== */
.inputs {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #e5e7eb;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  transition: background 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #333;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
}

input[type="number"] {
  width: 100px;
  padding: 8px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #111;
  text-align: right;
  outline: none;
  transition: border-color 0.15s;
}

input[type="number"]:focus {
  border-color: #000;
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* =====================
   CRASH TOGGLE
   ===================== */
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch {
  position: relative;
  flex-shrink: 0;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.toggle-thumb {
  display: block;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-track {
  background: #000;
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-track {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.toggle-text {
  font-size: 0.9rem;
  color: #333;
  font-weight: 500;
  line-height: 1.4;
}

.crash-note {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #777;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px 14px;
  border-left: 3px solid #e5e7eb;
}

/* =====================
   RESULTS SECTION
   ===================== */
.results-section {
  margin-top: 8px;
}

/* Two-column layout when Bauspar is hidden */
.results-grid--two {
  grid-template-columns: repeat(2, 1fr);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

/* =====================
   RESULT CARDS
   ===================== */
.result-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px 18px 16px;
  border-left-width: 4px;
  transition: box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-card--etf {
  border-left-color: #111;
}

.result-card--ret {
  border-left-color: #2563eb;
}

.result-card--bauspar {
  border-left-color: #16a34a;
}

.result-card--best {
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.result-card--best::before {
  content: "Beste Rendite";
  position: absolute;
  top: -1px;
  right: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: #000;
  color: #fff;
  padding: 2px 8px;
  border-radius: 0 0 6px 6px;
}

.result-card--ret.result-card--best::before {
  background: #2563eb;
}

.result-card--bauspar.result-card--best::before {
  background: #16a34a;
}

.result-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #777;
}

.result-card-value {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: #000;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 2px 0;
}

.result-card-subtitle {
  font-size: 0.78rem;
  color: #aaa;
  margin-bottom: 10px;
}

.result-card-breakdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid #f0f0f0;
  padding-top: 10px;
  margin-top: 2px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #666;
}

.breakdown-row span:last-child {
  font-weight: 600;
  color: #444;
}

.breakdown-row--profit {
  font-weight: 700;
  color: #111;
  padding-top: 4px;
  border-top: 1px solid #f0f0f0;
  margin-top: 2px;
}

.breakdown-row--profit span:last-child {
  color: #111;
  font-weight: 800;
}

/* Förderung breakdown box */
.foerderung-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 12px;
}

.foerderung-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2563eb;
  margin-bottom: 6px;
}

.foerderung-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #444;
  padding: 2px 0;
}

.foerderung-row--total {
  font-weight: 700;
  color: #1d4ed8;
  padding-top: 5px;
  margin-top: 3px;
  border-top: 1px solid #bfdbfe;
}

/* Monthly pension row */
.pension-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 12px;
}

.pension-label {
  font-size: 0.78rem;
  color: #666;
}

.pension-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111;
}

/* Input hint */
.input-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: #aaa;
  margin-left: 6px;
  letter-spacing: 0;
}

/* Lump sum row (slightly muted) */
.lump-row {
  background: #fafafa;
  border: 1px dashed #e5e7eb;
}

.lump-row .pension-label {
  color: #888;
  font-style: italic;
}

.lump-row .pension-value {
  color: #555;
  font-size: 0.92rem;
}

/* Förderung live preview in inputs */
.foerderung-preview {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 20px;
}

.foerderung-preview-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.foerderung-preview-grid {
  margin-bottom: 10px;
}

.fp-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #374151;
  padding: 3px 0;
  border-bottom: 1px solid #dbeafe;
}

.fp-row--total {
  font-weight: 700;
  color: #1d4ed8;
  border-bottom: none;
  padding-top: 6px;
  font-size: 0.9rem;
}

.fp-tiers {
  border-top: 1px solid #bfdbfe;
  padding-top: 8px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fp-tier {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
}

.fp-tier--max {
  color: #1d4ed8;
  font-weight: 600;
}

.fp-hint {
  font-size: 0.78rem;
  color: #1e40af;
  margin-top: 8px;
  font-style: italic;
}

/* Bauspardarlehen note on Bauspar card */
.bauspar-loan-note {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.76rem;
  color: #166534;
  margin-top: 10px;
  line-height: 1.5;
}

/* Immobilien note on AVD card */
.immo-note {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.78rem;
  color: #78350f;
  margin-top: 10px;
  line-height: 1.5;
}

/* Eigenheim box */
.eigenheim-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
}

.eigenheim-note {
  font-size: 0.74rem;
  color: #555;
  margin: 4px 0 8px;
  line-height: 1.4;
}

.eigenheim-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #555;
}

.eigenheim-input-row input {
  width: 64px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Input hint as block (below alter input) */
p.input-hint {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
  margin-left: 0;
}

/* Formula display box */
.formula-box {
  background: #f8f9fa;
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  padding: 12px 16px;
  font-family: monospace;
  font-size: 0.92rem;
  color: #111;
  margin: 12px 0 16px;
  line-height: 1.5;
}

/* Pension comparison table */
.pension-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.9rem;
}

.pension-table th {
  text-align: left;
  padding: 8px 12px;
  background: #f3f4f6;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
}

.pension-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.pension-table tr:last-child td {
  font-weight: 700;
  color: #2563eb;
}

/* Small calculation explanation below pension rows */
.calc-note {
  font-size: 0.70rem;
  color: #aaa;
  margin-top: 4px;
  margin-bottom: 2px;
  line-height: 1.4;
}

.result-card-note {
  font-size: 0.76rem;
  color: #999;
  font-style: italic;
  margin-top: 6px;
  min-height: 1em;
}

/* =====================
   DECISION SUMMARY
   ===================== */
.decision-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 10px;
  margin-top: 4px;
}

.decision-line {
  font-size: 0.9rem;
  color: #333;
  font-weight: 500;
}

/* =====================
   CHARTS SECTION
   ===================== */
.charts-section {
  padding: 0 0 40px;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-card {
  padding: 20px 20px 16px;
}

.chart-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap--line {
  height: 280px;
}

.chart-wrap--bar {
  height: 240px;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* =====================
   CONTENT SECTIONS
   ===================== */
.content-section {
  padding: 56px 0;
}

.alt-bg {
  background: #f9fafb;
}

.content-section h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: #000;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.content-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111;
  margin: 28px 0 8px;
}

.content-section p {
  color: #444;
  margin-bottom: 14px;
  font-size: 0.97rem;
}

.content-section ul {
  padding-left: 20px;
  color: #444;
  font-size: 0.97rem;
}

.content-section ul li {
  margin-bottom: 8px;
}

.content-section a {
  color: #000;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-section a:hover {
  color: #555;
}

/* =====================
   DISCLAIMER BOX
   ===================== */
.disclaimer-box {
  font-size: 0.83rem;
  color: #777;
  background: #fff3cd;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 28px;
  line-height: 1.55;
}

/* =====================
   SOURCES
   ===================== */
.sources {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1.5px solid #e5e7eb;
}

.sources h2 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #999;
  margin-bottom: 12px;
}

.sources ul {
  padding-left: 0;
  list-style: none;
}

.sources ul li {
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.sources ul li a {
  color: #777;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sources ul li a:hover {
  color: #333;
}

/* TRUST LINE */
.trust-line {
  text-align: center;
  font-size: 0.82rem;
  color: #bbb;
  margin-top: 14px;
  letter-spacing: 0.02em;
}

/* =====================
   FAQ
   ===================== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.faq-item {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.15s;
}

.faq-item[open] {
  border-color: #bbb;
}

.faq-item summary {
  padding: 16px 18px;
  font-weight: 600;
  font-size: 0.97rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #111;
}

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

.faq-item summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  color: #aaa;
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  padding: 0 18px 16px;
  color: #555;
  font-size: 0.93rem;
  margin: 0;
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  background: #000;
  color: #aaa;
  padding: 36px 0;
}

.footer-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: #666;
  max-width: 500px;
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #888;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: #fff;
}

.footer-copy {
  font-size: 0.8rem;
  color: #555;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

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

  .goal-grid {
    flex-direction: column;
  }

  .goal-card {
    min-width: unset;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 20px 16px 24px;
  }

  .input-row {
    gap: 10px;
  }

  input[type="number"] {
    width: 80px;
    font-size: 0.88rem;
  }

  .hero {
    padding: 36px 0 28px;
  }

  .content-section {
    padding: 40px 0;
  }

  .result-card-value {
    font-size: 1.6rem;
  }

  .charts-section {
    padding: 0 0 28px;
  }

  .chart-wrap--line {
    height: 220px;
  }

  .chart-wrap--bar {
    height: 200px;
  }
}
