/* =========================================================================
   Rechify · style.css
   Zentrales Design-System (Single Source of Truth)
   Basiert auf: dokumente/Rechify-CI.md (Version 1.1)
   Motto: Klar rechnen. Sicher entscheiden.
   ========================================================================= */

/* -------------------------------------------------------- SCHRIFT (selbst gehostet)
   Inter wird lokal von unserem Server ausgeliefert – keine Google-Fonts-Anbindung,
   daher kein IP-Transfer an Google (DSGVO-freundlich). */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('../assets/fonts/inter-v20-latin-regular.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap; src:url('../assets/fonts/inter-v20-latin-500.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('../assets/fonts/inter-v20-latin-600.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('../assets/fonts/inter-v20-latin-700.woff2') format('woff2'); }

/* ---------------------------------------------------------------- TOKENS */
:root {
  /* --- Marke / Primär (Blau = Vertrauen) --- */
  --color-primary:        #2563EB;
  --color-primary-hover:  #1D4ED8;
  --color-primary-light:  #DBEAFE;

  /* --- Sekundär (Türkis = positive Ergebnisse) --- */
  --color-secondary:       #14B8A6;
  --color-secondary-light: #CCFBF1;

  /* --- Semantisch --- */
  --color-success: #16A34A;
  --color-warning: #F59E0B;
  --color-error:   #DC2626;

  /* --- Neutrale / Graustufen --- */
  --color-text:       #0F172A;  /* Haupttext   */
  --color-text-muted: #475569;  /* Sekundärtext */
  --color-border:     #CBD5E1;  /* Rahmen      */
  --color-bg:         #F8FAFC;  /* Hintergrund */
  --color-surface:    #FFFFFF;  /* Cards       */

  /* getönte Flächen für Boxen */
  --color-success-light: #DCFCE7;
  --color-warning-light: #FEF3C7;
  --color-error-light:   #FEE2E2;
  --color-neutral-light: #F1F5F9;

  /* --- Typografie --- */
  --font-base: 'Inter', system-ui, -apple-system, sans-serif;

  /* Responsive Typo-Skala (mobil lesbar → Desktop in normaler Website-Größe). */
  --text-h1: clamp(1.75rem,  1.42rem + 1.5vw,  2.125rem);  /* 28 → 34px */
  --text-h2: clamp(1.375rem, 1.20rem + 0.8vw,  1.6875rem); /* 22 → 27px */
  --text-h3: clamp(1.1875rem,1.09rem + 0.45vw, 1.375rem);  /* 19 → 22px */
  --text-h4: clamp(1.0625rem,1.01rem + 0.25vw, 1.125rem);  /* 17 → 18px */
  --text-body:  0.9375rem;   /* 15px */
  --text-small: 0.875rem;    /* 14px */

  --lh-body:    1.6;
  --lh-heading: 1.2;

  /* --- Form / Radius / Schatten --- */
  --radius:      16px;  /* Cards */
  --radius-md:   12px;
  --radius-sm:   10px;
  --radius-pill: 999px;

  --shadow-sm:    0 1px 2px rgba(15, 23, 42, .05);
  --shadow-card:  0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-hover: 0 6px 20px rgba(15, 23, 42, .09);

  /* --- Spacing-Skala --- */
  --space-1: 0.25rem;  /* 4  */
  --space-2: 0.5rem;   /* 8  */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.5rem;   /* 24 */
  --space-6: 2rem;     /* 32 */
  --space-7: 3rem;     /* 48 */
  --space-8: 4rem;     /* 64 */

  /* --- Container-Breiten (je Seitentyp, lt. CI) --- */
  --container-text:    820px;   /* Lesetext      750–850 */
  --container-wissen: 1500px;   /* Wissensseiten 1400–1600 */
  --container-hub:    1500px;   /* Hub-Seiten    1400–1600 */
  --container-rechner:1700px;   /* Rechnerseiten 1600–1800 */
  --container-start:  1600px;   /* Startseite    1600+    */

  /* --- Touch / Interaktion --- */
  --touch:       48px;  /* Mindesthöhe Buttons / Akkordeons (Mobile) */
  --control:     44px;  /* Höhe Inputs / Selects auf Desktop */
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: var(--lh-heading); font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); font-weight: 600; }
h4 { font-size: var(--text-h4); font-weight: 600; }
p  { text-wrap: pretty; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

/* Akzent-Trenner (z. B. zwischen H1 und Kurzantwort) — Brand Blau→Türkis */
.accent-rule { width: 56px; height: 4px; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  margin: var(--space-4) 0; border: none; }

:focus-visible { outline: 3px solid var(--color-primary-light); outline-offset: 2px; border-radius: 4px; }

/* messbarer Lesetext-Block */
.prose { max-width: var(--container-text); }
.prose p + p,
.prose p + ul,
.prose h2,
.prose h3 { margin-top: var(--space-5); }
.prose h2 { margin-top: var(--space-7); }

/* -------------------------------------------------------------- BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch);
  padding: 0 var(--space-5);
  font-family: var(--font-base);
  font-size: var(--text-small);
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn-primary   { background: var(--color-primary); color: #fff; }
.btn-primary:hover   { background: var(--color-primary-hover); text-decoration: none; }

.btn-secondary { background: var(--color-surface); color: var(--color-primary); border-color: var(--color-border); }
.btn-secondary:hover { border-color: var(--color-primary); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-neutral-light); color: var(--color-text); text-decoration: none; }

.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ----------------------------------------------------------- FORMULARE */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field > label { font-size: var(--text-small); font-weight: 600; color: var(--color-text); }
.field .hint  { font-size: 0.8125rem; color: var(--color-text-muted); }

.input, .select {
  width: 100%;
  min-height: var(--touch);
  padding: 0 var(--space-4);
  font-family: var(--font-base);
  font-size: var(--text-body);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.input::placeholder { color: #94A3B8; }

/* Eingabe mit Einheit (z. B. €) */
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit .input { padding-right: 3rem; }
.input-unit .unit {
  position: absolute; right: var(--space-4);
  font-size: var(--text-body); font-weight: 600; color: var(--color-text-muted);
  pointer-events: none;
}

.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--space-4) center; padding-right: 2.75rem;
}

/* ---------------------------------------------------------------- CARDS */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
}

/* anklickbare Übersichts-Cards (Rechner / Wissen) */
.link-card {
  display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.link-card:hover { box-shadow: var(--shadow-hover); border-color: #B6C2D4; transform: translateY(-2px); text-decoration: none; }
.link-card .lc-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: grid; place-items: center; flex: none;
}
.link-card.is-rechner .lc-icon { background: var(--color-primary-light);  color: var(--color-primary); }
.link-card.is-wissen  .lc-icon { background: var(--color-secondary-light); color: #0D9488; }
.link-card h4 { color: var(--color-text); }
.link-card p  { font-size: var(--text-small); color: var(--color-text-muted); }
.link-card .lc-cta { margin-top: auto; font-size: var(--text-small); font-weight: 600; color: var(--color-primary); display: inline-flex; align-items: center; gap: 6px; }

/* --------------------------------------------------------- HINWEIS-BOXEN */
.box {
  border: 1px solid;
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: var(--space-5);
  display: flex; gap: var(--space-4);
}
.box .box-icon { flex: none; width: 24px; height: 24px; }
.box .box-body { display: flex; flex-direction: column; gap: var(--space-2); }
.box .box-title { font-weight: 700; font-size: var(--text-body); }
.box p { font-size: var(--text-small); }

.box-info    { background: var(--color-primary-light);  border-color: #BFDBFE; color: #1E3A8A; }
.box-success { background: var(--color-success-light);  border-color: #BBF7D0; color: #14532D; }
.box-warning { background: var(--color-warning-light);  border-color: #FDE68A; color: #78350F; }
.box-error   { background: var(--color-error-light);    border-color: #FECACA; color: #7F1D1D; }
.box-source  { background: var(--color-neutral-light);  border-color: #E2E8F0; color: var(--color-text-muted); }
.box-info .box-icon    { color: var(--color-primary); }
.box-success .box-icon { color: var(--color-success); }
.box-warning .box-icon { color: #D97706; }
.box-error .box-icon   { color: var(--color-error); }
.box-source .box-icon  { color: #64748B; }

/* Definitionsbox (GEO) */
.definition {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.definition .def-term { font-weight: 700; font-size: var(--text-body); margin-bottom: var(--space-1); }
.definition p { color: var(--color-text-muted); }

/* Kurzantwort (direkt unter H1, GEO) */
.lede { font-size: var(--text-body); line-height: 1.6; color: var(--color-text-muted); max-width: var(--container-text); }

/* ----------------------------------------------------------- ERGEBNISBOX */
.result {
  background: linear-gradient(125deg, var(--color-primary) 0%, var(--color-primary) 30%, #0EA5A4 100%);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  color: #fff;
}
.result .result-label { font-size: var(--text-small); font-weight: 600; color: rgba(255,255,255,.85); text-transform: uppercase; letter-spacing: .04em; }
.result .result-value { font-size: clamp(2.5rem, 1.5rem + 4vw, 3.5rem); font-weight: 700; letter-spacing: -.03em; color: #fff; line-height: 1.05; margin: var(--space-2) 0; }
.result .result-value .cur { color: rgba(255,255,255,.7); font-weight: 600; }
.result .result-note { font-size: var(--text-small); color: rgba(255,255,255,.82); }
.result-grid { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.result-grid .row { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-top: 1px solid rgba(255,255,255,.22); }
.result-grid .row b { font-weight: 600; }

/* ----------------------------------------------------------- BREADCRUMB */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-small); color: var(--color-text-muted); }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb .sep { color: #94A3B8; }
.breadcrumb [aria-current="page"] { color: var(--color-text); font-weight: 600; }

/* ----------------------------------------------------- VERGLEICHSTABELLE */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow-card); background: var(--color-surface); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-small); }
table.data th, table.data td { text-align: left; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-border); }
table.data thead th { background: var(--color-neutral-light); font-weight: 600; color: var(--color-text); white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #FAFBFC; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------- FAQ-AKKORDEON */
.faq { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; background: var(--color-surface); box-shadow: var(--shadow-card); }
.faq details { border-bottom: 1px solid var(--color-border); }
.faq details:last-child { border-bottom: none; }
.faq summary {
  list-style: none; cursor: pointer;
  min-height: var(--touch);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  font-weight: 600; font-size: var(--text-body); color: var(--color-text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { flex: none; width: 22px; height: 22px; color: var(--color-text-muted); transition: transform .2s ease; }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq summary:hover { color: var(--color-primary); }
.faq .faq-body { padding: 0 var(--space-5) var(--space-5); color: var(--color-text-muted); font-size: var(--text-small); }

/* ------------------------------------------------------ TRUST / META-ZEILE */
.meta-row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; font-size: 0.875rem; color: var(--color-text-muted); }
.meta-row .meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-row .meta-item svg { width: 16px; height: 16px; color: #94A3B8; }

/* -------------------------------------------------------------- AD-SLOT */
.ad-slot {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(135deg, #fff, #fff 10px, #FAFBFC 10px, #FAFBFC 20px);
  color: #94A3B8;
  font-size: 0.8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  display: grid; place-items: center;
  min-height: 90px;
}
/* ⚠️ WERBUNG NOCH NICHT AKTIV — alle „Anzeige"-Platzhalter sind sitenweit ausgeblendet.
   ERINNERUNG: Sobald Google AdSense freigegeben ist, diese eine Regel entfernen
   und die .ad-slot-Boxen mit dem echten <ins class="adsbygoogle">-Code füllen. */
.ad-slot { display: none !important; }

/* ============================================================ SITE-HEADER
   Globale, sticky Kopf-Navigation. Markup identisch auf allen Seiten;
   relative Pfade werden je Seitentiefe gesetzt. */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--color-border); }
.site-header-in { position: relative; max-width: var(--container-rechner); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); height: 60px; display: flex; align-items: center; gap: clamp(16px, 4vw, 40px); }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 19px; letter-spacing: -.02em; color: var(--color-text); flex: none; }
.brand:hover { text-decoration: none; }
.brand .brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--color-primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }

.site-nav { display: flex; align-items: center; gap: 2px; position: absolute; left: 50%; transform: translateX(-50%); }
.nav-item { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; height: 60px; padding: 0 14px; font: 600 var(--text-small)/1 var(--font-base); color: var(--color-text); background: none; border: none; cursor: pointer; letter-spacing: -.01em; }
.nav-link:hover { color: var(--color-primary); text-decoration: none; }
.nav-link .nav-chev { width: 15px; height: 15px; color: var(--color-text-muted); transition: transform .2s ease; }
.nav-item.is-open .nav-link .nav-chev { transform: rotate(180deg); }
.nav-link.is-soon { color: #94A3B8; cursor: default; }
.nav-link.is-soon:hover { color: #94A3B8; }
.soon-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-muted); background: var(--color-neutral-light); border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 2px 6px; }

/* Dropdown */
.nav-menu { position: absolute; top: calc(100% - 6px); left: 0; min-width: 280px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-hover); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: transform .16s ease; }
.nav-item.is-open .nav-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu-head { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); padding: 8px 10px 6px; }
.nav-menu a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm); font-size: var(--text-small); font-weight: 500; color: var(--color-text); }
.nav-menu a:hover { background: var(--color-neutral-light); color: var(--color-primary); text-decoration: none; }
.nav-menu a svg { width: 16px; height: 16px; color: var(--color-primary); flex: none; }
.nav-menu .nav-menu-all { margin-top: 4px; border-top: 1px solid var(--color-border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-weight: 600; color: var(--color-primary); }

.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; align-items: center; justify-content: center; background: none; border: 1px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer; color: var(--color-text); }
.nav-toggle svg { width: 22px; height: 22px; }

/* Mobile Drawer */
/* Hinweis: Header hat backdrop-filter → wird Bezugsrahmen für position:fixed.
   Daher hier explizite Viewport-Höhe (100dvh) statt inset/bottom, sonst würde
   der Drawer auf die ~60px Header-Höhe eingesperrt. */
.nav-scrim { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; background: rgba(15,23,42,.45); z-index: 60; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease; }
.nav-drawer { position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: min(320px, 86vw); background: var(--color-surface); z-index: 61; box-shadow: -8px 0 30px rgba(15,23,42,.18); transform: translateX(100%); transition: transform .24s ease; display: flex; flex-direction: column; padding: 18px; overflow-y: auto; }
body.nav-open .nav-drawer { transform: translateX(0); visibility: visible; }
body.nav-open .nav-scrim { opacity: 1; visibility: visible; pointer-events: auto; }
.nav-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.nav-drawer-close { width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 1px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer; color: var(--color-text); }
.nav-drawer-close svg { width: 20px; height: 20px; }
.nav-drawer .dw-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); padding: 18px 8px 6px; }
.nav-drawer a { display: flex; align-items: center; gap: 10px; padding: 12px 8px; border-radius: var(--radius-sm); font-size: var(--text-body); font-weight: 500; color: var(--color-text); }
.nav-drawer a:hover { background: var(--color-neutral-light); text-decoration: none; }
.nav-drawer a svg { width: 17px; height: 17px; color: var(--color-primary); flex: none; }
.nav-drawer .dw-soon { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px; font-size: var(--text-body); font-weight: 500; color: #94A3B8; }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (min-width: 861px) { .nav-scrim, .nav-drawer { display: none; } }

/* =========================================================== SITE-FOOTER */
.site-footer { border-top: 1px solid var(--color-border); background: var(--color-surface); margin-top: var(--space-8); }
.site-footer-in { max-width: var(--container-rechner); margin: 0 auto; padding: clamp(36px, 5vw, 56px) clamp(16px, 4vw, 40px) 28px; }
.footer-cols { display: grid; gap: 32px 28px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .footer-cols { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-brand .brand { font-size: 18px; }
.footer-brand p { color: var(--color-text-muted); font-size: var(--text-small); margin-top: 12px; max-width: 32ch; }
.footer-col h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 14px; }
.footer-col a { display: block; padding: 6px 0; font-size: var(--text-small); color: var(--color-text); }
.footer-col a:hover { color: var(--color-primary); }
.footer-base { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: 13px; }

/* reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---- Desktop: kompaktere Steuerelemente (Maus statt Touch) ---- */
@media (min-width: 880px) {
  .input, .select { min-height: var(--control); }
  .btn { min-height: var(--control); }
}
