/* ==========================================================================
   That's it. Marketing - Vorqualifizierungs-Funnel
   funnel.css
   --------------------------------------------------------------------------
   Ergaenzt css/style.css (Tokens, Reset, Typo, .btn--cta). Hier steht nur,
   was der Funnel zusaetzlich braucht.

   Aufbau:
     1. Seitengeruest (dunkle Buehne)
     2. Kopf: Logo + Fortschritt
     3. Schritte
     4. Antwort-Buttons
     5. Weg-Auswahl (Calendly vs. Rueckruf)
     6. Formular
     7. Fuss: Zurueck
     8. Breakpoints
     9. prefers-reduced-motion
   ========================================================================== */

/* ==========================================================================
   1. SEITENGERUEST
   Der Funnel ist durchgehend schwarz - er ist die Fortsetzung der
   Hero-/Abschluss-Klammer, nicht der hellen Inhaltsflaechen.
   ========================================================================== */
.funnel-page {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background-color: var(--ti-black);
  color: var(--ti-paper);
  /* style.css haelt unten Platz fuer den mobilen Floating-CTA der
     Landingpage. Den gibt es hier nicht. */
  padding-bottom: 0;
}

/* ==========================================================================
   2. KOPF
   ========================================================================== */
.funnel-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ti-s-4);
  padding: var(--ti-s-5) var(--ti-s-5) var(--ti-s-6);
  max-width: 46rem;
  width: 100%;
  margin-inline: auto;
}

.funnel-header__logo {
  display: inline-flex;
  align-items: center;
}

.funnel-header__logo img {
  height: 1.75rem;
  width: auto;
}

.funnel-header__step {
  font-family: var(--ti-label);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

/* Fortschrittsbalken sitzt auf der Unterkante des Kopfes. */
.funnel-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.12);
}

.funnel-progress__fill {
  height: 100%;
  width: 25%;
  background-color: var(--ti-gold);
  transition: width var(--ti-dur-slow) var(--ti-ease-standard);
}

/* ==========================================================================
   3. SCHRITTE
   Ohne JS liegen alle Schritte untereinander (Fallback). Mit JS ist immer
   genau einer sichtbar.
   ========================================================================== */
.funnel-main {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
  padding: var(--ti-s-4) var(--ti-s-5) var(--ti-s-8);
}

html.js .funnel-step {
  display: none;
}

html.js .funnel-step.is-active {
  display: block;
  animation: funnel-in var(--ti-dur-slow) var(--ti-ease-entrance) both;
}

@keyframes funnel-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* Ohne JS trennt eine Linie die Schritte optisch. */
html.no-js .funnel-step + .funnel-step {
  margin-top: var(--ti-s-8);
  padding-top: var(--ti-s-8);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.funnel-step__kicker {
  font-family: var(--ti-label);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--ti-gold);
  margin: 0 0 var(--ti-s-3);
}

.funnel-step__question {
  font-family: var(--ti-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--ti-paper);
  margin: 0 0 var(--ti-s-6);
  max-width: 20ch;
}

.funnel-step__question:focus-visible {
  outline: none;
}

.funnel-step__lead {
  color: rgba(255, 255, 255, 0.72);
  margin: calc(var(--ti-s-6) * -1 + var(--ti-s-2)) 0 var(--ti-s-6);
  max-width: 46ch;
}

.funnel-step__lead a {
  color: var(--ti-gold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ==========================================================================
   4. ANTWORT-BUTTONS
   Grosse Flaechen, ein Klick pro Frage - der Schritt wechselt sofort.
   ========================================================================== */
.funnel-options {
  display: flex;
  flex-direction: column;
  gap: var(--ti-s-3);
}

.funnel-option {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--ti-sans);
  cursor: pointer;
  /* Tap-Target mit Reserve. */
  min-height: 3.75rem;
  padding: var(--ti-s-4) var(--ti-s-7) var(--ti-s-4) var(--ti-s-5);
  background-color: var(--ti-n-800);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--ti-r-2);
  color: var(--ti-paper);
  transition:
    background-color var(--ti-dur-base) var(--ti-ease-standard),
    border-color var(--ti-dur-base) var(--ti-ease-standard),
    transform var(--ti-dur-base) var(--ti-ease-standard);
}

/* Signatur-Quadrat als Auswahl-Marke, erst bei Hover/Fokus sichtbar. */
.funnel-option::after {
  content: "";
  position: absolute;
  top: 50%;
  right: var(--ti-s-5);
  width: 10px;
  height: 10px;
  margin-top: -5px;
  background-color: var(--ti-gold);
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity var(--ti-dur-base) var(--ti-ease-standard),
    transform var(--ti-dur-base) var(--ti-ease-standard);
}

.funnel-option:hover,
.funnel-option:focus-visible {
  background-color: var(--ti-n-700);
  border-color: var(--ti-gold);
  transform: translateX(2px);
}

.funnel-option:hover::after,
.funnel-option:focus-visible::after {
  opacity: 1;
  transform: none;
}

.funnel-option.is-chosen {
  border-color: var(--ti-gold);
  background-color: var(--ti-n-700);
}

.funnel-option__label {
  display: block;
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.3;
}

.funnel-option__hint {
  display: block;
  margin-top: var(--ti-s-1);
  font-size: var(--ti-fs-body-s);
  color: rgba(255, 255, 255, 0.55);
}

/* ==========================================================================
   5. WEG-AUSWAHL
   Zwei gleichwertige Karten - der Termin steht bewusst zuerst.
   ========================================================================== */
.funnel-routes {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ti-s-4);
}

.funnel-route {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--ti-sans);
  cursor: pointer;
  padding: var(--ti-s-5);
  background-color: var(--ti-n-800);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--ti-r-2);
  color: var(--ti-paper);
  transition:
    background-color var(--ti-dur-base) var(--ti-ease-standard),
    border-color var(--ti-dur-base) var(--ti-ease-standard);
}

.funnel-route:hover,
.funnel-route:focus-visible {
  background-color: var(--ti-n-700);
  border-color: var(--ti-gold);
}

/* Der Termin-Weg ist der bevorzugte: Gold statt Grau. */
.funnel-route--primary {
  background-color: var(--ti-gold);
  border-color: var(--ti-gold);
  color: var(--ti-black);
}

.funnel-route--primary:hover,
.funnel-route--primary:focus-visible {
  background-color: #E9A845;
  border-color: #E9A845;
  color: var(--ti-black);
}

.funnel-route__label {
  display: block;
  font-family: var(--ti-display);
  font-weight: 900;
  font-size: 1.375rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: var(--ti-s-2);
}

.funnel-route__text {
  display: block;
  font-size: var(--ti-fs-body-s);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.66);
}

.funnel-route--primary .funnel-route__text {
  color: rgba(14, 14, 14, 0.76);
}

.funnel-route__cue {
  display: block;
  margin-top: var(--ti-s-4);
  font-family: var(--ti-label);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--ti-gold);
}

.funnel-route--primary .funnel-route__cue {
  color: var(--ti-black);
}

/* ==========================================================================
   6. FORMULAR
   ========================================================================== */
.funnel-form {
  display: grid;
  gap: var(--ti-s-4);
}

.funnel-field label {
  display: block;
  font-family: var(--ti-label);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: var(--ti-s-2);
}

.funnel-field input {
  width: 100%;
  font-family: var(--ti-sans);
  /* 16px verhindert, dass iOS beim Fokus hineinzoomt. */
  font-size: 1rem;
  min-height: 3rem;
  padding: var(--ti-s-3) var(--ti-s-4);
  color: var(--ti-paper);
  background-color: var(--ti-n-800);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--ti-r-2);
}

.funnel-field input:focus-visible {
  outline: 2px solid var(--ti-gold);
  outline-offset: 2px;
  border-color: var(--ti-gold);
}

.funnel-field input[aria-invalid="true"] {
  border-color: #E4776B;
}

.funnel-consent {
  display: flex;
  align-items: flex-start;
  gap: var(--ti-s-3);
  margin-top: var(--ti-s-2);
}

.funnel-consent input {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  margin-top: 0.1rem;
  accent-color: var(--ti-gold);
}

.funnel-consent label {
  font-size: var(--ti-fs-body-s);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

.funnel-consent a {
  color: var(--ti-gold);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.funnel-form__error {
  margin: 0;
  padding: var(--ti-s-4);
  background-color: rgba(228, 119, 107, 0.14);
  border: 1px solid #E4776B;
  border-radius: var(--ti-r-2);
  color: #FFD9D4;
  font-size: var(--ti-fs-body-s);
}

.funnel-form__submit {
  justify-self: start;
  margin-top: var(--ti-s-2);
}

/* ==========================================================================
   7. FUSS
   ========================================================================== */
.funnel-footer {
  max-width: 46rem;
  width: 100%;
  margin-inline: auto;
  padding: var(--ti-s-5);
  display: flex;
  flex-direction: column;
  gap: var(--ti-s-4);
}

/* display: inline-flex sticht das [hidden] der Browser-Stylesheets aus -
   deshalb muss es hier ausdruecklich wieder zurueckgenommen werden. */
.funnel-back[hidden] {
  display: none;
}

.funnel-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--ti-s-2);
  min-height: 2.75rem;
  padding: 0 var(--ti-s-3) 0 0;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--ti-label);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.66);
  transition: color var(--ti-dur-base) var(--ti-ease-standard);
}

.funnel-back:hover,
.funnel-back:focus-visible {
  color: var(--ti-gold);
}

.funnel-footer__meta {
  margin: 0;
  font-size: var(--ti-fs-caption);
  color: rgba(255, 255, 255, 0.42);
}

.funnel-footer__meta a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Auch die kleinen Fusslinks brauchen auf dem Handy eine greifbare Flaeche
   (WCAG 2.2, 2.5.8). Gleiche Logik wie im Footer der Landingpage. */
@media (pointer: coarse) {
  .funnel-footer__meta a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

.funnel-back-home {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-top: var(--ti-s-5);
  color: var(--ti-gold);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ==========================================================================
   8. BREAKPOINTS
   ========================================================================== */
@media (min-width: 768px) {
  .funnel-header,
  .funnel-main,
  .funnel-footer {
    padding-inline: var(--ti-s-7);
  }

  .funnel-main {
    padding-top: var(--ti-s-7);
  }

  .funnel-header__logo img {
    height: 2rem;
  }

  /* Zwei Wege nebeneinander, sobald der Platz reicht. */
  .funnel-routes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Name und Firma teilen sich eine Zeile. */
  .funnel-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .funnel-consent,
  .funnel-form__error,
  .funnel-form__submit {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   9. prefers-reduced-motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html.js .funnel-step.is-active {
    animation: none;
  }

  .funnel-option,
  .funnel-option::after,
  .funnel-route,
  .funnel-progress__fill {
    transition: none;
  }

  .funnel-option:hover,
  .funnel-option:focus-visible {
    transform: none;
  }
}
