/* Max Wagner & Sohn – Förderrechner. Marken-Tokens aus max-wagner.de. */

@font-face {
  font-family: 'Satoshi';
  src: url('../assets/fonts/satoshi-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../assets/fonts/satoshi-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('../assets/fonts/satoshi-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --rot: #c51d04;
  --rot-dunkel: #a21803;
  --amber: #f2ab27;
  --bordeaux: #430a14;
  --stahl: #5b6e8b;
  --stahl-hell: #758696;
  --tinte: #26292e;
  --flaeche-1: #f4f5f6;
  --flaeche-2: #edf0f3;
  --linie: #dfe3e7;
  --gruen: #1e6b3a;
  --gruen-flaeche: #e7f2ea;
  --amber-flaeche: #fbf1dc;
  --amber-text: #7a5410;
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --flamme: linear-gradient(135deg, var(--rot), var(--amber));
  color-scheme: light;
}

* { 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;
  font-family: 'Satoshi', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--tinte);
  background: #fff;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  color: var(--bordeaux);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--rot); }
a:hover { color: var(--rot-dunkel); }

.shell { max-width: 1160px; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

.sichtbar-versteckt {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  background: var(--bordeaux);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-s);
  transition: top 150ms ease;
}
.skip-link:focus-visible { top: 1rem; }

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

/* ---------- Knöpfe ---------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 100ms ease;
}
.knopf:active { transform: translateY(1px); }
.knopf-primaer { background: var(--rot); color: #fff; }
.knopf-primaer:hover { background: var(--rot-dunkel); color: #fff; }
.knopf-primaer:disabled { background: var(--stahl-hell); cursor: default; }
.knopf-sekundaer { background: #fff; color: var(--bordeaux); border-color: var(--linie); }
.knopf-sekundaer:hover { border-color: var(--stahl); color: var(--bordeaux); }

/* ---------- Kopf ---------- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linie);
}
.kopf-innen {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 72px;
}
.kopf-logo { flex-shrink: 0; display: inline-flex; }
.kopf-nav {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
}
.kopf-nav a {
  color: var(--tinte);
  text-decoration: none;
  font-weight: 500;
}
.kopf-nav a:hover { color: var(--rot); }
.kopf-telefon { min-height: 42px; padding-block: 0.4rem; }
@media (max-width: 760px) {
  .kopf-nav { display: none; }
  .kopf-telefon { margin-left: auto; }
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem); }
.hero-innen {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}
.hero-badge {
  display: inline-block;
  background: var(--amber-flaeche);
  color: var(--amber-text);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin: 0 0 1.1rem;
}
.hero-sub { font-size: 1.15rem; color: var(--stahl); max-width: 34rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.hero-bild { margin: 0; }
.hero-bild img {
  border-radius: var(--radius-l);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
@media (max-width: 860px) {
  .hero-innen { grid-template-columns: 1fr; }
  .hero-bild { order: -1; }
  .hero-bild img { aspect-ratio: 16 / 10; }
}

/* ---------- Vertrauen ---------- */

.vertrauen { background: var(--flaeche-1); padding-block: 1.6rem; }
.vertrauen-innen {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.vertrauen-innen > div {
  display: grid;
  gap: 0.15rem;
  padding-left: 1rem;
  border-left: 3px solid var(--rot);
}
.vertrauen-innen strong { color: var(--bordeaux); font-size: 1.05rem; }
.vertrauen-innen span { color: var(--stahl); font-size: 0.95rem; }
@media (max-width: 760px) {
  .vertrauen-innen { grid-template-columns: 1fr; gap: 1rem; }
}

/* ---------- Rechner ---------- */

.rechner { padding-block: clamp(3rem, 7vw, 5.5rem); }
/* Scroll-Ziele unter dem sticky Header (72px) freihalten */
#rechner, #rechner-ergebnis, .rechner-karte { scroll-margin-top: 88px; }
.rechner-kopfzeile { max-width: 46rem; margin-bottom: 2rem; }
.rechner-kopfzeile p { color: var(--stahl); }

.rechner-karte {
  background: #fff;
  border: 1px solid var(--linie);
  border-radius: var(--radius-l);
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  box-shadow: 0 20px 50px -30px rgb(67 10 20 / 0.25);
  max-width: 780px;
  margin-inline: auto;
}

.rechner-exit {
  display: none;
  align-items: center;
  min-height: 44px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--stahl);
  text-decoration: none;
}
.rechner-exit:hover { color: var(--rot); }
body.rechner-fokus .rechner-exit { display: inline-flex; }

.rechner-status { margin-bottom: 1.75rem; }
.rechner-status p { margin: 0.6rem 0 0; color: var(--stahl); font-weight: 500; font-size: 0.95rem; }
.fortschritt-spur {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--flaeche-2);
  overflow: hidden;
}
.fortschritt-balken {
  height: 100%;
  width: 10%;
  border-radius: 999px;
  background: var(--flamme);
  transition: width 300ms ease;
}

.frage-screen h3 {
  font-size: clamp(1.3rem, 2.6vw, 1.55rem);
  margin-bottom: 1rem;
}

.frage { margin-bottom: 2rem; }
.frage h3 { margin-bottom: 0.9rem; }
.frage-erklaerung { color: var(--stahl); font-size: 0.95rem; margin-top: -0.5rem; }
.frage-einschub {
  margin-top: 1.25rem;
  padding: 1.1rem 1.25rem;
  background: var(--flaeche-1);
  border-radius: var(--radius-m);
}
.frage-einschub h4 { margin-bottom: 0.4rem; }

.optionen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}
.optionen-schmal { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.optionen-raster { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

.option {
  position: relative;
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--linie);
  border-radius: var(--radius-m);
  cursor: pointer;
  background: #fff;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.option:hover { border-color: var(--stahl); }
.option:focus-within { outline: 3px solid var(--rot); outline-offset: 2px; }
.option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.option:has(input:checked) {
  border-color: var(--rot);
  background: #fdf3f1;
}
.option-titel { font-weight: 700; color: var(--bordeaux); }
.option-text { font-size: 0.9rem; color: var(--stahl); line-height: 1.45; }
.option-kompakt { padding-block: 0.75rem; }

.feld { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.feld label { font-weight: 700; color: var(--bordeaux); }
.feld input, .feld textarea {
  /* width/min-width: das native iOS-Datumsfeld hat eine Eigenbreite, die mit
     der Geräteschrift wächst; ohne min-width: 0 darf das Grid-Item nicht
     darunter schrumpfen und läuft rechts aus der Karte. */
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font: inherit;
  color: var(--tinte);
  background: #fff;
  border: 1.5px solid var(--linie);
  border-radius: var(--radius-s);
  padding: 0.7rem 0.9rem;
  min-height: 48px;
  width: 100%;
}
.feld textarea { min-height: auto; resize: vertical; }
/* iOS Safari: das native Datumsfeld erzwingt sonst seine Eigenbreite und
   ignoriert width/min-width — deshalb Aussehen abschalten, nur auf iOS. */
@supports (-webkit-touch-callout: none) {
  .feld input[type='date'] {
    -webkit-appearance: none;
    appearance: none;
    min-height: 2.9rem; /* iOS macht das Feld nach appearance:none sonst flach */
  }
  .feld input[type='date']::-webkit-date-and-time-value {
    text-align: left; /* Wert linksbündig wie alle anderen Felder */
    margin: 0;
  }
}
.feld input:hover, .feld textarea:hover { border-color: var(--stahl); }
.feld input:focus-visible, .feld textarea:focus-visible {
  outline: none;
  border-color: var(--rot);
  box-shadow: 0 0 0 3px rgb(197 29 4 / 0.15);
}
.feld input:disabled { background: var(--flaeche-1); color: var(--stahl-hell); }
.feld input[aria-invalid='true'] { border-color: var(--rot); }
.feld-reihe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 620px) { .feld-reihe { grid-template-columns: 1fr; } }
.feld-hint { color: var(--stahl); font-size: 0.9rem; margin: 0; }
.feld-hint.warnung { color: var(--amber-text); font-weight: 500; }
.feld-hint.positiv { color: var(--gruen); font-weight: 500; }
.feld-fehler {
  color: var(--rot-dunkel);
  font-size: 0.92rem;
  font-weight: 500;
  margin: 0.35rem 0 0;
}

.schnellwahl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.schnellwahl span { flex-basis: 100%; color: var(--stahl); font-size: 0.9rem; }
.schnellwahl button {
  font: inherit;
  font-weight: 700;
  color: var(--bordeaux);
  background: var(--flaeche-1);
  border: 1px solid var(--linie);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.schnellwahl button:hover { border-color: var(--stahl); background: var(--flaeche-2); }

.kontrollzeile {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
  margin-block: 0.75rem;
  font-size: 0.95rem;
  color: var(--stahl);
}
.kontrollzeile input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--rot);
  flex-shrink: 0;
}

.hinweisbox {
  background: var(--flaeche-1);
  border-radius: var(--radius-m);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.5rem;
}
.hinweisbox h3 { margin-bottom: 0.4rem; }
.hinweisbox .knopf { margin-top: 0.5rem; }
.hinweisbox.schmal { padding: 0.9rem 1.1rem; font-size: 0.95rem; color: var(--stahl); margin: 0 0 1.5rem; }

.schritt-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--linie);
}

/* ---------- Ergebnis ---------- */

#rechner-ergebnis .erg-vorspann {
  font-weight: 700;
  color: var(--stahl);
  margin-bottom: 0.2rem;
}
.erg-betrag {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bordeaux);
  margin: 0 0 0.3rem;
  font-variant-numeric: tabular-nums;
}
.erg-quote { color: var(--stahl); margin-bottom: 1.5rem; }

.erg-spanne-zeile { font-size: 0.92rem; color: var(--stahl); margin: -0.75rem 0 1.5rem; }

.erg-mfh {
  background: var(--gruen-flaeche);
  border-left: 4px solid var(--gruen);
  border-radius: var(--radius-s);
  padding: 0.9rem 1.1rem;
  margin: -0.5rem 0 1.5rem;
  font-size: 0.95rem;
  color: var(--tinte);
}
.erg-mfh strong { color: var(--gruen); }

.balken { margin-bottom: 1.5rem; }
.balken-spur {
  height: 1.1rem;
  border-radius: 999px;
  background: var(--flaeche-2);
  overflow: hidden;
}
.balken-fuellung {
  height: 100%;
  border-radius: 999px;
  background: var(--flamme);
  transition: width 400ms ease;
}
.balken-legende {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--stahl);
  font-variant-numeric: tabular-nums;
}
.balken-legende span:first-child { font-weight: 700; color: var(--bordeaux); }

.komponenten {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.komponente {
  border: 1px solid var(--linie);
  border-radius: var(--radius-m);
  padding: 0.9rem 1.1rem;
}
.komponente-kopf {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.komponente-name { font-weight: 700; color: var(--bordeaux); }
.komponente-wert { font-variant-numeric: tabular-nums; font-weight: 500; }
.status-chip {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
}
.status-sicher .status-chip { background: var(--gruen-flaeche); color: var(--gruen); }
.status-pruefen .status-chip { background: var(--amber-flaeche); color: var(--amber-text); }
.status-entfaellt {
  border-style: dashed;
  border-color: var(--linie);
}
.status-entfaellt .status-chip {
  background: none;
  padding: 0;
  font-weight: 500;
  color: var(--stahl-hell);
}
.status-entfaellt .komponente-name, .status-entfaellt .komponente-wert { color: var(--stahl-hell); }
.komponente-hinweis { font-size: 0.9rem; color: var(--stahl); margin: 0.5rem 0 0; }

.herleitung {
  border: 1px solid var(--linie);
  border-radius: var(--radius-m);
  margin-bottom: 1.5rem;
}
.herleitung summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--bordeaux);
  padding: 0.9rem 1.1rem;
  list-style-position: inside;
}
.herleitung summary:hover { color: var(--rot); }
.herleitung ol {
  margin: 0;
  padding: 0 1.25rem 1.1rem 2.4rem;
  color: var(--stahl);
  font-size: 0.95rem;
}
.herleitung li { margin-bottom: 0.4rem; }
.herleitung .komponenten { margin: 0; padding: 0 1.1rem 1.1rem; }
.herleitung .komponenten li { margin-bottom: 0; }
.pflichten-liste {
  margin: 0;
  padding: 0 1.25rem 1.1rem 2.4rem;
  color: var(--stahl);
  font-size: 0.95rem;
}

.erg-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1.25rem; }
.disclaimer { font-size: 0.85rem; color: var(--stahl-hell); margin: 0; }

/* ---------- Ablauf ---------- */

.ablauf { background: var(--flaeche-1); padding-block: clamp(3rem, 7vw, 5.5rem); }
.sektion-vorspann { color: var(--stahl); max-width: 40rem; margin-bottom: 2rem; }
.ablauf-liste {
  list-style: none;
  counter-reset: schritt;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.ablauf-liste li {
  counter-increment: schritt;
  background: #fff;
  border-radius: var(--radius-m);
  padding: 1.4rem 1.4rem 1.1rem;
  position: relative;
}
.ablauf-liste li::before {
  content: counter(schritt);
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--flamme);
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.ablauf-liste h3 { font-size: 1.08rem; margin-bottom: 0.3rem; }
.ablauf-liste p { color: var(--stahl); font-size: 0.95rem; margin: 0; }

/* ---------- Über uns ---------- */

.ueberuns { padding-block: clamp(3rem, 7vw, 5.5rem); }
.ueberuns-innen {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}
.ueberuns-bild { margin: 0; }
.ueberuns-bild img {
  border-radius: var(--radius-l);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.ueberuns-text p { color: var(--stahl); }
.ueberuns-text .knopf { margin-top: 0.5rem; }
@media (max-width: 860px) {
  .ueberuns-innen { grid-template-columns: 1fr; }
}

/* ---------- FAQ ---------- */

.faq { background: var(--flaeche-1); padding-block: clamp(3rem, 7vw, 5.5rem); }
.faq-innen { max-width: 50rem; }
.faq h2 { margin-bottom: 1.5rem; }
.faq details {
  background: #fff;
  border-radius: var(--radius-m);
  margin-bottom: 0.75rem;
  border: 1px solid transparent;
}
.faq details[open] { border-color: var(--linie); }
.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--bordeaux);
  padding: 1rem 1.25rem;
}
.faq summary:hover { color: var(--rot); }
.faq details p { padding: 0 1.25rem 1.1rem; margin: 0; color: var(--stahl); }

/* ---------- Anfrage im Ergebnis ---------- */

.erg-anfrage {
  background: var(--flaeche-1);
  border: 1.5px solid var(--amber);
  border-radius: var(--radius-l);
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
}
.erg-anfrage > p { color: var(--stahl); }
.erg-schritte {
  list-style: none;
  counter-reset: weiter-schritt;
  margin: 0 0 1.4rem;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.erg-schritte li {
  counter-increment: weiter-schritt;
  position: relative;
  padding-left: 2.5rem;
  color: var(--stahl);
  font-size: 0.97rem;
  line-height: 1.5;
}
.erg-schritte li::before {
  content: counter(weiter-schritt);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--flamme);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}
.erg-schritte strong { color: var(--bordeaux); }
.erg-anfrage .feld input, .erg-anfrage .feld textarea { background: #fff; }
.erg-anfrage .knopf { width: 100%; margin-top: 0.5rem; margin-bottom: 1rem; }
.formular-status { margin: 0.9rem 0 0; font-weight: 500; }
.formular-status.erfolg { color: var(--gruen); }
.formular-status.problem { color: var(--rot-dunkel); }

/* ---------- Kontakt (schlicht) ---------- */

.kontakt { padding-block: clamp(3rem, 7vw, 5.5rem); }
.kontakt-schlicht { max-width: 40rem; text-align: center; }
.kontakt-schlicht p { color: var(--stahl); }
.kontakt-wege {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-block: 1.5rem;
}
.kontakt-adresse { font-size: 0.95rem; }

/* ---------- Rechner-Fokus-Modus ---------- */
/* Blendet Ablenkung aus, sobald der Rechner die erste Frage beantwortet hat (siehe app.js aktiviereFokusModus). */

body.rechner-fokus .kopf-nav,
body.rechner-fokus .hero,
body.rechner-fokus .vertrauen,
body.rechner-fokus .rechner-kopfzeile,
body.rechner-fokus .ablauf,
body.rechner-fokus .ueberuns,
body.rechner-fokus .faq,
body.rechner-fokus .kontakt,
body.rechner-fokus .fuss {
  display: none;
}
body.rechner-fokus .rechner { padding-block-start: 1rem; }

/* ---------- Fuß ---------- */

.fuss { background: var(--bordeaux); color: #e9dfe2; padding-block: 2.5rem; }
.fuss a { color: #fff; }
.fuss-innen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.fuss-marke img { margin-bottom: 1rem; }
.fuss p { font-size: 0.95rem; margin-bottom: 0.5rem; }
.fuss-links { text-align: right; }
.fuss-disclaimer {
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.15);
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgb(233 223 226 / 0.7);
  max-width: 60rem;
}
@media (max-width: 760px) {
  .fuss-innen { grid-template-columns: 1fr; }
  .fuss-links { text-align: left; }
}
