*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f0f4f8;
  color: #2d3748;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.container {
  max-width: 720px;
  margin: 0 auto;
}

h1 {
  font-size: 2rem;
  color: #1a365d;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #718096;
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* ── Logo & Site-Header ───────────────────────────────────── */
.site-header {
  margin-bottom: 1.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.logo-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(26, 54, 93, 0.25));
}

.logo-wordmark {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.logo-name {
  font-size: 1.75rem;
  color: #1a365d;
  margin-bottom: 0;
  line-height: 1.15;
}

.logo-accent {
  color: #2b6cb0;
}

.logo-tagline {
  color: #718096;
  font-size: 0.88rem;
  margin: 0;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

h2 {
  font-size: 1.1rem;
  color: #2b6cb0;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #ebf8ff;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.input-euro-wrapper {
  position: relative;
}

.input-euro-wrapper .euro-input {
  padding-right: 2rem;
}

.euro-symbol {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  font-size: 0.95rem;
  pointer-events: none;
}

input[type="number"],
.euro-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid #cbd5e0;
  border-radius: 8px;
  font-size: 1rem;
  color: #2d3748;
  transition: border-color 0.2s;
  background: #f7fafc;
}

input[type="number"]:focus,
.euro-input:focus {
  outline: none;
  border-color: #3182ce;
  background: #fff;
}

small {
  display: block;
  color: #a0aec0;
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.btn-berechnen {
  display: block;
  width: 100%;
  padding: 0.85rem;
  background: #2b6cb0;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: background 0.2s;
}

.btn-berechnen:hover {
  background: #2c5282;
}

.ergebnis {
  border-top: 4px solid #3182ce;
}

.ergebnis h2 {
  color: #1a365d;
  border-bottom-color: #bee3f8;
}

.hidden {
  display: none;
}

.ergebnis-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ergebnis-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: #f7fafc;
  border-radius: 8px;
}

.ergebnis-item.highlight {
  background: #ebf8ff;
  font-weight: 700;
}

.ergebnis-item .label {
  color: #4a5568;
  font-size: 0.95rem;
}

.wert {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2d3748;
}

.wert.positiv {
  color: #276749;
}

.wert.negativ {
  color: #c53030;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.slider-header label {
  margin-bottom: 0;
}

.slider-value {
  font-size: 1rem;
  font-weight: 700;
  color: #2b6cb0;
}

input[type="range"] {
  width: 100%;
  accent-color: #2b6cb0;
  cursor: pointer;
  height: 6px;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #a0aec0;
  margin-top: 0.25rem;
}

.berechnet-anzeige {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: #ebf8ff;
  border: 1.5px solid #bee3f8;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #2b6cb0;
}

.card-collapsible summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.card-collapsible summary::after {
  content: '▶';
  font-size: 0.7rem;
  color: #a0aec0;
  margin-left: auto;
  transition: transform 0.2s;
}

.card-collapsible[open] summary::after {
  transform: rotate(90deg);
}

.card-collapsible summary h2 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.card-collapsible[open] summary h2 {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #ebf8ff;
}

.card-collapsible[open] summary {
  margin-bottom: 1rem;
}

.trenner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 1.5rem;
}

.trenner::before,
.trenner::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, transparent, #bee3f8);
}

.trenner::after {
  background: linear-gradient(to left, transparent, #bee3f8);
}

.trenner span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2b6cb0;
  white-space: nowrap;
}

.hinweis {
  font-size: 0.78rem;
  color: #a0aec0;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ── Ergebnis-Jahr in Überschrift ─────────────────────────── */
.ergebnis-jahr {
  font-size: 0.8rem;
  font-weight: 400;
  color: #718096;
}

.versteckt {
  display: none;
}

.chart-canvas {
  margin-top: 1rem;
  display: block;
}

.chart-legende {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.legende-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #4a5568;
}

.legende-farbe {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Validierungsfehler ───────────────────────────────────── */
.input-error {
  border-color: #e53e3e !important;
  background: #fff5f5 !important;
}

.error-msg {
  display: block;
  color: #c53030;
  font-size: 0.82rem;
  margin-top: 0.3rem;
  line-height: 1.4;
}

/* ── Intro-Abschnitt ──────────────────────────────────────── */
.intro {
  background: linear-gradient(135deg, #ebf8ff 0%, #f0f4f8 100%);
  border-left: 4px solid #3182ce;
}

.intro-heading {
  color: #1a365d;
  border-bottom-color: #bee3f8;
}

.intro-lead {
  color: #2d3748;
  line-height: 1.65;
  margin-bottom: 0.6rem;
  font-size: 0.96rem;
}

.intro-text {
  color: #4a5568;
  line-height: 1.6;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
}

.intro-steps {
  margin: 0;
  padding-left: 1.3rem;
  color: #4a5568;
  font-size: 0.9rem;
  line-height: 1.9;
}

.cta-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.5rem;
  background: #2b6cb0;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s;
}

.cta-btn:hover {
  background: #2c5282;
}

/* ── Abschnittsbeschreibung ───────────────────────────────── */
.section-desc {
  color: #718096;
  font-size: 0.87rem;
  line-height: 1.55;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* ── Label-Zeile mit Tooltip-Icon ────────────────────────── */
.label-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 0.35rem;
}

.label-row label {
  margin-bottom: 0;
}

.slider-header .label-row {
  margin-bottom: 0;
}

/* ── Info-Button ──────────────────────────────────────────── */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #bee3f8;
  color: #2b6cb0;
  font-size: 0.7rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s;
}

.info-btn:hover,
.info-btn:focus,
.info-btn.active {
  background: #90cdf4;
  outline: none;
}

/* ── Tooltip-Box ──────────────────────────────────────────── */
.tooltip-box {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 10px);
  background: #2d3748;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 400;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  width: 240px;
  line-height: 1.5;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: normal;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.tooltip-box::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #2d3748;
}

.info-btn:hover + .tooltip-box,
.info-btn:focus + .tooltip-box,
.info-btn.active + .tooltip-box {
  opacity: 1;
}

/* ── Ergebnis-Hinweise ────────────────────────────────────── */
.ergebnis-hinweise {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  background: #f7fafc;
  border-radius: 8px;
  border-left: 3px solid #bee3f8;
}

.hinweis-titel {
  font-size: 0.78rem;
  font-weight: 700;
  color: #718096;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hinweis-liste {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.79rem;
  color: #a0aec0;
  line-height: 1.65;
}

.hinweis-liste li + li {
  margin-top: 0.2rem;
}

/* ── FAQ-Abschnitt ────────────────────────────────────────── */
.faq h2 {
  margin-bottom: 1rem;
}

.faq-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.1rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: #2d3748;
  padding: 0.65rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

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

.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  color: #a0aec0;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  font-size: 0.9rem;
  color: #4a5568;
  line-height: 1.65;
  padding-bottom: 0.75rem;
  margin: 0;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  font-size: 0.8rem;
  color: #a0aec0;
  line-height: 1.6;
}

.site-footer a {
  color: #718096;
  text-decoration: underline;
}

.footer-disclaimer {
  margin-top: 0.35rem;
  font-size: 0.76rem;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 540px) {
  body {
    padding: 1.25rem 0.75rem;
  }

  h1 {
    font-size: 1.55rem;
  }

  .card {
    padding: 1.1rem;
  }

  /* Logo */
  .logo-icon {
    width: 42px;
    height: 42px;
  }

  .logo-name {
    font-size: 1.4rem;
  }

  /* Intro */
  .intro-lead {
    font-size: 0.9rem;
  }

  .cta-btn {
    display: block;
    text-align: center;
  }

  /* Labels mit langen Texten umbrechen erlauben */
  .label-row {
    flex-wrap: wrap;
  }

  /* Ergebnis-Jahr in eigener Zeile */
  .ergebnis-jahr {
    display: block;
    margin-top: 0.1rem;
  }

  /* Ergebnis-Items: Label und Wert untereinander */
  .ergebnis-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
  }

  .ergebnis-item .label {
    font-size: 0.88rem;
  }

  .wert {
    font-size: 1rem;
  }

  /* Tooltip: schmaler und linksbündig damit er nicht vom Rand abgeschnitten wird */
  .tooltip-box {
    width: 200px;
    left: 0;
    transform: none;
  }

  .tooltip-box::after {
    left: 14px;
    transform: none;
  }

  /* FAQ */
  .faq-item summary {
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  body {
    padding: 1rem 0.5rem;
  }

  h1 {
    font-size: 1.35rem;
  }

  .card {
    padding: 0.9rem;
  }
}

.footer-links {
  margin-top: 0.5rem;
}

.footer-links a {
  color: #718096;
  text-decoration: underline;
  font-size: 0.82rem;
}

/* ── Impressum-Seite ──────────────────────────────────────── */
.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: #2b6cb0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.back-link:hover {
  text-decoration: underline;
}

.impressum-block p {
  font-size: 0.93rem;
  color: #4a5568;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

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

.impressum-hinweis {
  font-size: 0.8rem !important;
  color: #a0aec0 !important;
  background: #f7fafc;
  border-left: 3px solid #bee3f8;
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
}
