/* ============================================================
   altersvorsorge-broker.de — zentrales Stylesheet
   Design-System: "Ruhe + Wachstum" (Master-Dokument Kap. 6)
   ============================================================ */

/* ---------- Fonts (lokal gehostet, DSGVO) ---------- */
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/SourceSerif4-Variable.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg:            #FAF9F5;
  --bg-card:       #FFFFFF;
  --bg-tint:       #F0F2E8;
  --text:          #21201C;
  --text-muted:    #6E6C64;
  --border:        #E6E3DA;
  --primary:       #66783E;
  --primary-dark:  #4E5C2F;
  --leaf:          #8FA35B;
  --success:       #3E7A4E;
  --warn:          #A8722A;

  --font-serif: "Source Serif 4", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1080px;
  --maxw-text: 72ch;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(33, 32, 28, 0.06), 0 4px 16px rgba(33, 32, 28, 0.05);
}

/* ---------- Reset & Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.06rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--font-serif); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 2.4rem; margin: 0 0 0.6em; }
h2 { font-size: 1.7rem; margin: 2.2em 0 0.6em; }
h3 { font-size: 1.3rem; margin: 1.8em 0 0.5em; }
p, ul, ol { margin: 0 0 1.1em; }
small, .small { font-size: 0.88rem; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.prose { max-width: var(--maxw-text); }
.prose ul, .prose ol { padding-left: 1.3em; }
.muted { color: var(--text-muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Skip-Link ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 12px; top: 12px; z-index: 100; }

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 249, 245, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand-name span { color: var(--primary); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 10px; cursor: pointer; color: var(--text);
}
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: 0.97rem;
}
.site-nav a:hover { background: var(--bg-tint); color: var(--primary-dark); }
.site-nav a[aria-current="page"] { color: var(--primary-dark); font-weight: 600; }

@media (max-width: 840px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 64px;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 10px 20px 16px; }
  .site-nav a { padding: 11px 10px; }
}

/* ---------- Hero mit Wachstumslinie ---------- */
.hero { position: relative; padding: 64px 0 40px; overflow: hidden; }
.hero h1 { max-width: 21ch; }
.hero .lead { font-size: 1.18rem; max-width: 58ch; color: var(--text-muted); }
.hero-growth {
  position: absolute; right: -40px; bottom: 0; width: min(46vw, 520px); height: auto;
  pointer-events: none; opacity: 0.9;
}
@media (max-width: 900px) { .hero-growth { display: none; } }
.growth-path {
  fill: none; stroke: var(--leaf); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 1200; stroke-dashoffset: 1200;
  animation: grow 2.2s ease-out 0.3s forwards;
}
.growth-leaf { fill: var(--leaf); opacity: 0; animation: leaf-in 0.6s ease-out forwards; }
.growth-leaf.l1 { animation-delay: 1.1s; }
.growth-leaf.l2 { animation-delay: 1.5s; }
.growth-leaf.l3 { animation-delay: 1.9s; }
@keyframes grow { to { stroke-dashoffset: 0; } }
@keyframes leaf-in { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .growth-path { stroke-dashoffset: 0; }
  .growth-leaf { opacity: 1; }
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--primary); color: #fff;
  padding: 11px 20px; border: none; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background 0.15s;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--primary-dark);
  border: 1px solid var(--primary);
}
.btn-ghost:hover { background: var(--bg-tint); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  padding: 3px 10px; border-radius: 99px; line-height: 1.5; white-space: nowrap;
}
.badge-stand { background: var(--bg-tint); color: var(--primary-dark); }
.badge-live { background: #E4F0E7; color: var(--success); }
.badge-angekuendigt { background: var(--bg-tint); color: var(--primary-dark); }
.badge-erwartet { background: #F5EBDD; color: var(--warn); }
.badge-entwurf { background: #F5EBDD; color: var(--warn); }
.badge-offen, .badge-kein-angebot { background: #EFEEE9; color: var(--text-muted); }

/* ---------- Infobox ---------- */
.infobox {
  background: var(--bg-tint); border-radius: var(--radius);
  padding: 18px 20px; margin: 1.6em 0; max-width: var(--maxw-text);
}
.infobox strong:first-child { color: var(--primary-dark); }

/* ---------- Vergleichstabelle ---------- */
.table-wrap { margin: 1.5em 0; }
.vgl-table {
  width: 100%; border-collapse: collapse; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); font-size: 0.97rem;
}
.vgl-table th, .vgl-table td {
  padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.vgl-table thead th {
  background: var(--bg-tint); font-family: var(--font-sans); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary-dark);
}
.vgl-table tbody tr:last-child td { border-bottom: none; }
.vgl-table tbody tr:hover { background: #FCFBF8; }
.vgl-table .anbieter-name { font-weight: 600; }
.vgl-table .anbieter-name a { color: var(--text); text-decoration: none; }
.vgl-table .anbieter-name a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Mobil: Tabelle wird zu Cards (via vergleich.js doppelt gerendert) */
.vgl-cards { display: none; }
@media (max-width: 720px) {
  .table-wrap .vgl-table { display: none; }
  .vgl-cards { display: grid; gap: 14px; }
}
.anbieter-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.anbieter-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.anbieter-card h3 { margin: 0; font-size: 1.15rem; }
.anbieter-card h3 a { color: var(--text); text-decoration: none; }
.anbieter-card .hinweis { color: var(--text-muted); font-size: 0.92rem; margin: 6px 0 12px; }
.anbieter-card .card-cta { font-size: 0.95rem; font-weight: 600; }

/* ---------- FAQ-Accordion ---------- */
.faq { max-width: var(--maxw-text); margin: 1.5em 0; }
.faq details {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px; padding: 0 18px;
}
.faq summary {
  cursor: pointer; padding: 15px 0; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--font-serif); font-size: 1.4rem;
  color: var(--primary); line-height: 1; transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 16px; color: var(--text); }

/* ---------- Sektionen ---------- */
.section { padding: 40px 0; }
.section-tint { background: var(--bg-tint); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-tint .infobox { background: var(--bg-card); }

/* Karten-Grid (z. B. Ratgeber-Teaser) */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 1.5em 0; }
@media (max-width: 840px) { .grid-3 { grid-template-columns: 1fr; } }
.teaser {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.teaser h3 { margin: 0 0 8px; font-size: 1.18rem; }
.teaser h3 a { color: var(--text); text-decoration: none; }
.teaser h3 a:hover { color: var(--primary-dark); }
.teaser p { color: var(--text-muted); font-size: 0.97rem; flex: 1; }
.teaser .mehr { font-weight: 600; font-size: 0.95rem; }

/* Zulagen-Kacheln */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1.6em 0; }
@media (max-width: 720px) { .stat-row { grid-template-columns: 1fr; } }
.stat {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat .stat-num {
  font-family: var(--font-serif); font-size: 2rem; font-weight: 600;
  color: var(--primary-dark); font-variant-numeric: tabular-nums;
}
.stat .stat-label { color: var(--text-muted); font-size: 0.93rem; }

/* ---------- Breadcrumb & Meta ---------- */
.page-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 26px 0 6px; }
.breadcrumb { font-size: 0.88rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 64px; border-top: 1px solid var(--border);
  background: var(--bg-card); padding: 36px 0 28px;
  font-size: 0.92rem; color: var(--text-muted);
}
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
@media (max-width: 720px) { .footer-cols { grid-template-columns: 1fr; } }
.site-footer h2 { font-size: 1rem; font-family: var(--font-sans); font-weight: 600; color: var(--text); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary-dark); }
.footer-legal { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 0.85rem; }

/* ---------- Rechner ---------- */
.rechner {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin: 1.6em 0; max-width: 860px;
}
.rechner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
@media (max-width: 720px) { .rechner-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.field .hint { font-size: 0.83rem; color: var(--text-muted); margin-top: 4px; }
.field input[type="number"], .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; background: var(--bg); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.field input:focus, .field select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.field-check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.95rem; }
.field-check input { width: 18px; height: 18px; accent-color: var(--primary); }

.rechner-ergebnis { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }
.erg-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-variant-numeric: tabular-nums; }
.erg-row:last-of-type { border-bottom: none; }
.erg-row .erg-label { color: var(--text-muted); }
.erg-row.erg-total { font-weight: 700; font-size: 1.12rem; border-top: 2px solid var(--border); margin-top: 6px; padding-top: 12px; }
.erg-row.erg-total .erg-label { color: var(--primary-dark); }
.erg-quote { background: var(--bg-tint); border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 14px; font-size: 0.97rem; }

.chart-wrap { margin-top: 20px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.88rem; color: var(--text-muted); margin-top: 8px; }
.chart-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 6px; vertical-align: baseline; }

/* ---------- Kriterien-Matrix (so-vergleichen-wir) ---------- */
.kriterien-gewichte { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 1.4em 0; }
@media (max-width: 840px) { .kriterien-gewichte { grid-template-columns: repeat(2, 1fr); } }
.gewicht { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.gewicht .g-num { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; color: var(--primary-dark); }
.gewicht .g-label { font-size: 0.85rem; color: var(--text-muted); }

/* Status-Box auf Anbieterseiten */
.status-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin: 1.2em 0; box-shadow: var(--shadow); }

/* ---------- Anbieter-Kurzporträts (Startseite) ---------- */
.anbieter-abschnitte { max-width: none; columns: 2; column-gap: 32px; }
@media (max-width: 840px) { .anbieter-abschnitte { columns: 1; } }
.anbieter-abschnitt {
  break-inside: avoid; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin: 0 0 16px;
}
.anbieter-abschnitt h3 { margin: 0 0 8px; font-size: 1.1rem; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.anbieter-abschnitt p { margin: 0 0 8px; font-size: 0.97rem; }
.anbieter-abschnitt p:last-child { margin-bottom: 0; }
