/* Funnel: Bootstrap 5 companion — mobile-first, soft UI */
:root {
  --grf-bg: #eef1f8;
  --grf-card: #ffffff;
  --grf-text: #1e293b;
  --grf-muted: #64748b;
  --grf-primary: #4f46e5;
  --grf-primary-hover: #4338ca;
  --grf-star: #f59e0b;
  --grf-star-empty: #cbd5e1;
  --grf-radius: 1.25rem;
  --grf-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

html {
  scroll-behavior: smooth;
}

body.funnel-body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--grf-text);
  background: radial-gradient(120% 80% at 50% -20%, #e0e7ff 0%, var(--grf-bg) 45%, #f8fafc 100%);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.funnel-body .star-btn.btn-link {
  color: var(--grf-star-empty);
}

.funnel-body .star-btn.btn-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
}

.funnel-main {
  width: 100%;
}

.funnel-card {
  background: var(--grf-card);
  border-radius: var(--grf-radius);
  box-shadow: var(--grf-shadow);
}

.funnel-brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, #6366f1, #4f46e5);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

.funnel-title {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--grf-text);
}

.funnel-subtitle {
  color: var(--grf-muted);
  font-size: 0.95rem;
}

/* Step panels — SPA-like transitions */
.funnel-panel {
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.funnel-panel.d-none {
  display: none !important;
}

.funnel-panel.grf-fade-in {
  animation: grfFadeIn 0.32s ease-out both;
}

@keyframes grfFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .funnel-panel {
    transition: none;
  }

  .funnel-panel.grf-fade-in {
    animation: none;
  }

  .star-btn,
  .star-btn .funnel-star-icon,
  .option-card {
    transition: none;
  }
}

/* Stars — min 44×44 tap targets (WCAG) */
.funnel-stars {
  gap: 0.35rem;
}

.star-btn {
  min-width: 48px;
  min-height: 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--grf-star-empty);
  transition: color 0.18s ease, transform 0.14s ease, background 0.18s ease;
  border-radius: 14px !important;
}

.star-btn .funnel-star-icon {
  font-size: 1.85rem;
  line-height: 1;
  transition: transform 0.14s ease, color 0.18s ease;
}

.star-btn:hover,
.star-btn:focus-visible {
  color: var(--grf-star);
  background: rgba(245, 158, 11, 0.12);
  transform: scale(1.06);
}

.star-btn:active {
  transform: scale(0.96);
}

.star-btn.is-selected,
.star-btn.is-preview {
  color: var(--grf-star);
}

.star-btn.is-selected .funnel-star-icon,
.star-btn.is-preview .funnel-star-icon {
  transform: scale(1.08);
}

/* Option list */
.option-card {
  border-radius: 14px !important;
  white-space: normal;
  line-height: 1.45;
  transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.option-card:active {
  transform: scale(0.99);
}

.option-card.is-selected {
  border-color: var(--grf-primary) !important;
  background: rgba(79, 70, 229, 0.08) !important;
  color: var(--grf-text) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Forms — avoid iOS input zoom (16px+) */
.funnel-body .form-control,
.funnel-body .form-select {
  font-size: 1rem;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}

.funnel-body textarea.form-control {
  min-height: 140px;
}

/* Full-width primary actions */
.funnel-body .btn-funnel-primary {
  background: linear-gradient(180deg, var(--grf-primary) 0%, var(--grf-primary-hover) 100%);
  border: none;
  border-radius: 14px;
  font-weight: 600;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.35);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.funnel-body .btn-funnel-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.42);
}

.funnel-body .btn-funnel-primary:active {
  transform: scale(0.98);
}

.funnel-body .btn-funnel-primary:disabled {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.funnel-body .btn-funnel-ghost {
  border-radius: 14px;
  font-weight: 600;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.funnel-body .btn-funnel-ghost:active {
  transform: scale(0.98);
}

/* Internal badge */
.funnel-badge-internal {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
  border: 1px solid rgba(249, 115, 22, 0.35);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
}

.min-hint {
  min-height: 1.35em;
}

@media (min-width: 576px) {
  .star-btn {
    min-width: 52px;
    min-height: 52px;
    width: 52px;
    height: 52px;
  }

  .star-btn .funnel-star-icon {
    font-size: 2rem;
  }
}
