/* ============================================================
   eCaupo · Funnel-Baustein
   Nutzt die bestehenden Design-Tokens (tokens.css) und Klassen
   (.ec-btn, .ec-badge) — keine neuen Farben/Radien erfunden.
   ============================================================ */

.funnel-section { background: var(--ec-mist); }

.funnelcontent {
  position: relative;
  background: var(--ec-paper);
  border: 1px solid var(--ec-line);
  border-radius: var(--ec-r-lg);
  box-shadow: var(--ec-shadow-card);
  padding: clamp(28px, 4vw, 48px);
  min-height: 160px;
}

/* ---------- Schritt-Kopf ---------- */

.funnel-subline {
  font-family: var(--ec-font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--ec-muted);
  margin-bottom: 8px;
}
.funnel-h1 {
  font-family: var(--ec-font-display);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 14px;
}
.funnel-content { margin-bottom: 24px; color: var(--ec-ink); }

.funnel-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  color: var(--ec-muted);
  font-family: var(--ec-font-text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 0 0 20px;
}
.funnel-back:hover { color: var(--ec-green-700); }

.funnel-error {
  color: #B3261E;
  font-size: 14px;
  font-weight: 600;
  margin: 4px 0 16px;
}

/* ---------- Auswahl-Optionen (design 1/2/5/6) ---------- */

.funnel-options {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}
.funnel-options--cols-2 { grid-template-columns: repeat(2, 1fr); }
.funnel-options--cols-3 { grid-template-columns: repeat(2, 1fr); }
.funnel-options--cols-4 { grid-template-columns: repeat(2, 1fr); }
.funnel-options--list,
.funnel-options--nomedia { grid-template-columns: 1fr; }

@media (min-width: 760px) {
  .funnel-options--cols-3 { grid-template-columns: repeat(3, 1fr); }
  .funnel-options--cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.funnel-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  background: #fff;
  border: 2px solid #CFE0CB;
  border-radius: var(--ec-r);
  padding: 16px;
  cursor: pointer;
  font-family: var(--ec-font-text);
  font-size: 15px;
  font-weight: 600;
  color: var(--ec-ink);
  box-shadow: var(--ec-shadow-card);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}
.funnel-option:hover {
  border-color: var(--ec-green-600);
  background: #F3F9F0;
  transform: translateY(-3px);
  box-shadow: 0 20px 42px rgba(22,36,28,.22);
}
.funnel-option.is-selected {
  border-color: var(--ec-green-600);
  box-shadow: 0 0 0 2px var(--ec-green-600) inset, var(--ec-shadow-card);
  background: #EAF4E4;
}
.funnel-options--list .funnel-option,
.funnel-options--nomedia .funnel-option { flex-direction: row; align-items: center; }

.funnel-option__media {
  display: block;
  width: 100%;
  border-radius: var(--ec-r-sm);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
.funnel-option__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.funnel-option__body { line-height: 1.4; }

.funnel-continue { margin-top: 4px; }

/* ---------- Formular-Schritt (awsform) ---------- */

.funnel-form { display: grid; gap: 20px; margin-top: 4px; }
.funnel-field__label { display: block; font-weight: 700; margin-bottom: 6px; }
.funnel-field__descr { color: var(--ec-muted); font-size: 14px; margin-bottom: 8px; }
.funnel-input {
  width: 100%;
  font-family: var(--ec-font-text);
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--ec-line);
  border-radius: var(--ec-r-sm);
  background: #fff;
  color: var(--ec-ink);
}
.funnel-input:focus { outline: 2px solid var(--ec-green-500); outline-offset: 1px; }
textarea.funnel-input { min-height: 110px; resize: vertical; }
.funnel-choice { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 15px; }
.funnel-field__error { color: #B3261E; font-size: 13px; margin-top: 6px; }
.funnel-submit-form { margin-top: 4px; }

/* ---------- Abschluss (awsfinal) ---------- */

.funnel-step--final { text-align: center; padding: 12px 0; }
.funnel-step--celebrate .funnel-h1 { color: var(--ec-green-700); }

/* ---------- Popup-Modus ---------- */

.funnel-opener {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 160;
}

.funnel-overlay {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 26, 20, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease;
}
.funnel-overlay.is-open { opacity: 1; visibility: visible; }
.funnel-overlay__panel {
  position: relative;
  width: min(640px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--ec-paper);
  border-radius: var(--ec-r-lg);
  box-shadow: var(--ec-shadow-xl);
  padding: clamp(24px, 4vw, 40px);
}
.funnel-overlay .funnelcontent {
  border: 0;
  box-shadow: none;
  padding: 0;
  min-height: 0;
}
.funnel-overlay__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: 0;
  font-size: 30px;
  line-height: 1;
  color: var(--ec-muted);
  cursor: pointer;
  padding: 4px 8px;
}
.funnel-overlay__close:hover { color: var(--ec-ink); }

/* ---------- Konfetti ---------- */

.funnel-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.funnel-confetti__piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: funnel-confetti-fall 1.8s ease-in forwards;
}
@keyframes funnel-confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(320px) rotate(280deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .funnel-option, .funnel-overlay { transition: none; }
  .funnel-confetti__piece { animation: none; display: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .funnel-opener { right: 16px; bottom: 16px; }
  .funnel-option__media { aspect-ratio: 16 / 9; }
}
