/* =============================================================================
   Buchungsfunnel

   Desktop: Schritte links, mitlaufende Zusammenfassung rechts.
   Mobil:   Schritte untereinander, Zusammenfassung als Leiste am unteren Rand.
   ============================================================================= */

[x-cloak] {
  display: none !important;
}

.funnel {
  min-height: 60vh;
}

.funnel__grid {
  display: grid;
  align-items: stretch;
}

@media (min-width: 900px) {
  .funnel__grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.85fr);
  }
}

.funnel__steps {
  padding: 38px var(--pad-x) 60px;
  min-width: 0;
}

/* --- Fortschritt ---------------------------------------------------------- */

.funnel__progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.funnel__bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  min-width: 0;
}

.funnel__bar-fill {
  height: 3px;
  background: var(--cyan);
  transition: width 0.4s var(--ease);
}

.funnel__title {
  font-size: clamp(30px, 5.4vw, 86px);
  margin-top: 14px;
}

.funnel__title:focus {
  outline: none;
}

.funnel__sub {
  font-size: 16px;
  color: var(--text-dim);
  max-width: 560px;
  margin: 12px 0 0;
  line-height: 1.55;
  min-height: 1.55em;
}

/* --- Auswahl -------------------------------------------------------------- */

@keyframes stepin {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.funnel__panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
  max-width: 660px;
  border: 0;
  padding: 0;
  animation: stepin 0.45s var(--ease) both;
}

.funnel__panel--form {
  gap: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .funnel__panel {
    animation: none;
  }
}

.opt {
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.opt:hover {
  transform: translateX(5px);
  border-color: var(--cyan);
}

/* Fokus liegt auf dem versteckten Feld — der Rahmen muss ihn sichtbar machen. */
.opt:focus-within {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.opt--on {
  border: 1.5px solid var(--cyan);
  background: rgba(0, 216, 255, 0.09);
}

.opt__mark {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  flex: none;
  transform: skewX(-10deg);
}

.opt--on .opt__mark {
  border-color: var(--cyan);
  background: var(--cyan);
}

.opt__body {
  flex: 1;
  min-width: 0;
}

.opt__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.opt__name {
  font-size: 22px;
}

.opt__tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
}

.opt__desc {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 5px;
  line-height: 1.5;
}

.opt__price {
  font-size: 20px;
  color: var(--cyan);
  white-space: nowrap;
  flex: none;
}

/* Aufpreis gegenüber dem günstigsten Paket. */
.opt__delta {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-top: 3px;
}

.opt--on .opt__delta {
  color: var(--cyan-light);
}

/* Bündel: Vorzugspreis gegen durchgestrichenen Einzelpreis. */
.opt--bundle {
  border-color: rgba(0, 216, 255, 0.45);
  background: rgba(0, 216, 255, 0.04);
}

.opt__tag--save {
  background: var(--cyan);
  color: var(--bg);
  padding: 3px 8px;
  border-radius: 2px;
}

.opt__strike {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--text-mute);
  text-decoration: line-through;
  margin-top: 3px;
}

@media (max-width: 560px) {
  .opt {
    padding: 16px;
    gap: 14px;
    flex-wrap: wrap;
  }

  .opt__name {
    font-size: 18px;
  }

  .opt__price {
    font-size: 17px;
    width: 100%;
    text-align: right;
  }
}

/* --- Termine -------------------------------------------------------------- */

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

@media (max-width: 560px) {
  .slots {
    grid-template-columns: 1fr 1fr;
  }
}

.slot {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}

.slot:hover {
  transform: translateX(5px);
  border-color: var(--cyan);
}

.slot:focus-within {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.slot--on {
  border: 1.5px solid var(--cyan);
  background: rgba(0, 216, 255, 0.09);
}

.slot__day {
  font-size: 15px;
  letter-spacing: 0.06em;
}

.slot__time {
  font-size: 24px;
  color: var(--cyan);
}

/* --- Formular ------------------------------------------------------------- */

.funnel__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 560px) {
  .funnel__row {
    grid-template-columns: 1fr;
  }
}

.funnel__consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.5;
  cursor: pointer;
}

.funnel__consent input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
  flex: none;
}

.funnel__promises {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-mute);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.funnel__empty {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

.funnel__errors {
  border: 1px solid #ff6b6b;
  background: rgba(255, 107, 107, 0.08);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14px;
  color: #ffd7d7;
}

.funnel__errors ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

/* --- Navigation ----------------------------------------------------------- */

.funnel__nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.funnel__hint {
  font-size: 12.5px;
  color: var(--text-mute);
}

/* --- Zusammenfassung ------------------------------------------------------ */

.funnel__summary {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-raised);
  padding: 38px 2.6vw 40px;
  min-width: 0;
}

.funnel__summary-inner {
  position: sticky;
  top: 100px;
}

.funnel__total {
  font-size: clamp(38px, 5vw, 72px);
  color: var(--text);
  margin-top: 14px;
}

.funnel__total-note {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-top: 6px;
}

.funnel__lines {
  display: flex;
  flex-direction: column;
  margin: 24px 0 0;
}

.funnel__lines > div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 13px 0;
}

.funnel__lines dt {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  grid-column: 1;
}

.funnel__lines dd {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0;
  grid-column: 1;
}

.funnel__lines span {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  letter-spacing: -0.025em;
  font-size: 17px;
  color: var(--cyan);
  white-space: nowrap;
  align-self: center;
}

.funnel__promise-list {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 22px;
  margin-top: 22px;
  font-size: 13.5px;
}

.funnel__rating {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 18px;
  font-size: 12.5px;
  color: var(--text-mute);
  line-height: 1.45;
}

/*
 * Mobil: die Zusammenfassung wandert unter die Schritte und der Gesamtpreis
 * klebt zusaetzlich am unteren Rand — wie im Mobile-Entwurf.
 */
@media (max-width: 899px) {
  .funnel__summary {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 24px var(--pad-x) 30px;
  }

  .funnel__summary-inner {
    position: static;
  }

  .funnel__total {
    font-size: 34px;
  }

  .funnel__steps {
    padding-bottom: 20px;
  }
}

/*
 * Rueckmeldung zur Anfahrtszone unter dem Postleitzahlfeld.
 *
 * Bewusst zurueckhaltend: die haeufigste Meldung ist "Anfahrt inklusive", und
 * eine gute Nachricht braucht kein Ausrufezeichen. Die Zeile darf den Funnel
 * nicht springen lassen, deshalb eine feste Mindesthoehe.
 */
.funnel__zone {
  margin-top: 10px;
  min-height: 20px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}

.funnel__zone p {
  margin: 0;
}

.funnel__zone--ok {
  color: var(--cyan-light);
}

.funnel__zone--hint {
  color: var(--text-mute);
}

/* =============================================================================
   PLATZHALTER, BIS DER FUNNEL BEDIENBAR IST

   Sichtbar nur, solange Alpine noch nicht gestartet ist. Absichtlich an die
   Klasse "js" am <html> gebunden: ohne JavaScript wird der Platzhalter nie
   angezeigt, sonst läge er für immer über dem Formular.
   ============================================================================= */

.funnel-skelett {
  display: none;
}

.js .funnel {
  position: relative;
}

/* Feste Mindesthöhe, solange gewartet wird: das verborgene Formular ist ohne
   Alpine fast leer und würde den Platzhalter sonst zusammenfallen lassen. */
.js .funnel[data-wartend] {
  min-height: 640px;
}

/*
 * visibility statt display: das Formular behält seinen Platz im Layout und
 * bleibt für Screenreader und Suchmaschinen im Dokument. Nur anfassen lässt es
 * sich nicht, solange es noch nicht rechnet.
 */
.js .funnel[data-wartend] .funnel__grid {
  visibility: hidden;
}

.js .funnel[data-wartend] .funnel-skelett {
  display: grid;
  position: absolute;
  inset: 0;
  align-items: start;

  /* Verzögert eingeblendet. Ist Alpine vorher fertig, sieht ihn niemand. */
  opacity: 0;
  animation: skelett-auf 0.18s ease 0.1s forwards;
}

@media (min-width: 900px) {
  .js .funnel[data-wartend] .funnel-skelett {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.85fr);
  }
}

@keyframes skelett-auf {
  to {
    opacity: 1;
  }
}

.funnel-skelett__links {
  padding: 38px var(--pad-x) 60px;
  min-width: 0;
}

.funnel-skelett__rechts {
  padding: 34px 30px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  min-width: 0;
}

@media (max-width: 899px) {
  .funnel-skelett__rechts {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 24px var(--pad-x) 30px;
  }
}

/*
 * Die Abstaende spiegeln .funnel__progress, .funnel__title und .funnel__sub
 * eins zu eins. Die Ueberschrift skaliert mit derselben clamp-Kurve wie das
 * Original, damit der Platzhalter auf dem Handy nicht doppelt so hoch ist wie
 * das, was danach kommt.
 */
.funnel-skelett__fortschritt {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.funnel-skelett__titel {
  /* Zwei Zeilen der echten Ueberschrift: clamp(30px, 5.4vw, 86px) mal 1.64 */
  height: clamp(49px, 8.9vw, 141px);
  margin-top: 14px;
}

.funnel-skelett__unterzeile {
  margin-top: 12px;
}

.funnel-skelett__optionen {
  margin-top: 30px;
  display: grid;
  gap: 12px;
}

.funnel-skelett__opt {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.funnel-skelett__aktion {
  margin-top: 30px;
}

.funnel-skelett__zeilen {
  margin-top: 26px;
  display: grid;
  gap: 16px;
}

.funnel-skelett__zeile {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* --- Die Fläche selbst ---------------------------------------------------- */

.skelett {
  display: block;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.10) 37%,
    rgba(255, 255, 255, 0.04) 63%
  );
  background-size: 400% 100%;
  animation: skelett-schimmer 1.4s linear infinite;
}

.skelett--rund {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
}

@keyframes skelett-schimmer {
  from {
    background-position: 100% 50%;
  }
  to {
    background-position: 0 50%;
  }
}

/*
 * Wer Bewegung abbestellt hat, bekommt eine ruhige Fläche statt eines
 * wandernden Glanzes — und den Platzhalter ohne Einblendeverzögerung, weil ein
 * Aufblenden dieselbe Reizwirkung hätte.
 */
@media (prefers-reduced-motion: reduce) {
  .skelett {
    animation: none;
    background: rgba(255, 255, 255, 0.06);
  }

  .js .funnel[data-wartend] .funnel-skelett {
    animation: none;
    opacity: 1;
  }
}

/* --- Notbetrieb ------------------------------------------------------------
   Wenn Alpine gar nicht kommt (Skript blockiert, Netz weg), wäre der Funnel
   tot: alle Schritte hängen an x-cloak. Statt eines ewigen Platzhalters werden
   dann alle Schritte gleichzeitig gezeigt. Das sieht nicht gut aus, ist aber
   ein vollständiges, absendbares Formular — der Server rechnet den Preis
   ohnehin selbst.
   -------------------------------------------------------------------------- */

.funnel--notbetrieb [x-cloak] {
  display: revert !important;
}

.funnel__notbetrieb {
  margin: 0 var(--pad-x) 20px;
  padding: 14px 16px;
  border-left: 3px solid var(--cyan);
  background: rgba(0, 216, 255, 0.08);
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.55;
}
