:root {
  --navy: #0e2a47;
  --navy-dark: #0a1f36;
  --teal: #14b8a6;
  --teal-dark: #0d9488;
  --bg: #ffffff;
  --bg-soft: #f4f7fa;
  --text: #1f2937;
  --muted: #5b6b7c;
  --border: #e2e8f0;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 700; color: var(--navy); }
.logo svg { flex: none; }
.nav ul { display: flex; gap: 24px; list-style: none; }
.nav ul a { color: var(--text); font-weight: 500; }
.nav ul a:hover { color: var(--teal-dark); text-decoration: none; }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 72px 0 80px;
}
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1.2; max-width: 640px; }
.hero h1 em { font-style: normal; color: var(--teal); }
.hero p { margin-top: 16px; font-size: 1.15rem; max-width: 560px; color: #cbd8e6; }
.hero .cta { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; border: 0; cursor: pointer;
}
.btn-primary { background: var(--teal); color: #06302b; }
.btn-primary:hover { background: #2dd4bf; text-decoration: none; }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid #ffffff55; }
.btn-ghost:hover { border-color: #fff; text-decoration: none; }
.hero-facts { margin-top: 44px; display: flex; gap: 36px; flex-wrap: wrap; }
.hero-facts div strong { display: block; font-size: 1.3rem; color: var(--teal); }
.hero-facts div span { font-size: .9rem; color: #cbd8e6; }

/* Sections */
section { padding: 64px 0; }
section.alt { background: var(--bg-soft); }
.section-head { max-width: 620px; margin-bottom: 36px; }
.section-head h2 { font-size: 1.75rem; color: var(--navy); }
.section-head p { margin-top: 8px; color: var(--muted); }

/* Rechner */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } }
.calc-form { display: grid; gap: 18px; }
.calc-form label { font-weight: 600; font-size: .95rem; color: var(--navy); display: block; }
.calc-form .field-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.calc-form input {
  width: 100%; padding: 11px 14px; font-size: 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
}
.calc-form input:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
.calc-form .unit { color: var(--muted); font-weight: 600; flex: none; width: 44px; }
.calc-result {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 28px; position: sticky; top: 84px;
}
.calc-result h3 { font-size: 1rem; font-weight: 600; color: #cbd8e6; }
.calc-result .total { font-size: 2.2rem; font-weight: 700; color: var(--teal); margin: 4px 0 20px; }
.calc-result dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: .95rem; }
.calc-result dt { color: #cbd8e6; }
.calc-result dd { text-align: right; font-weight: 600; }
.calc-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-top: 20px; background: #ffffff22; }
.calc-bar .einzahlung { background: #6b8db3; }
.calc-bar .zinsen { background: var(--teal); }
.calc-legend { display: flex; gap: 18px; margin-top: 10px; font-size: .82rem; color: #cbd8e6; }
.calc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

/* Themen-Karten */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: block; color: inherit; transition: box-shadow .15s, transform .15s;
}
.card:hover { text-decoration: none; box-shadow: 0 8px 24px rgb(14 42 71 / .10); transform: translateY(-2px); }
.card .icon { font-size: 1.6rem; }
.card h3 { margin: 10px 0 6px; color: var(--navy); font-size: 1.1rem; }
.card p { color: var(--muted); font-size: .95rem; }
.card .more { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--teal-dark); font-size: .9rem; }

/* Newsletter */
.newsletter { text-align: center; }
.newsletter form { margin: 24px auto 0; display: flex; gap: 10px; max-width: 460px; flex-wrap: wrap; justify-content: center; }
.newsletter input {
  flex: 1 1 260px; padding: 13px 16px; font-size: 1rem;
  border: 1.5px solid var(--border); border-radius: 999px;
}
.newsletter small { display: block; margin-top: 12px; color: var(--muted); }

/* Footer */
footer { background: var(--navy-dark); color: #cbd8e6; padding: 40px 0; font-size: .9rem; }
footer .cols { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer a { color: #cbd8e6; }
footer .disclaimer { margin-top: 24px; padding-top: 20px; border-top: 1px solid #ffffff22; color: #8fa3b8; max-width: 760px; }

/* Ratgeber-Artikel */
.article { max-width: 760px; margin: 0 auto; padding: 36px 20px 72px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); }
.article h1 { color: var(--navy); font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.25; margin-bottom: 12px; }
/* Lange deutsche Komposita (z. B. Berufsunfähigkeitsversicherung) dürfen umbrechen */
h1, h2, h3, .breadcrumb, .card h3, .vertiefung a { overflow-wrap: break-word; hyphens: auto; }
.article .intro { font-size: 1.12rem; color: var(--muted); margin-bottom: 8px; }
.article .stand { font-size: .85rem; color: var(--muted); margin-bottom: 24px; }
.article h2 { color: var(--navy); font-size: 1.4rem; margin: 40px 0 12px; }
.article h3 { color: var(--navy); font-size: 1.1rem; margin: 24px 0 8px; }
.article p { margin-bottom: 14px; }
.article ul, .article ol { padding-left: 24px; margin-bottom: 16px; }
.article li { margin-bottom: 6px; }
.kurz {
  background: var(--bg-soft); border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px; margin: 28px 0;
}
.kurz h2 { margin: 0 0 10px; font-size: 1.05rem; color: var(--navy); }
.kurz ul { margin: 0; }
.table-scroll { overflow-x: auto; margin: 16px 0 8px; }
.article table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.article th {
  background: var(--navy); color: #fff; text-align: left;
  padding: 10px 14px; font-weight: 600;
}
.article td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.article tr:nth-child(even) td { background: var(--bg-soft); }
.cta-box {
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 24px 28px; margin-top: 44px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.cta-box strong { font-size: 1.1rem; }
.cta-box p { margin: 4px 0 0; color: #cbd8e6; font-size: .95rem; }

/* ============ Mobil ============ */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: rgb(20 184 166 / .2); }
/* Randbereiche auf iPhones mit Notch/Dynamic Island */
.wrap, .article { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
/* iOS rendert Zahlenfelder sonst mit eigener Optik */
input[type="number"], input[type="email"], input[type="search"], select {
  -webkit-appearance: none; appearance: none; border-radius: 8px;
}
.newsletter input, .suche input { border-radius: 999px; }
/* Zahlen-Tastatur statt Volltastatur auf Mobilgeräten */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 700px) {
  /* Header wird zweizeilig: Logo oben, Navigation darunter */
  .nav {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding-top: 12px;
    padding-bottom: 6px;
    gap: 4px;
  }
  .logo { align-self: flex-start; }
  .nav ul {
    gap: 0;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav ul::-webkit-scrollbar { display: none; }
  .nav ul li { flex: 1 0 auto; }
  .nav ul a {
    display: block;
    padding: 12px 10px;
    font-size: .95rem;
    white-space: nowrap;
    text-align: center;
  }

  /* Hero etwas kompakter */
  .hero { padding: 48px 0 56px; }
  .hero-facts { gap: 20px 28px; margin-top: 32px; }
  section { padding: 48px 0; }

  /* Rechner: Ergebnis nicht mitscrollen lassen */
  .calc-result { position: static; }

  /* Touch-Ziele auf mindestens 44 px */
  .calc-form input,
  .mini-calc input,
  .mini-calc select,
  .newsletter input,
  .suche input { min-height: 44px; }
  .btn { padding: 14px 26px; }

  /* Rechner-Zeilen umbrechen sauber */
  .mini-calc .row { gap: 8px; }
  .mini-calc label { flex: 1 0 100%; }
  .mini-calc input { flex: 1 1 auto; width: auto; min-width: 120px; }
  .mini-calc select { flex: 1 1 100%; }
  .mini-calc input[type="checkbox"] { flex: none; min-height: 0; min-width: 0; }

  /* Listen-Links bekommen mehr Fläche zum Tippen */
  .vertiefung ul { gap: 4px 24px; }
  .vertiefung li { padding: 8px 0 8px 12px; }

  /* Footer stapeln */
  footer .cols { flex-direction: column; gap: 12px; }
}

@media (max-width: 380px) {
  .nav ul a { padding: 12px 6px; font-size: .88rem; }
  .wrap { padding: 0 16px; }
  .article { padding-left: 16px; padding-right: 16px; }
}

/* Kompakter Inline-Rechner in Artikeln */
.mini-calc {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin: 24px 0;
}
.mini-calc h2, .mini-calc h3 { margin: 0 0 12px; color: var(--navy); font-size: 1.05rem; }
.mini-calc .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.mini-calc label { font-weight: 600; font-size: .92rem; color: var(--navy); }
.mini-calc input {
  width: 130px; padding: 9px 12px; font-size: 1rem;
  border: 1.5px solid var(--border); border-radius: 8px;
}
.mini-calc input:focus, .mini-calc select:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
.mini-calc select {
  padding: 9px 12px; font-size: 1rem; font-family: inherit; color: inherit;
  background: #fff; border: 1.5px solid var(--border); border-radius: 8px; max-width: 100%;
}
.mini-calc input[type="checkbox"] { width: auto; margin-right: 6px; vertical-align: middle; }
.mini-calc .calc-bar { background: var(--border); }
.mini-calc .calc-legend { color: var(--muted); }
.mini-calc .ergebnis { margin: 12px 0 0; font-size: 1.02rem; }
.mini-calc .ergebnis strong { color: var(--teal-dark); }
.mini-calc .hinweis { margin: 8px 0 0; font-size: .82rem; color: var(--muted); }

/* Themen-Suche auf der Startseite */
.suche { margin-top: 18px; max-width: 440px; }
.suche input {
  width: 100%; padding: 11px 18px; font-size: 1rem;
  border: 1.5px solid var(--border); border-radius: 999px;
}
.suche input:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
#sucheTreffer { margin-top: 8px; font-size: .92rem; }
#sucheTreffer a {
  display: inline-block; margin: 2px 8px 2px 0; padding: 4px 14px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; color: var(--navy);
}
#sucheTreffer a:hover { border-color: var(--teal); text-decoration: none; }

/* Vertiefungs-Liste (Cluster-Unterseiten) */
.vertiefung { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.vertiefung h3 { color: var(--navy); font-size: 1.05rem; margin-bottom: 4px; }
.vertiefung > p { color: var(--muted); font-size: .95rem; margin-bottom: 16px; }
.vertiefung ul {
  list-style: none; display: grid; gap: 8px 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.vertiefung li { border-left: 2px solid var(--teal); padding-left: 12px; }
.vertiefung a { display: block; padding: 4px 0; font-weight: 600; color: var(--navy); }
.vertiefung a:hover { color: var(--teal-dark); text-decoration: none; }
.vertiefung a:hover span { color: var(--muted); }
.vertiefung span { display: block; font-weight: 400; font-size: .88rem; color: var(--muted); }
