/* Funnel /vorschau/ (seit 22.11.2026): eine Spalte wie eine App, eine Frage pro
   Bildschirm, große Antwortfelder. Baut auf site.css auf (Schrift, Felder, Knopf).
   Seit 22.11.2026 hell (Davin: „wie Perspective, heller, leicht verschwommener
   Hintergrund und glasig“): bunter, weicher Hintergrund statt Tiefschwarz, die
   Fragen-Karte aus Milchglas. Nur diese eine Karte ist Glas (Design-Verbot
   „kein Glas auf jeder Karte“). Kontraste nachgerechnet: Text mind. 4,8:1 auf
   dem hellsten und dunkelsten Fleck. Bewegung nur mit CSS, aus bei „weniger Bewegung“. */

body.funnel-page {
  --bg: #E9EEF0;
  --surface: rgba(255, 255, 255, .82);
  --surface-2: rgba(255, 255, 255, .6);
  --text: #1B1712;
  --muted: #443E38;
  --accent: #7C4119;
  --accent-hover: #5E300F;
  --sel-bg: #D49461;
  --sel-text: #1A120C;
  --field: #857A70;
  --placeholder: #6B635B;
  --line: rgba(27, 23, 18, .12);
  --line-strong: rgba(27, 23, 18, .2);
  --danger: #B42318;
  --ok: #15803D;
  --ring: rgba(124, 65, 25, .3);
  --btn-shadow: 0 14px 30px -14px rgba(31, 122, 112, .75);
  --btn-shadow-hover: 0 20px 40px -14px rgba(31, 122, 112, .9);
  --shadow-lg: inset 0 1px 0 rgba(255, 255, 255, .9), 0 34px 70px -34px rgba(92, 58, 28, .45), 0 10px 28px -16px rgba(92, 58, 28, .25);
  color-scheme: light;
  min-height: 100dvh;
  background: var(--bg);
}

/* Der Hintergrund: weiche Farbflecken in Kupfer, Patina und Himmelgrau,
   leicht verschwommen. Steht still, kostet nichts beim Scrollen. */
body.funnel-page::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(34% 26% at 10% 8%, #EAC29E 0 55%, rgba(234, 194, 158, 0) 100%),
    radial-gradient(40% 30% at 94% 12%, #A6DBD3 0 55%, rgba(166, 219, 211, 0) 100%),
    radial-gradient(28% 22% at 82% 50%, #E4B184 0 50%, rgba(228, 177, 132, 0) 100%),
    radial-gradient(38% 28% at 8% 52%, #A6DBD3 0 45%, rgba(166, 219, 211, 0) 100%),
    radial-gradient(48% 30% at 30% 92%, #C6D5E0 0 55%, rgba(198, 213, 224, 0) 100%),
    radial-gradient(36% 26% at 88% 90%, #EAC29E 0 45%, rgba(234, 194, 158, 0) 100%),
    var(--bg);
  filter: blur(36px);
}
/* Das feine Korn aus site.css ist weiß gedacht; auf hell etwas schwächer */
body.funnel-page::after { opacity: .04; }

.funnel {
  max-width: 560px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 16px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  position: relative;
}

.f-top { display: flex; justify-content: center; padding: 12px 0 4px; }
.f-top .brand { font-size: 1.3rem; }
.funnel-page .brand::before { background: #D49461; }

/* Überschrift nur auf dem ersten Bildschirm */
.f-intro { padding: 14px 0 18px; }
.funnel:has(fieldset[data-step="1"][hidden]) .f-intro { display: none; }
.funnel:has(fieldset[data-step="1"][hidden]) .f-form { margin-top: 14px; }
.f-kick { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--accent); font-weight: 700; font-size: 1rem; }
.f-kick::before { content: ""; width: 24px; height: 2px; background: var(--accent); flex: none; }
.f-intro h1 { font-size: clamp(2rem, 8vw, 2.7rem); font-stretch: var(--wide); margin: 0 0 12px; }
.f-sub { margin: 0; color: var(--muted); font-size: 1.125rem; line-height: 1.5; max-width: 32em; }

/* Die Karte mit den Fragen (und auf /danke/ die Danke-Karte): Milchglas.
   Pro Seite gibt es genau eine solche Karte. */
.funnel .f-form, .funnel .f-card {
  background: rgba(255, 255, 255, .48);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 22px;
  padding: 18px 16px 16px;
  box-shadow: var(--shadow-lg);
}
/* Ohne Glas-Unterstützung: fast weiß, damit der Text sicher lesbar bleibt */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .funnel .f-form, .funnel .f-card { background: rgba(255, 255, 255, .9); }
}
.funnel .progress { display: grid; gap: 8px; margin-bottom: 18px; font-size: .95rem; }
.funnel .progress .dots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.funnel .progress .dots i { width: auto; height: 6px; border-radius: 3px; background: rgba(27, 23, 18, .14); }
.funnel .progress .dots i.on { background: #C9824A; }
.funnel .stepform legend { font-size: 1.45rem; font-stretch: var(--wide); margin-bottom: 14px; }

.js .funnel .stepform fieldset:not([hidden]) { animation: f-rein .38s var(--ease) both; }
@keyframes f-rein { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }

/* Antwortfelder: hell, mit sichtbarem Rahmen, kein eigenes Glas */
.f-tiles { display: grid; gap: 10px; }
.f-tiles--grid { grid-template-columns: 1fr 1fr; }
.f-tile { position: relative; display: flex; }
.f-tile input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.f-tile span {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--field);
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 6px 16px -12px rgba(92, 58, 28, .35);
  font-weight: 700;
  line-height: 1.25;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .2s var(--ease), box-shadow .2s ease;
}
.f-tiles--list .f-tile span { flex-direction: row; align-items: center; justify-content: flex-start; min-height: 64px; }
.f-tile svg { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: stroke .15s ease; }
.f-tile svg .voll { fill: var(--accent); stroke: none; }
.f-tile input:active + span { transform: scale(.97); }
.f-tile input:checked + span { background: var(--sel-bg); border-color: var(--sel-bg); color: var(--sel-text); box-shadow: 0 10px 22px -12px rgba(160, 90, 40, .7); }
.f-tile input:checked + span svg { stroke: var(--sel-text); }
.f-tile input:checked + span svg .voll { fill: var(--sel-text); }
.f-tile input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .f-tile input:hover + span { border-color: var(--accent); background: rgba(255, 255, 255, .85); transform: translateY(-2px); }
}

/* Kontakt-Schritt */
.funnel .field input { background: var(--surface); }
.funnel .stepform .btn { width: 100%; margin-top: 4px; }
.funnel .form-note { font-size: .95rem; color: var(--muted); margin: 12px 0 0; }
.funnel .step-nav { margin-top: 6px; }

/* Vertrauen und Anruf */
.f-trust { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; color: var(--muted); }
.f-trust li { display: flex; align-items: center; gap: 10px; }
.f-trust svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.f-call { margin: 14px 0 0; color: var(--muted); }

/* Danke-Seite */
.funnel .f-done { margin-top: 28px; padding: 26px 20px 22px; }
.f-done .check { width: 46px; height: 46px; border-radius: 50%; background: var(--ok); position: relative; margin-bottom: 16px; }
.f-done .check::after { content: ""; position: absolute; left: 16px; top: 10px; width: 10px; height: 19px; border-right: 4px solid #FFFFFF; border-bottom: 4px solid #FFFFFF; transform: rotate(45deg); }
.f-done h1 { font-size: clamp(1.9rem, 7vw, 2.5rem); font-stretch: var(--wide); margin: 0 0 12px; }
.f-done .f-sub { margin-bottom: 14px; }
/* Sterne „Wie fanden Sie die Anfrage?“: nur mit JavaScript sichtbar (sterne.js).
   Leer: Rand #857A70 (3,1:1 auf Glas). Voll: Kupfer mit Rand #7C4119 (4,8:1). */
.f-rate { display: none; margin: 20px 0 18px; padding: 16px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.js .f-rate { display: block; }
.f-rate__frage { margin: 0 0 6px; font-weight: 700; font-size: 1.15rem; }
.f-stars { display: flex; margin-left: -6px; }
.f-star { display: grid; place-items: center; width: 50px; height: 50px; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.f-star svg { width: 38px; height: 38px; fill: rgba(255, 255, 255, .35); stroke: var(--field); stroke-width: 1.4; stroke-linejoin: round; transition: fill .15s ease, stroke .15s ease, transform .2s var(--ease); }
.f-star.an svg { fill: #E3A266; stroke: #7C4119; }
.ist-fertig .f-star { cursor: default; }
.ist-fertig .f-star.an svg { animation: f-pop .4s var(--ease) both; }
.ist-fertig .f-star:nth-child(2) svg { animation-delay: .04s; }
.ist-fertig .f-star:nth-child(3) svg { animation-delay: .08s; }
.ist-fertig .f-star:nth-child(4) svg { animation-delay: .12s; }
.ist-fertig .f-star:nth-child(5) svg { animation-delay: .16s; }
@keyframes f-pop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
/* Vorschau beim Zeigen oder mit der Tastatur: alle Sterne bis zum gezeigten füllen */
@media (hover: hover) and (pointer: fine) {
  .f-rate:not(.ist-fertig) .f-stars:hover .f-star svg { fill: #E3A266; stroke: #7C4119; }
  .f-rate:not(.ist-fertig) .f-stars .f-star:hover ~ .f-star svg { fill: rgba(255, 255, 255, .35); stroke: var(--field); }
  .f-rate:not(.ist-fertig) .f-star:hover svg { transform: scale(1.1); }
}
.f-rate:not(.ist-fertig) .f-stars:has(.f-star:focus-visible) .f-star svg { fill: #E3A266; stroke: #7C4119; }
.f-rate:not(.ist-fertig) .f-stars .f-star:focus-visible ~ .f-star svg { fill: rgba(255, 255, 255, .35); stroke: var(--field); }
.f-rate__danke { min-height: 1.6em; margin: 4px 0 0; color: var(--muted); font-weight: 700; }
.f-rate__danke:empty { min-height: 0; margin: 0; }

.f-eilt { margin: 0 0 6px; color: var(--muted); }
.f-note { margin: 0; color: var(--muted); }

.f-foot { margin-top: auto; padding-top: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 18px; color: var(--muted); font-size: .95rem; }
.f-foot nav { display: flex; gap: 18px; }
.f-foot a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }

@media (min-width: 720px) {
  .funnel { padding-top: 12px; }
  .f-intro { padding: 28px 0 24px; }
  .funnel .f-form { padding: 26px 24px 22px; }
  .funnel .f-done { margin-top: 48px; padding: 34px 32px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .funnel .stepform fieldset:not([hidden]) { animation: none; }
  .f-tile span, .f-tile svg { transition: none; }
  .f-tile input:active + span, .f-tile input:hover + span { transform: none; }
  .ist-fertig .f-star.an svg { animation: none; }
  .f-star svg, .f-rate:not(.ist-fertig) .f-star:hover svg { transition: none; transform: none; }
}
