/* CLO-1198 — Registrierungswizard: full-screen shell, progress bar, hearts. */

.wizard-body {
  margin: 0;
  background: var(--color-bg, #fff8f4);
  color: var(--color-text, #1a1a1a);
  min-height: 100vh;
}

/* base.html still wraps {% block content %} in <main>; neutralise its layout. */
.wizard-body > main {
  margin: 0;
  padding: 0;
}

.wizard {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Hearts background ─────────────────────────────────────────────── */
.wizard__hearts {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.wizard__heart {
  position: absolute;
  bottom: -48px;
  color: var(--color-primary, #ef3f6e);
  opacity: 0;
  will-change: transform, opacity;
  animation-name: wizard-rise;
  animation-timing-function: linear;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

.wizard__heart svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes wizard-rise {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  12% {
    opacity: var(--heart-opacity, 0.5);
  }
  88% {
    opacity: var(--heart-opacity, 0.5);
  }
  100% {
    transform: translateY(-112vh) rotate(20deg) scale(1.1);
    opacity: 0;
  }
}

/* ── Progress bar (at the height of the normal site navigation) ───────── */
.wizard__bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  z-index: 3;
  background: rgba(255, 248, 244, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.wizard__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-text, #1a1a1a);
  text-decoration: none;
  white-space: nowrap;
}

.wizard__brand-heart {
  display: inline-flex;
  color: var(--color-primary, #ef3f6e);
}

.wizard__progress {
  flex: 1;
  height: 8px;
  border-radius: var(--radius-pill, 999px);
  background: var(--color-primary-soft, #ffe5ec);
  overflow: hidden;
}

.wizard__progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--color-primary, #ef3f6e);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard__step-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  white-space: nowrap;
}

/* ── Stage + card ─────────────────────────────────────────────────────── */
.wizard__stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 24px 56px;
}

/* Scoped to .wizard-body so the card padding beats the global
   `body:not(.page-startseite) main > section { padding: 40px 0 80px }` rule
   (style.css), which otherwise wins on specificity and zeroes the card's
   left/right inner padding. */
.wizard-body .wizard__card {
  width: 100%;
  max-width: 560px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #f1e3da);
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--shadow-card-strong, 0 12px 40px rgba(239, 63, 110, 0.14));
  padding: 40px;
  text-align: center;
  animation: wizard-card-in 0.45s ease both;
}

@keyframes wizard-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.wizard__eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary, #ef3f6e);
}

.wizard__title {
  margin: 0 0 12px;
  font-size: 1.75rem;
  line-height: 1.2;
}

.wizard__lead {
  margin: 0 0 28px;
  color: var(--color-text-muted, #6b7280);
}

.wizard__form {
  margin: 0;
}

.wizard__next {
  min-width: 160px;
}

/* Step 1 (account) form: left-aligned fields inside the centered card. */
.wizard__form--account {
  text-align: left;
}

.wizard__fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 28px;
}

.wizard__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wizard__label {
  font-weight: 600;
  font-size: 0.92rem;
}

.wizard__hint {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.8rem;
}

.wizard__error {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-md, 12px);
  background: rgba(239, 63, 110, 0.08);
  border: 1px solid var(--color-primary, #ef3f6e);
  color: var(--color-primary, #ef3f6e);
  font-weight: 600;
  text-align: left;
}

.wizard__login-hint {
  margin: 18px 0 0;
  text-align: center;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .wizard-body .wizard__card {
    padding: 28px 20px;
  }
  .wizard__brand {
    font-size: 1rem;
  }
}

/* ── Step 2: profile questions ────────────────────────────────────────── */
.wizard__card:has(.wizard__form--questions) {
  max-width: 680px;
  text-align: left;
}

.wizard__answered {
  margin: -8px 0 20px;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.9rem;
}

.wizard__error-list {
  margin: 0;
  padding-left: 18px;
}

.wizard__form--questions {
  text-align: left;
}

.wizard__qgroup {
  border: 0;
  margin: 0 0 28px;
  padding: 0;
}

.wizard__qgroup-title {
  padding: 0;
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-text, #1a1a1a);
}

.wizard__question {
  margin: 0 0 22px;
}

.wizard__qprompt {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 0.95rem;
}

.wizard__req {
  color: var(--color-primary, #ef3f6e);
  font-weight: 800;
}

.wizard__qhint,
.wizard__qtext + .wizard__qhint {
  margin: 0 0 8px;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.82rem;
}

.wizard__qtext {
  width: 100%;
  resize: vertical;
  min-height: 52px;
}

.wizard__qchoices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Selectable pill — radio/checkbox is visually hidden; the label is the target. */
.wizard__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--color-border, #f1e3da);
  border-radius: var(--radius-pill, 999px);
  background: var(--color-surface, #fff);
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.wizard__chip input {
  accent-color: var(--color-primary, #ef3f6e);
  margin: 0;
}

.wizard__chip:hover {
  border-color: var(--color-primary, #ef3f6e);
}

.wizard__chip:has(input:checked) {
  border-color: var(--color-primary, #ef3f6e);
  background: var(--color-primary-soft, #ffe5ec);
  color: var(--color-primary, #ef3f6e);
  font-weight: 600;
}

.wizard__chip:has(input:focus-visible) {
  outline: 2px solid var(--color-primary, #ef3f6e);
  outline-offset: 2px;
}

.wizard__qscale-end {
  color: var(--color-text-muted, #6b7280);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.wizard__qscale-val {
  min-width: 2ch;
  text-align: center;
  font-weight: 700;
  color: var(--color-primary, #ef3f6e);
  font-variant-numeric: tabular-nums;
}

/* ── Step 2: single-question sub-stepper (CLO-1226) ───────────────────── */
.wizard__card:has(.wizard__form--question) {
  max-width: 620px;
  text-align: left;
}

.wizard__form--question {
  text-align: left;
}

.wizard__qactions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.wizard__qactions .wizard__next {
  margin: 0;
}

.wizard__skip {
  background: transparent;
  border: 1px solid var(--color-border, #f1e3da);
  color: var(--color-text-muted, #6b7280);
}

/* Whole-star rating (replaces the old range sliders). Rendered highest-first so
   `:checked ~ label` and `:hover ~ label` light the chosen star + all lower ones;
   `row-reverse` flips that back to a left→right ascending display. */
.wizard__starline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.wizard__stars {
  border: 0;
  margin: 0;
  padding: 0;
  position: relative;
  display: inline-flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* Visually hidden but still focusable for keyboard users. */
.wizard__star-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wizard__star {
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

.wizard__star-icon {
  font-size: 1.85rem;
  color: var(--color-border, #e7d9d0);
  transition: color 0.12s, transform 0.12s;
}

.wizard__star:hover .wizard__star-icon,
.wizard__star:hover ~ .wizard__star .wizard__star-icon {
  color: var(--color-primary, #ef3f6e);
  transform: scale(1.08);
}

.wizard__star-input:checked ~ .wizard__star .wizard__star-icon {
  color: var(--color-primary, #ef3f6e);
}

.wizard__star-input:focus-visible + .wizard__star .wizard__star-icon {
  outline: 2px solid var(--color-primary, #ef3f6e);
  outline-offset: 3px;
  border-radius: 4px;
}

.wizard__starval {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted, #6b7280);
}

/* --- Bipolar slider (matching v2 P2T2, replaces the star rendering) -------- */
.wizard__slider {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}
.wizard__slider-pole {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted, #6b7280);
  /* Pol-Labels (z.B. „Frühaufsteher" ↔ „Nachteule") vollständig zeigen: kein
     Ellipsis-Abschneiden. Lange Labels dürfen umbrechen; einzelne lange Wörter
     brechen statt zu überlaufen. */
  overflow-wrap: break-word;
  hyphens: auto;
}
.wizard__slider-pole--right {
  text-align: right;
}
.wizard__slider-range {
  flex: 2 1 120px;
  accent-color: var(--color-primary, #ef3f6e);
  min-height: 28px;
}
.wizard__slider-val {
  font-weight: 600;
}

/* --- Gate + importance companion blocks ------------------------------------ */
.wizard__qsub {
  margin: 14px 0 6px;
  font-size: 0.9rem;
  font-weight: 600;
}
.wizard__gate {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border, #f1e3da);
}
.wizard__dealbreaker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.9rem;
}
.wizard__importance {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border, #f1e3da);
}
.wizard__stars--sub .wizard__star-icon {
  font-size: 1.2rem;
}

/* CLO-1250: narrow phones (~480px and below). The starline is `nowrap`, so on a
   ~287px card the two question types each broke differently:
   - `scale_1_10` (10 stars): the row overflowed and the "10" end-label clipped
     off-screen. Fix: shrink the star glyphs/padding so 10 stars + the short
     numeric end-labels fit within the viewport.
   - `bipolar_slider` (7 stars + two long German pole labels): two ~22-char
     labels ("Tiefgründige Gespräche" / "Leichte Momente") cannot share one
     horizontal line beside the stars in 287px at any readable size, so they
     wrapped to a second line. Fix: stack label / stars / label vertically for
     bipolar only — each label keeps its full text on its own single line. */
@media (max-width: 480px) {
  .wizard__starline {
    gap: 6px;
  }
  .wizard__star {
    padding: 1px;
  }
  .wizard__star-icon {
    font-size: 1.2rem;
  }
  .wizard__qscale-end {
    font-size: 0.78rem;
  }

  [data-qtype="bipolar_slider"] .wizard__slider {
    flex-direction: column;
    align-items: stretch;
  }
  [data-qtype="bipolar_slider"] .wizard__slider-pole,
  [data-qtype="bipolar_slider"] .wizard__slider-pole--right {
    text-align: center;
    white-space: normal;
  }
}

/* Enter transition of the question card as each sub-step loads. */
@keyframes wizard-q-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard__question--enter {
  animation: wizard-q-enter 0.35s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .wizard__question--enter {
    animation: none;
  }
  .wizard__star-icon {
    transition: none;
  }
}

/* ── Step 5: premium upselling ────────────────────────────────────────── */
.wizard__card:has(.wizard__plans) {
  max-width: 640px;
}

.wizard__premium-perks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.wizard__premium-perks li {
  position: relative;
  padding-left: 26px;
  color: var(--color-text, #1a1a1a);
  font-size: 0.95rem;
}

.wizard__premium-perks li::before {
  content: "♥";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-primary, #ef3f6e);
  font-size: 0.95rem;
}

.wizard__plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 0 22px;
}

.wizard__plan {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  padding: 22px 18px;
  text-align: center;
  border: 1px solid var(--color-border, #ecd9d0);
  border-radius: var(--radius-md, 12px);
  background: #fff;
}

.wizard__plan--featured {
  border-color: var(--color-primary, #ef3f6e);
  box-shadow: 0 8px 24px rgba(239, 63, 110, 0.12);
}

.wizard__plan-tag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--color-primary, #ef3f6e);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wizard__plan-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.wizard__plan-price {
  margin: 4px 0 0;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--color-text, #1a1a1a);
}

.wizard__plan-price small {
  display: inline;
  margin-left: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
}

.wizard__plan-note {
  margin: 0 0 14px;
  min-height: 2.4em;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.85rem;
}

.wizard__plan-cta {
  margin-top: auto;
  width: 100%;
}

.wizard__skip {
  margin-top: 4px;
}

@media (max-width: 480px) {
  .wizard__premium-perks,
  .wizard__plans {
    grid-template-columns: 1fr;
  }
}

/* Accessibility: no motion for users who ask for none. */
@media (prefers-reduced-motion: reduce) {
  .wizard__card {
    animation: none;
  }
  .wizard__progress-fill {
    transition: none;
  }
  .wizard__hearts {
    display: none;
  }
}

/* ── Kategorie-Interstitial: 2-s-Einblendung beim Wechsel in eine neue
      Fragen-Kategorie (Icon + Name + Beschreibung), dann Fade auf die Frage. ── */
/* Spezifität ≥ der Basis-Regel `.wizard-body .wizard__card` (0-2-0), sonst
   hält deren wizard-card-in (fill-mode both) die opacity auf 1 und die Karte
   bliebe unter dem Interstitial sichtbar. Beim Entfernen der Klasse startet
   wizard-card-in neu = der Fade auf die erste Frage. */
.wizard-body .wizard__card.wizard__card--veiled {
  animation: none;
  opacity: 0;
}

.wizard-body .wizard__card {
  transition: opacity 0.4s ease;
}

.wizard__interstitial {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: wizard-card-in 0.4s ease both;
}

.wizard__interstitial--leave {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.wizard__interstitial-card {
  max-width: 420px;
  text-align: center;
}

.wizard__interstitial-icon {
  display: block;
  font-size: 64px;
  line-height: 1;
  margin-bottom: 20px;
  animation: wizard-interstitial-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.wizard__interstitial-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--color-text, #1a1a1a);
}

.wizard__interstitial-desc {
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
  color: var(--color-text-muted, #6b7280);
}

@keyframes wizard-interstitial-pop {
  0% {
    transform: scale(0.4) rotate(-8deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wizard__card {
    transition: none;
  }
  .wizard__interstitial,
  .wizard__interstitial-icon {
    animation: none;
  }
}
