/* FinanzHub — Onboarding Wizard
   Vollbild-Overlay, Karten-Stil unten, Progress-Bar oben.
   Optisch an YNAB angelehnt, aber im FinanzHub-Dunkel-Theme. */

.fh-onb-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Mobile dynamic viewport: dvh folgt der Toolbar/Keyboard, vh ist statisch.
     Beide setzen, neuere Browser nehmen dvh, ältere fallen auf vh zurück. */
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, #0a0a0c 0%, #14131a 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui, system-ui);
  animation: fhOnbFadeIn .3s ease;
  /* Mobile: wenn Inhalt höher als Viewport, scrollen statt abschneiden */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* `none` (statt `contain`) verhindert dass Scroll am Edge ans body bubbelt —
     auf Mobile zeigt sich sonst die App unter dem Overlay beim Tippen/Scrollen. */
  overscroll-behavior: none;
  /* iOS Double-Tap-Zoom blocken — sonst zoomt iOS bei Doppel-Tap rein und
     der User sieht App-Bereiche außerhalb des Overlay-Footprints. Pinch-Zoom
     bleibt erhalten (Accessibility, WCAG 1.4.4). */
  touch-action: manipulation;
  /* iPhone-Home-Indicator nicht überdecken */
  padding-bottom: env(safe-area-inset-bottom);
}

/* touch-action explizit auf interaktive Kinder — iOS Safari respektiert
   Inheritance bei Touch-Gesten unzuverlässig wenn das Element selbst keinen
   Wert hat (siehe MDN: touch-action notes für Safari). */
.fh-onb-overlay button,
.fh-onb-overlay input,
.fh-onb-overlay label,
.fh-onb-overlay .fh-onb-opt,
.fh-onb-overlay .fh-onb-input,
.fh-onb-overlay .fh-onb-card {
  touch-action: manipulation;
}

/* ── iOS Auto-Zoom-Schutz für Onboarding-Inputs ──────────────────────────
   iOS Safari zoomt beim Fokus in JEDES Input mit <16px Schriftgröße hinein.
   Dabei verrutscht das position:fixed-Overlay gegenüber dem (gezoomten)
   Visual-Viewport → die App schimmert an den Rändern durch ("beim Namen
   eingeben sieht man Teile der Website").
   Ursache: navy.css setzt per hoch-spezifischem Selektor global
   var(--text-body)=15px und überschreibt damit die 16px der Onboarding-
   Inputs (Name, Einkommen, Vermögen). Hier mit !important auf ≥16px
   zurückholen — das verhindert den Zoom komplett. */
.fh-onb-overlay input,
.fh-onb-overlay .fh-onb-input { font-size: 16px !important; }

/* Wenn das Onboarding läuft: Body komplett locken, damit Scroll/Touch nicht
   durchsickert. Wird in onboarding.js per Klasse getoggelt. */
body.fh-onb-open {
  overflow: hidden;
  /* iOS-Quirk: nur overflow:hidden reicht nicht — touch-action und position
     verhindern Bouncy-Scroll der untergeordneten App. */
  touch-action: none;
}
.fh-onb-overlay.is-closing { animation: fhOnbFadeOut .35s ease forwards; }
@keyframes fhOnbFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fhOnbFadeOut { from { opacity: 1; } to { opacity: 0; transform: translateY(20px); } }

/* Progress-Bar */
.fh-onb-progress {
  height: 4px;
  background: rgba(255, 255, 255, .06);
  width: 100%;
}
.fh-onb-progress-fill {
  height: 100%;
  background: #FFFFFF;
  transition: width .35s ease;
}

/* Karte */
.fh-onb-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 60px 40px 28px;
  position: relative;
}
@media (max-width: 720px) {
  .fh-onb-card { padding: 40px 22px 22px; }
}

/* Welcome-Page mit Illustration links + Content rechts */
.fh-onb-card:has(.fh-onb-illustration) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 720px) {
  .fh-onb-card:has(.fh-onb-illustration) {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.fh-onb-illustration {
  border-radius: 16px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.fh-onb-illu-green {
  background: linear-gradient(135deg, #1C1C1C 0%, #2C2C2C 70%);
}
.fh-onb-illu-emoji {
  font-size: clamp(80px, 14vw, 140px);
  line-height: 1;
  position: relative;
  z-index: 2;
}
.fh-onb-illu-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: rgba(255, 255, 255, .08);
  border-radius: 100% 100% 0 0 / 100% 100% 0 0;
}
.fh-onb-illu-emoji-lg {
  font-size: clamp(72px, 12vw, 110px);
  text-align: center;
  margin-bottom: 24px;
}

/* Content */
.fh-onb-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fh-onb-content-wide { width: 100%; max-width: 720px; margin: 0 auto; }
.fh-onb-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.fh-onb-title {
  font-family: var(--font-display, 'Inter', system-ui);
  font-size: clamp(24px, 3.4vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  color: #fafaf7;
  margin: 0;
  letter-spacing: -.015em;
}
.fh-onb-title-center { text-align: center; }
.fh-onb-sub {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .65);
  margin: 0 0 16px;
}
.fh-onb-sub-center { text-align: center; margin: 8px auto 24px; max-width: 520px; }

/* Name-Input */
.fh-onb-input-lbl {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin: 16px 0 6px;
}
.fh-onb-input {
  width: 100%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 14px 18px;
  color: #fafaf7;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, background .15s;
}
.fh-onb-input:focus {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255, 255, 255, .08);
}
.fh-onb-input::placeholder { color: rgba(255, 255, 255, .35); }

/* Options */
.fh-onb-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}
.fh-onb-options.cols-2 {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 640px) {
  .fh-onb-options.cols-2 { grid-template-columns: 1fr; }
}

.fh-onb-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  padding: 14px 18px;
  color: #fafaf7;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
  text-align: left;
  position: relative;
}
.fh-onb-opt:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .18);
}
.fh-onb-opt:active {
  transform: scale(0.98);
}
.fh-onb-opt.is-selected {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .85);
}
.fh-onb-opt-glyph {
  flex-shrink: 0;
  display: inline-flex;
  width: 22px;
  justify-content: center;
  color: rgba(255, 255, 255, .5);
}
.fh-onb-opt-glyph svg { width: 18px; height: 18px; }
.fh-onb-opt.is-selected .fh-onb-opt-glyph { color: #fff; }
.fh-onb-opt-lbl { flex: 1; }
.fh-onb-opt-check {
  color: #FFFFFF;
  font-weight: 700;
  font-size: 16px;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .15s, transform .15s;
}
.fh-onb-opt.is-selected .fh-onb-opt-check {
  opacity: 1;
  transform: scale(1);
}

/* Income input mit €-Suffix */
.fh-onb-income-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  padding: 4px 18px 4px 4px;
  transition: border-color .15s, background .15s;
}
.fh-onb-income-input:focus-within {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255, 255, 255, .08);
}
.fh-onb-income-input .fh-onb-input {
  border: 0;
  background: transparent;
  padding: 14px 14px;
  font-size: 22px;
  font-weight: 600;
  -moz-appearance: textfield;
}
.fh-onb-income-input .fh-onb-input::-webkit-outer-spin-button,
.fh-onb-income-input .fh-onb-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.fh-onb-income-unit {
  font-size: 20px;
  font-weight: 500;
  color: rgba(255, 255, 255, .55);
  flex-shrink: 0;
}
.fh-onb-privacy {
  font-size: 12px;
  color: rgba(255, 255, 255, .35);
  margin: 24px 0 0;
  text-align: center;
}

/* "Keins davon trifft zu" Link */
.fh-onb-none {
  display: block;
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  margin: 24px auto 0;
  padding: 8px 16px;
  text-decoration: none;
  transition: color .15s;
}
.fh-onb-none:hover { color: #fff; text-decoration: underline; }

/* Foot */
.fh-onb-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 28px;
  gap: 12px;
}
.fh-onb-back, .fh-onb-next {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.fh-onb-back {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .8);
}
.fh-onb-back:hover { background: rgba(255, 255, 255, .12); }
.fh-onb-next {
  background: #FFFFFF;
  color: #060606;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.fh-onb-next:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
  transform: translateY(-1px);
}
.fh-onb-next:active { transform: translateY(0); }

/* Skip-Button oben rechts — User kann Wizard sofort dismissen. */
.fh-onb-skip {
  position: fixed;
  top: 18px;
  right: 22px;
  font: 600 12.5px/1 Manrope, Inter, sans-serif;
  letter-spacing: .02em;
  color: rgba(250, 250, 247, .58);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .12);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  z-index: 10001;
  font-family: inherit;
}
.fh-onb-skip:hover {
  color: rgba(250, 250, 247, .98);
  border-color: rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .05);
}
@media (max-width: 720px) {
  .fh-onb-skip {
    top: 12px;
    right: 12px;
    font-size: 11.5px;
    padding: 7px 12px;
  }
}

/* ───── F-Logo im Welcome (statt Baum-Emoji) ───── */
.fh-onb-brand-mark {
  font-family: var(--font-display, 'Inter', system-ui);
  font-weight: 800;
  font-size: clamp(72px, 12vw, 120px);
  color: #fafaf7;
  line-height: 1;
}

/* ───── Situation: Sektion-Labels + Pills (Wohnen / Transport) ───── */
.fh-onb-section-lbl {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255, 255, 255, .5); margin: 14px 0 10px; text-align: left;
}
.fh-onb-section-lbl-2 { margin-top: 20px; }
.fh-onb-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.fh-onb-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px;
  font-size: 13px; font-family: inherit; color: rgba(255, 255, 255, .7); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.fh-onb-pill:hover { background: rgba(255, 255, 255, .09); }
.fh-onb-pill.selected {
  border-color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .12); color: #fff;
}
.fh-onb-pill-icon svg { width: 15px; height: 15px; flex: none; opacity: .8; }
.fh-onb-pill-icon.selected svg { opacity: 1; }

/* ───── Einkommen: Sparquoten-Preview ───── */
.fh-onb-spar-preview {
  margin-top: 14px; padding: 12px 16px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px; font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .7);
}
.fh-onb-spar-preview strong { color: #fff; font-weight: 600; }
.fh-onb-spar-preview[hidden] { display: none; }

/* ───── Vermögen-Quickstart ───── */
.fh-onb-wealth-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 8px; }
@media (max-width: 640px) { .fh-onb-wealth-grid { grid-template-columns: 1fr; } }
.fh-onb-wealth-field { display: flex; flex-direction: column; gap: 6px; }
.fh-onb-wealth-lbl { font-size: 12px; color: rgba(255, 255, 255, .6); }
.fh-onb-wealth-inp {
  display: flex; align-items: center;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px; padding: 0 12px 0 14px;
  transition: border-color .15s;
}
.fh-onb-wealth-inp:focus-within { border-color: rgba(255, 255, 255, .4); }
.fh-onb-wealth-inp input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  color: #fafaf7; font-size: 16px; font-family: inherit; padding: 12px 0;
  -moz-appearance: textfield;
}
.fh-onb-wealth-inp input::-webkit-outer-spin-button,
.fh-onb-wealth-inp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fh-onb-wealth-unit { color: rgba(255, 255, 255, .5); font-size: 14px; flex-shrink: 0; }

.fh-onb-alloc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fh-onb-alloc:empty { display: none; }
.fh-onb-alloc-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 20px; font-size: 12.5px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums;
}
.fh-onb-alloc-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.fh-onb-alloc-pill.cash .dot { background: #4ADE80; }
.fh-onb-alloc-pill.inv  .dot { background: #fff; }
.fh-onb-alloc-pill.debt .dot { background: #F87171; }

/* ───── Abschluss: Check + Feature-Pills + Kalender-Hinweis ───── */
.fh-onb-finish-check {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(74, 222, 128, .14); color: #4ADE80; margin-bottom: 20px;
}
.fh-onb-feature-pills { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 20px 0 4px; }
.fh-onb-feat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px; font-size: 13px; color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
}
.fh-onb-feat svg { color: #4ADE80; }
.fh-onb-cal-hint {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 16px; background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px;
  margin-top: 20px; max-width: 460px; text-align: left;
}
.fh-onb-cal-hint-ico { color: rgba(255, 255, 255, .6); flex-shrink: 0; display: inline-flex; }
.fh-onb-cal-hint-text { flex: 1; }
.fh-onb-cal-hint-title { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .9); }
.fh-onb-cal-hint-sub { font-size: 12px; color: rgba(255, 255, 255, .55); margin-top: 2px; }
.fh-onb-cal-hint-link { font-size: 12px; color: rgba(255, 255, 255, .5); flex-shrink: 0; white-space: nowrap; }
