/* Leadformular / Funnel-Baukasten (foodtruck-leadformular-spec.md,
   portal-spec.md §3). Baut auf tokens.css/base.css/components.css auf —
   hier nur das, was für einen Frage-pro-Screen-Flow zusätzlich nötig ist. */

/* Startseite mit CTA (portal-spec.md §3) — bleibt sichtbar, bis auf "Anfrage
   starten" geklickt wird; das eigentliche Formular ist bis dahin ausgeblendet. */
.fx-landing { flex: 1; display: flex; flex-direction: column; }
.fx-landing.is-hidden { display: none; }
.fx-landing .fx-shell { flex: 1; max-width: 680px; justify-content: center; text-align: center; }
.fx-landing .fx-question { font-size: clamp(32px, 8vw, 48px); }
/* "Häufige Fragen" unter dem Einstieg: auf dem Handy direkt unter dem Hero, damit die Überschrift schon ohne Scrollen zu sehen ist. */
.fx-landing-faq { margin-top: 48px; width: 100%; }
@media (min-width: 900px) { .fx-landing-faq { margin-top: 120px; } }
.fx-landing-badges { margin-top: 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; }
.fx-landing-badges span { display: inline-flex; align-items: center; gap: 8px; font: var(--weight-medium) var(--fs-body-sm) / 1 var(--font-core); color: var(--text-secondary); }
.fx-landing-badges svg { color: var(--blue-dark); flex: none; }

.funnel-form { display: none; flex-direction: column; min-height: 0; }
.funnel-form.is-open { display: flex; flex: 1; }

.funnel-topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.funnel-progress-track { height: 3px; background: var(--cloud); }
.funnel-progress-fill { height: 100%; width: 0%; background: var(--blue-bright); transition: width var(--dur-slow) var(--ease-standard); }
.funnel-nav {
  height: 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 8px;
}
.funnel-back {
  justify-self: start; display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px;
  border: none; background: none; cursor: pointer; visibility: hidden;
  font: var(--weight-medium) var(--fs-body) / 1 var(--font-core); color: var(--blue-bright);
}
.funnel-back.is-visible { visibility: visible; }
.funnel-back:hover { color: var(--blue-dark); }
.funnel-step-label { text-align: center; font: var(--weight-regular) var(--fs-caption) / 1 var(--font-core); color: var(--text-muted); font-variant-numeric: tabular-nums; }

.fx-step { display: none; }
.fx-step.is-active { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.fx-shell {
  flex: 1; width: 100%; max-width: 560px; margin: 0 auto; box-sizing: border-box;
  padding: 40px 16px 40px; display: flex; flex-direction: column;
}
.fx-shell.has-continue { padding-bottom: 140px; }

.fx-question {
  margin: 0; text-align: center; font: var(--weight-medium) clamp(26px, 6.5vw, 34px) / 1.15 var(--font-core);
  letter-spacing: var(--ls-h1);
}
.fx-hint { margin: 10px 0 0; text-align: center; color: var(--text-secondary); font: var(--weight-regular) var(--fs-body) / 1.5 var(--font-core); }

.fx-body { margin-top: 32px; display: flex; flex-direction: column; gap: 20px; }

/* Große Kacheln für den Einstieg (Frage 1) — größere Touch-Ziele als im Portal */
.tile-lg .tile-card { }
.tile-lg .tile-thumb { aspect-ratio: 1 / 1; }
.tile-lg .tile-foot { padding: 16px; }
.tile-lg .tile-label { font: var(--weight-medium) var(--fs-body) / 1.3 var(--font-core); }
/* Schmale Handys (z. B. iPhone 390 px): sonst bricht "Weihnachtsfeier" mitten im Wort. */
@media (max-width: 430px) {
  .tile-lg .tile-foot { padding: 14px 12px; gap: 8px; }
  .tile-lg .tile-label { font-size: 15px; letter-spacing: -0.01em; }
}

.fx-continue-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--white);
  border-top: 1px solid var(--line-subtle); padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
}
.fx-continue-inner { max-width: 520px; margin: 0 auto; display: flex; }
.fx-continue-bar { background: rgba(255, 255, 255, .92); border-top-color: var(--line); box-shadow: 0 -8px 24px rgba(23, 23, 23, .10); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .fx-continue-bar { background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); }
}

.fx-error { margin: 16px 0 0; padding: 12px 14px; background: var(--danger-bg, #FDECEC); color: var(--danger); font: var(--weight-medium) var(--fs-body-sm) / 1.4 var(--font-core); text-align: center; }

/* Einzugsgebiet-Karte (portal/vervollstaendigen.php) — reine Visualisierung
   zu PLZ + Radius-Slider, daher fest und ohne Pan/Zoom-Bedienelemente. */
.fx-map { margin-top: 16px; width: 100%; height: 220px; background: var(--cloud); border: 1px solid var(--line); }

.fx-thanks { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 40px 20px; }
.fx-thanks-icon { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: var(--success-bg); color: var(--success); }

/* SMS-Bestätigung der Handynummer (siehe smsVerifyStep() in src/helpers.php) */
.fx-hint strong { color: var(--ink); font-weight: var(--weight-medium); }
/* Gleiches Aussehen wie das Code-Feld im E-Mail-Login (.code-digits input in portal.css) */
.field input.sms-code-input { box-sizing: border-box; width: 100%; height: 60px; padding: 0 0 0 .5em; background: var(--white); border: 1px solid var(--line); text-align: center; letter-spacing: .5em; font: var(--weight-medium) var(--fs-h2) / 1 var(--font-core); font-variant-numeric: tabular-nums; }
.sms-resend { margin: 16px 0 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font: var(--weight-regular) var(--fs-caption) / 1.4 var(--font-core); color: var(--text-secondary); }
.sms-resend .btn { margin-top: 4px; padding: 14px 28px; }
.sms-resend span:empty { display: none; }
/* Aufklappbare Hilfe unter dem SMS-Code im Veranstalter-Fragebogen (Gegenstück zu .code-help im Betreiber-Login) */
.sms-acc-list { display: flex; flex-direction: column; gap: 12px; }
.sms-acc { background: var(--white); border: 1px solid var(--line); text-align: left; }
.sms-acc summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; font: var(--weight-medium) var(--fs-body-sm) / 1.35 var(--font-core); color: var(--ink); }
.sms-acc summary::-webkit-details-marker { display: none; }
.sms-acc summary:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.sms-acc summary svg { flex: none; color: var(--graphite); transition: transform 180ms cubic-bezier(.2, 0, 0, 1); }
.sms-acc[open] summary svg { transform: rotate(45deg); }
.sms-acc-body { padding: 0 20px 20px; font: var(--weight-regular) var(--fs-body-sm) / 1.45 var(--font-core); color: var(--text-secondary); }
.sms-acc-body p { margin: 0; }
.sms-acc-body ul { margin: 0; padding-left: 18px; }
.sms-acc-body li + li { margin-top: 6px; }
.sms-acc-body li strong { color: var(--ink); font-weight: var(--weight-medium); }
.sms-help-resend { margin: 16px 0 0 !important; display: flex; flex-direction: column; gap: 8px; }
.sms-help-resend .btn { width: 100%; }
.sms-help-note { font: var(--weight-regular) var(--fs-caption) / 1.4 var(--font-core); color: var(--text-secondary); text-align: center; }
.sms-help-note:empty { display: none; }
.sms-help-foot { margin: 14px 0 0 !important; }
.sms-help-foot .btn-link { padding: 0; border: 0; background: none; font: inherit; text-decoration: underline; cursor: pointer; }
.sms-dev-note { margin: 16px 0 0; padding: 10px 14px; background: var(--surface-sunken); text-align: center; font: var(--weight-regular) var(--fs-caption) / 1.4 var(--font-core); color: var(--text-secondary); }

/* Pflichtlinks (legalFooter): auf der Startseite des Fragebogens ohne Extra-Platz, im geöffneten Formular
   mit Platz für die feste Weiter-Leiste (die Links stehen erst nach dem Scrollen unter dem ersten Bildschirm). */
.funnel-form ~ .legal-footer.has-bar { padding-bottom: 24px; }
.funnel-form.is-open ~ .legal-footer.has-bar { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }

/* Breite Bildschirme: dieselben Links klein und ganz rechts in der Weiter-Leiste, der Button bleibt mittig. */
.fx-legal-bar { display: none; }
@media (min-width: 1180px) {
  /* Links stehen schon in der Leiste: Fußzeile darunter nur noch bei Schritten ohne Leiste (Auswahl springt automatisch weiter)
     und auf der Startseite des Fragebogens (Formular noch zu). */
  .funnel-form.is-open.has-continue-bar ~ .legal-footer { display: none; }
  .fx-legal-bar {
    display: flex; position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
    flex-wrap: nowrap; gap: 16px; font-size: 12px;
  }
}

/* Warteliste (Sonderschritt nach der PLZ-Frage, siehe anfrage/index.php und src/Waitlist.php) */
.fx-waitlist { align-items: center; text-align: center; }
.fx-waitlist > .fx-thanks-icon { margin: 8px auto 4px; background: var(--info-bg); color: var(--blue-dark); }
.fx-waitlist .fx-body { width: 100%; max-width: 440px; margin-left: auto; margin-right: auto; }
.fx-waitlist-form, .fx-waitlist-done { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.fx-waitlist-done { align-items: center; text-align: center; }
.fx-waitlist-cta { margin: 0; text-align: center; font: var(--weight-medium) var(--fs-h4) / 1.3 var(--font-core); }
.fx-waitlist-form .fx-error { margin: 0; }
