/* ==========================================================================
   QuickScan-Funnel
   ========================================================================== */

.ayb-funnel {
  position: relative;
  min-height: 78vh;
  padding-block: var(--ayb-sp-xl) var(--ayb-sp-2xl);
  overflow: hidden;
  background:
    radial-gradient(60rem 40rem at 15% -10%, rgba(42, 62, 102, 0.07), transparent 60%),
    radial-gradient(48rem 36rem at 95% 15%, rgba(42, 62, 102, 0.05), transparent 55%),
    var(--ayb-white);
}

/* --- Fortschritt -------------------------------------------------------- */

.ayb-funnel__progress {
  position: fixed;
  top: 82px;
  left: 0;
  right: 0;
  z-index: 90;
  height: 4px;
  background: var(--ayb-border);
}

.ayb-funnel__progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--ayb-navy), var(--ayb-navy-light));
  transition: width 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Schritte ----------------------------------------------------------- */

/* Alle Schritte liegen im DOM. Sie werden ein- und ausgeblendet, nicht
   erzeugt — nur so bleibt die Fragenstrecke ohne JavaScript lesbar. */
.ayb-funnel__step {
  display: none;
  animation: ayb-step-ein 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ayb-funnel__step.is-active {
  display: block;
}

@keyframes ayb-step-ein {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- Einstieg ----------------------------------------------------------- */

.ayb-funnel__intro {
  display: grid;
  gap: var(--ayb-sp-xl);
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
}

.ayb-funnel__intro h1 {
  font-size: var(--ayb-fs-h1);
}

.ayb-funnel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ayb-sp-lg);
  margin: var(--ayb-sp-lg) 0;
  padding: var(--ayb-sp-md) 0;
  border-block: 1px solid var(--ayb-border);
  list-style: none;
}

.ayb-funnel__meta li {
  font-size: var(--ayb-fs-small);
  color: var(--ayb-text-light);
}

.ayb-funnel__meta strong {
  display: block;
  font-size: var(--ayb-fs-h3);
  color: var(--ayb-navy);
}

/* Vorschau der drei Themenblöcke, gestaffelt eingeblendet. */
.ayb-funnel__preview {
  display: flex;
  align-items: baseline;
  gap: var(--ayb-sp-md);
  padding: var(--ayb-sp-md) var(--ayb-sp-lg);
  background: var(--ayb-white);
  border: 1px solid var(--ayb-border);
  border-radius: var(--ayb-radius);
  box-shadow: var(--ayb-shadow);
  animation: ayb-preview-ein 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 110ms + 160ms);
}

.ayb-funnel__preview + .ayb-funnel__preview {
  margin-top: var(--ayb-sp-sm);
  /* Leichte Staffelung nach rechts erzeugt Tiefe statt einer starren Liste. */
  margin-left: calc(var(--i) * 1.25rem);
}

@keyframes ayb-preview-ein {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ayb-funnel__preview-nr {
  font-size: var(--ayb-fs-h3);
  font-weight: 700;
  color: var(--ayb-navy);
  opacity: 0.3;
}

.ayb-funnel__preview-titel {
  flex: 1;
  font-weight: 600;
  color: var(--ayb-heading);
}

.ayb-funnel__preview-anzahl {
  font-size: var(--ayb-fs-small);
  color: var(--ayb-text-light);
}

/* --- Frage -------------------------------------------------------------- */

.ayb-funnel__frage {
  max-width: 46rem;
  margin-inline: auto;
  padding-block: var(--ayb-sp-xl);
  text-align: center;
}

.ayb-funnel__block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--ayb-sp-sm);
  margin-bottom: var(--ayb-sp-md);
}

.ayb-funnel__block-name {
  padding: 0.25rem 0.875rem;
  background: rgba(42, 62, 102, 0.08);
  border-radius: 999px;
  font-size: var(--ayb-fs-small);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ayb-navy);
}

.ayb-funnel__block-zaehler {
  font-size: var(--ayb-fs-small);
  color: var(--ayb-text-light);
}

.ayb-funnel__text {
  margin-bottom: var(--ayb-sp-xl);
  font-size: var(--ayb-fs-h2);
  line-height: 1.35;
}

.ayb-funnel__antworten {
  display: grid;
  gap: var(--ayb-sp-md);
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  max-width: 32rem;
  margin-inline: auto;
}

.ayb-funnel__antwort {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ayb-sp-sm);
  padding: var(--ayb-sp-lg);
  background: var(--ayb-white);
  border: 2px solid var(--ayb-border);
  border-radius: var(--ayb-radius-lg);
  font-family: inherit;
  font-size: var(--ayb-fs-lead);
  font-weight: 600;
  color: var(--ayb-heading);
  cursor: pointer;
  transition: border-color var(--ayb-transition), transform var(--ayb-transition),
    box-shadow var(--ayb-transition), background-color var(--ayb-transition);
}

.ayb-funnel__antwort:hover {
  border-color: var(--ayb-navy);
  transform: translateY(-3px);
  box-shadow: var(--ayb-shadow-lg);
}

.ayb-funnel__antwort-icon {
  display: block;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ayb-border);
  border-radius: 50%;
  transition: border-color var(--ayb-transition), background-color var(--ayb-transition);
}

.ayb-funnel__antwort.is-gewaehlt {
  background: var(--ayb-navy);
  border-color: var(--ayb-navy);
  color: var(--ayb-white);
}

.ayb-funnel__antwort.is-gewaehlt .ayb-funnel__antwort-icon {
  background: var(--ayb-white);
  border-color: var(--ayb-white);
}

.ayb-funnel__zurueck {
  margin-top: var(--ayb-sp-lg);
  padding: var(--ayb-sp-xs) var(--ayb-sp-sm);
  background: none;
  border: 0;
  font-family: inherit;
  font-size: var(--ayb-fs-small);
  color: var(--ayb-text-light);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.ayb-funnel__zurueck:hover {
  color: var(--ayb-navy);
}

/* --- Auswertung --------------------------------------------------------- */

.ayb-funnel__auswertung {
  max-width: 44rem;
  margin-inline: auto;
  padding-block: var(--ayb-sp-xl);
  text-align: center;
}

.ayb-funnel__balken {
  margin-block: var(--ayb-sp-xl);
  text-align: left;
}

.ayb-funnel__balken-item + .ayb-funnel__balken-item {
  margin-top: var(--ayb-sp-lg);
}

.ayb-funnel__balken-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--ayb-sp-xs);
}

.ayb-funnel__balken-name {
  font-weight: 600;
  color: var(--ayb-heading);
}

.ayb-funnel__balken-wert {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ayb-navy);
}

.ayb-funnel__balken-spur {
  height: 10px;
  background: var(--ayb-border);
  border-radius: 999px;
  overflow: hidden;
}

.ayb-funnel__balken-fuellung {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--ayb-navy);
  transition: width 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Farbe signalisiert den Reifegrad — ohne dass der Text es aussprechen muss. */
.ayb-funnel__balken-fuellung[data-stufe='niedrig'] {
  background: linear-gradient(90deg, #b45309, #d97706);
}
.ayb-funnel__balken-fuellung[data-stufe='mittel'] {
  background: linear-gradient(90deg, var(--ayb-navy), #4a6fb0);
}
.ayb-funnel__balken-fuellung[data-stufe='hoch'] {
  background: linear-gradient(90deg, #15803d, #22a35a);
}

.ayb-funnel__deutung {
  max-width: 34rem;
  margin: 0 auto var(--ayb-sp-lg);
  font-size: var(--ayb-fs-lead);
}

/* --- Formular ----------------------------------------------------------- */

.ayb-funnel__formular {
  max-width: 40rem;
  margin-inline: auto;
  padding-block: var(--ayb-sp-xl);
}

.ayb-funnel__formular h2 {
  margin-bottom: var(--ayb-sp-lg);
  text-align: center;
}

.ayb-form__reihe {
  display: grid;
  gap: var(--ayb-sp-md);
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.ayb-form__feld {
  display: block;
  margin-bottom: var(--ayb-sp-md);
}

.ayb-form__feld--klein {
  max-width: 10rem;
}

.ayb-form__feld > span {
  display: block;
  margin-bottom: 0.375rem;
  font-size: var(--ayb-fs-small);
  font-weight: 600;
  color: var(--ayb-heading);
}

.ayb-form__feld input,
.ayb-form__feld select {
  width: 100%;
  padding: 0.8125rem 1rem;
  background: var(--ayb-white);
  border: 2px solid var(--ayb-border);
  border-radius: var(--ayb-radius);
  font-family: inherit;
  font-size: var(--ayb-fs-body);
  color: var(--ayb-heading);
  transition: border-color var(--ayb-transition), box-shadow var(--ayb-transition);
}

/* Das Auswahlfeld bekommt einen eigenen Pfeil. Die Systemvariante sieht in
   jedem Browser anders aus und passt zu keinem der übrigen Felder. */
.ayb-form__feld select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.75rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1.5 1.5L7 7L12.5 1.5' stroke='%232a3e66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 14px 9px;
}

.ayb-form__feld select:hover {
  border-color: var(--ayb-navy-light);
}

/* Solange nichts gewählt ist, wirkt der Text wie ein Platzhalter statt wie
   eine getroffene Entscheidung. */
.ayb-form__feld select:invalid,
.ayb-form__feld select option[value=''] {
  color: var(--ayb-text-light);
}

.ayb-form__feld select option {
  color: var(--ayb-heading);
}

.ayb-form__feld input:focus,
.ayb-form__feld select:focus {
  border-color: var(--ayb-navy);
  box-shadow: 0 0 0 4px rgba(42, 62, 102, 0.12);
  outline: none;
}

.ayb-form__check {
  display: flex;
  align-items: flex-start;
  gap: var(--ayb-sp-sm);
  margin-bottom: var(--ayb-sp-lg);
  font-size: var(--ayb-fs-small);
}

.ayb-form__check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--ayb-navy);
  flex-shrink: 0;
}

/* Außerhalb des sichtbaren Bereichs statt display:none — manche Bots
   ignorieren ausgeblendete Felder gezielt. */
.ayb-form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ayb-form__fehler {
  margin-bottom: var(--ayb-sp-sm);
  color: #b42318;
  font-size: var(--ayb-fs-small);
  font-weight: 600;
}

.ayb-form__fehler:empty {
  display: none;
}

.ayb-form__submit {
  width: 100%;
  position: relative;
}

.ayb-form__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--ayb-white);
  border-radius: 50%;
  animation: ayb-dreh 700ms linear infinite;
}

.ayb-form__submit.is-laedt .ayb-form__spinner {
  display: block;
}

.ayb-form__submit.is-laedt {
  pointer-events: none;
  opacity: 0.85;
}

@keyframes ayb-dreh {
  to {
    transform: rotate(360deg);
  }
}

.ayb-form__hinweis {
  margin-top: var(--ayb-sp-md);
  margin-bottom: 0;
  font-size: var(--ayb-fs-small);
  color: var(--ayb-text-light);
  text-align: center;
}

/* --- Ohne JavaScript ---------------------------------------------------- */

/* Sind alle Schritte sichtbar, ist der Text vollständig lesbar. Das gilt
   für Crawler ebenso wie für Nutzer mit abgeschaltetem JavaScript. */
.no-js .ayb-funnel__step {
  display: block;
  margin-bottom: var(--ayb-sp-xl);
  padding-bottom: var(--ayb-sp-xl);
  border-bottom: 1px solid var(--ayb-border);
}
