/* ============================================================
   Wohnungsbewerbung — moderner 4-Schritte-Wizard, mobil-first.
   Farbwelt an ImmoVerwalter angelehnt (Teal-Akzent), standalone
   ohne Framework/Fonts lauffähig.
   ============================================================ */

:root {
  --ink:          #0f172a;
  --muted:        #5b6b7f;
  --line:         #e3e9f0;
  --line-strong:  #cdd7e1;
  --card:         #ffffff;
  --accent:       #0e8074;
  --accent-dark:  #0b6b61;
  --accent-lite:  #14a396;
  --accent-tint:  #e6f5f2;
  --accent-grad:  linear-gradient(135deg, #14a396 0%, #0e8074 55%, #0b6b61 100%);
  --ring:         0 0 0 4px rgba(20, 163, 150, .16);
  --danger:       #dc2626;
  --danger-soft:  #fef2f2;
  --success:      #16a34a;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow-card:  0 1px 2px rgba(15,23,42,.04), 0 12px 40px -12px rgba(15,23,42,.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: #f2f6f8;
}

/* Weicher Farbverlauf-Hintergrund */
.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(52rem 30rem at 110% -12%, rgba(20,163,150,.16), transparent 60%),
    radial-gradient(44rem 26rem at -18% 6%,  rgba(14,128,116,.12), transparent 55%),
    linear-gradient(180deg, #f6fafb 0%, #eef4f6 100%);
}

.shell {
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

/* ── Sprachumschalter ─────────────────────────────────────── */
.lang {
  display: flex; justify-content: flex-end; gap: 4px;
  margin: 0 0 10px;
}
.lang-btn {
  min-width: 42px;
  padding: 5px 10px;
  font-size: 12.5px; font-weight: 700; font-family: inherit;
  letter-spacing: .04em;
  color: var(--muted);
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.lang-btn:hover { border-color: var(--accent-lite); color: var(--ink); }
.lang-btn.is-active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.lang-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ── Kopf ──────────────────────────────────────────────────── */
.hero { text-align: center; margin-bottom: 22px; }
.hero-icon {
  width: 58px; height: 58px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  font-size: 28px;
  background: var(--accent-grad);
  border-radius: 18px;
  box-shadow: 0 10px 24px -8px rgba(14,128,116,.55);
}
/* Rechteckiges Foto-Banner OHNE Zoom: das ganze Foto wird eingepasst
   (contain), die Seitenflächen füllt eine weichgezeichnete Version
   desselben Fotos — kompakt wie ein Banner, nichts abgeschnitten. */
.hero-foto {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 14px 34px -14px rgba(15, 23, 42, .3);
  margin: 0 0 18px;
  background: #e8eef2;
}
.hero-foto-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(18px) saturate(1.05);
  transform: scale(1.15);   /* versteckt die Blur-Ränder */
  opacity: .85;
}
.hero-foto-img {
  position: relative;
  width: 100%; height: 100%;
  object-fit: contain;      /* ganzes Foto, kein Zuschnitt */
}
.hero-foto[hidden], .hero-icon[hidden] { display: none; }
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(23px, 6vw, 30px);
  letter-spacing: -.025em;
  line-height: 1.2;
}
.hero .sub { margin: 0; color: var(--muted); font-size: 15.5px; }

.optional { color: var(--muted); font-weight: 400; font-size: 13px; }

/* ── Karte ─────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 20px 24px;
}
@media (min-width: 560px) { .card { padding: 28px 32px 30px; } }

/* ── Fortschritt ───────────────────────────────────────────── */
.progress { margin-bottom: 22px; }
.progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 8px;
  font-size: 13px; color: var(--muted);
}
.progress-title { font-weight: 700; color: var(--ink); font-size: 15px; }
.progress-track {
  height: 6px; border-radius: 999px; background: #e6edf2; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 25%;
  border-radius: 999px;
  background: var(--accent-grad);
  transition: width .45s cubic-bezier(.22,.9,.36,1);
}

/* ── Schritte ──────────────────────────────────────────────── */
.step.anim { animation: stepIn .38s cubic-bezier(.22,.9,.36,1); }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
fieldset.field { margin-inline: 0; }

label, legend {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 8px;
}
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); font-weight: 400; }

input[type="text"], input[type="tel"], input[type="email"], input[type="number"], input[type="date"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;               /* verhindert iOS-Auto-Zoom */
  font-family: inherit;
  color: var(--ink);
  background: #fbfdfe;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  min-height: 52px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  appearance: none;
}
input::placeholder { color: #9aa8b6; }
input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: var(--ring);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; gap: 0; } }

/* ── Segmente (Ja/Nein, 1/2, un-/befristet) ────────────────── */
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg2 label { margin: 0; }
.seg2 input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
}
.seg2 span {
  display: grid; place-items: center;
  min-height: 52px;
  padding: 12px 8px;
  font-size: 15.5px; font-weight: 500;
  color: var(--ink);
  background: #fbfdfe;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.seg2 span:hover { border-color: var(--accent-lite); }
.seg2 input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px -6px rgba(14,128,116,.5);
}
.seg2 input:focus-visible + span { box-shadow: var(--ring); }

/* ── Auswahl-Karten (Einkommen) ────────────────────────────── */
.opts { display: grid; gap: 10px; }
.opt {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin: 0;
  min-height: 56px;
  padding: 14px 16px;
  font-weight: 500;
  background: #fbfdfe;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.opt:hover { border-color: var(--accent-lite); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-title { font-size: 16px; }
.opt-check {
  width: 24px; height: 24px; flex: none;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: border-color .15s, background .15s;
}
.opt-check::after {
  content: '';
  width: 11px; height: 6px;
  border-left: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}
.opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-tint);
  box-shadow: 0 4px 14px -6px rgba(14,128,116,.35);
}
.opt:has(input:checked) .opt-check {
  background: var(--accent); border-color: var(--accent);
}
.opt:has(input:checked) .opt-check::after { opacity: 1; }
.opt:has(input:focus-visible) { box-shadow: var(--ring); }

/* ── Personen-Stepper ──────────────────────────────────────── */
.stepper {
  display: flex; align-items: stretch; gap: 10px;
  max-width: 240px;
}
.stepper input {
  text-align: center;
  font-size: 19px; font-weight: 700;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn {
  width: 52px; flex: none;
  font-size: 24px; font-weight: 600; line-height: 1;
  color: var(--accent-dark);
  background: var(--accent-tint);
  border: 1.5px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.stepper-btn:hover { background: #d5efe9; }
.stepper-btn:active { transform: scale(.94); }
.stepper-btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ── Honeypot: aus dem Sichtfeld (nicht display:none) ──────── */
.hp {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* ── DSGVO ─────────────────────────────────────────────────── */
.dsgvo {
  background: #f5f8fa;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  margin: 20px 0 4px;
}
.dsgvo h3 { font-size: 14.5px; margin: 0 0 8px; }
.dsgvo p { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.consent {
  display: flex; gap: 12px; align-items: flex-start;
  font-weight: 500; font-size: 14.5px;
  cursor: pointer; margin: 0;
}
.consent input {
  width: 22px; height: 22px; margin: 1px 0 0; flex: none;
  accent-color: var(--accent);
}
.consent input:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

/* ── Navigation / Buttons ──────────────────────────────────── */
.nav { display: flex; gap: 10px; margin-top: 22px; }
.btn {
  min-height: 54px;
  padding: 14px 16px;
  font-size: 17px; font-weight: 700; font-family: inherit;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.985); }
.btn-primary {
  flex: 1;
  color: #fff;
  background: var(--accent-grad);
  border: 0;
  box-shadow: 0 10px 22px -8px rgba(14,128,116,.55);
}
.btn-primary:hover { box-shadow: 0 12px 26px -8px rgba(14,128,116,.65); }
.btn-primary:disabled { opacity: .65; cursor: default; transform: none; }
.btn-primary:focus-visible { outline: none; box-shadow: var(--ring), 0 10px 22px -8px rgba(14,128,116,.55); }
.btn-ghost {
  color: var(--muted);
  background: transparent;
  border: 1.5px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--accent-lite); color: var(--ink); }
.btn-ghost:focus-visible { outline: none; box-shadow: var(--ring); }

/* Sehr schmale Screens: Buttons stapeln (Primary oben) */
@media (max-width: 380px) {
  .nav { flex-direction: column-reverse; }
  .nav .btn { width: 100%; }
}

.error {
  background: var(--danger-soft);
  border: 1px solid #f3b9b9;
  border-radius: var(--r-sm);
  color: var(--danger);
  font-size: 14px;
  padding: 12px 14px;
  margin: 16px 0 0;
}

/* ── Gate / Danke ──────────────────────────────────────────── */
.gate { text-align: center; padding: 36px 24px; }
.gate-icon { font-size: 40px; margin-bottom: 10px; }
.gate h2 { margin: 0 0 6px; font-size: 20px; }
.gate p { margin: 0; color: var(--muted); }

.done { text-align: center; padding: 42px 24px 38px; }
.done h2 { margin: 14px 0 8px; font-size: 24px; letter-spacing: -.02em; }
.done p { margin: 0; color: var(--muted); font-size: 15.5px; }
.done-svg { width: 84px; height: 84px; }
.done-circle {
  stroke: var(--success); stroke-width: 4; stroke-linecap: round;
  stroke-dasharray: 202; stroke-dashoffset: 202;
  animation: draw .7s ease-out forwards;
}
.done-tick {
  stroke: var(--success); stroke-width: 5;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 42; stroke-dashoffset: 42;
  animation: draw .45s ease-out .55s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.foot {
  margin-top: 22px;
  text-align: center;
  font-size: 12.5px;
  color: #93a3b3;
}

/* ── Bewegung reduzieren ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}


/* ── Unterlagen-Upload (unterlagen.html) ───────────────────── */
.up-hello { margin: 0 0 16px; color: var(--muted); }
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 18px;
  text-align: center;
  background: #fbfdfe;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin: 0;
}
.drop:hover { border-color: var(--accent-lite); background: var(--accent-tint); }
.drop-icon { font-size: 26px; }
.drop-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.drop-hint { font-size: 13px; color: var(--muted); font-weight: 400; }

.up-liste { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.up-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 14px;
}
.up-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-item-size { color: var(--muted); font-size: 12.5px; flex: none; }
.up-item-del {
  flex: none; width: 26px; height: 26px;
  font-size: 18px; line-height: 1;
  color: var(--muted); background: transparent;
  border: 0; border-radius: 50%; cursor: pointer;
}
.up-item-del:hover { background: var(--danger-soft); color: var(--danger); }

/* ── Terminwahl (besichtigung.html) ─────────────────────────── */
.bs-tag { margin: 16px 0 8px; font-weight: 700; font-size: 15px; }
.bs-tag:first-child { margin-top: 0; }
.bs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.bs-slot {
  padding: 12px 6px;
  font: inherit; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--ink); background: #fbfdfe;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.bs-slot:hover:not(:disabled) { border-color: var(--accent-lite); }
.bs-slot.is-sel { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-dark); box-shadow: var(--ring); }
.bs-slot.is-taken { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.bs-slot-plaetze { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--muted); }
.bs-ort { margin: -6px 0 16px; font-size: 14px; color: var(--muted); }
.done .bs-ort { margin: 6px 0 0; }

/* Bestätigungs-Overlay vor der verbindlichen Buchung */
.bs-modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, .45);
}
.bs-modal[hidden] { display: none; }
.bs-modal-card {
  background: var(--card); border-radius: var(--r-md);
  box-shadow: var(--shadow-card); padding: 24px; max-width: 380px; width: 100%;
  text-align: center;
}
.bs-modal-title { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.bs-modal-slot {
  margin: 0 0 12px; font-size: 20px; font-weight: 700; color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}
