/* ============================================
   KAMOLAR — Intake Quiz Funnel Styles
   ============================================ */

/* ===== FUNNEL PAGE LAYOUT ===== */
.funnel-page {
  min-height: 100vh;
  background: var(--color-bg);
  padding-top: 4rem; /* account for fixed header */
}

.funnel-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 4rem);
  padding: var(--space-8) var(--space-6);
}

/* ===== FUNNEL CARD ===== */
.funnel-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(212, 175, 55, 0.06);
  width: 100%;
  max-width: 640px;
  overflow: hidden;
}

/* ===== PROGRESS BAR ===== */
.funnel-progress {
  padding: var(--space-5) var(--space-8) 0;
}

.funnel-progress-bar-track {
  width: 100%;
  height: 4px;
  background: var(--color-surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.funnel-progress-bar-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

.funnel-progress-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-2);
  text-align: right;
}

/* ===== STEP WRAPPER ===== */
.funnel-steps-wrapper {
  position: relative;
  overflow: hidden;
}

.funnel-step {
  padding: var(--space-8);
  display: none;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.funnel-step.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

.funnel-step.exit-left {
  display: block;
  opacity: 0;
  transform: translateX(-40px);
  pointer-events: none;
}

/* ===== STEP HEADER ===== */
.funnel-step-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

.funnel-step h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: #fff;
  margin-bottom: var(--space-3);
  line-height: 1.25;
}

.funnel-step-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  max-width: 100%;
}

/* ===== WELCOME STEP ===== */
.funnel-welcome-icon {
  width: 64px;
  height: 64px;
  background: var(--color-accent-glow);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  color: var(--color-accent);
}

.funnel-welcome-icon svg {
  width: 28px;
  height: 28px;
}

/* ===== OPTION CARDS ===== */
.funnel-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.funnel-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface-2);
  border: 2px solid var(--color-border-muted);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.funnel-option:hover {
  border-color: var(--color-accent);
  background: var(--color-surface-3);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.08);
}

.funnel-option.selected {
  border-color: var(--color-accent);
  background: rgba(212, 175, 55, 0.06);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.2), 0 4px 20px rgba(212, 175, 55, 0.1);
}

.funnel-option-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-accent-glow);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  flex-shrink: 0;
  transition: background 0.2s;
}

.funnel-option.selected .funnel-option-icon {
  background: rgba(212, 175, 55, 0.2);
}

.funnel-option-icon svg {
  width: 18px;
  height: 18px;
}

.funnel-option-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
}

.funnel-option-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 0.2em;
  font-weight: 400;
}

.funnel-option-check {
  margin-left: auto;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-accent);
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.funnel-option.selected .funnel-option-check {
  opacity: 1;
}

/* Two-column option grid for budget step */
.funnel-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.funnel-options-grid .funnel-option {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-5);
}

.funnel-options-grid .funnel-option-check {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  margin-left: 0;
}

.funnel-options-grid .funnel-option {
  position: relative;
}

/* ===== TEXT INPUT STEP ===== */
.funnel-input-field {
  margin-bottom: var(--space-6);
}

.funnel-input-field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.funnel-input-field input[type="text"],
.funnel-input-field input[type="email"],
.funnel-input-field input[type="tel"],
.funnel-input-field input[type="url"] {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-2);
  border: 2px solid var(--color-border-muted);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.funnel-input-field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.funnel-input-field input::placeholder {
  color: var(--color-text-faint);
}

/* ===== FORM FIELDS ===== */
.funnel-form-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

/* ===== CONSENT ===== */
.funnel-consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: var(--space-6);
}

.funnel-consent input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  margin-top: 0.1em;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.funnel-consent-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.funnel-consent-text a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== BUTTONS ROW ===== */
.funnel-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.funnel-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.funnel-btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.funnel-btn-primary:disabled {
  opacity: 0.5;
  pointer-events: none;
  transform: none;
}

.funnel-btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-muted);
  cursor: pointer;
}

.funnel-btn-back:hover {
  border-color: var(--color-border);
  color: var(--color-text);
}

.funnel-skip-link {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--space-3);
  margin-left: auto;
}

.funnel-skip-link:hover {
  color: var(--color-text-muted);
}

/* ===== THANK YOU SCREEN ===== */
.funnel-thankyou {
  display: none;
  text-align: center;
  padding: var(--space-12) var(--space-8);
}

.funnel-thankyou.active {
  display: block;
}

.funnel-thankyou-icon {
  width: 72px;
  height: 72px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  color: var(--color-success);
}

.funnel-thankyou-icon svg {
  width: 32px;
  height: 32px;
}

.funnel-thankyou h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: #fff;
  margin-bottom: var(--space-4);
}

.funnel-thankyou p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 420px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

/* ===== DIVIDER ===== */
.funnel-divider {
  height: 1px;
  background: var(--color-divider);
  margin: 0 var(--space-8);
}

/* ===== STEP TRANSITION ANIMATION ===== */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.funnel-step.slide-in-right {
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.funnel-step.slide-in-left {
  animation: slideInLeft 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  .funnel-body {
    padding: var(--space-4) var(--space-4) var(--space-8);
    align-items: flex-start;
    padding-top: var(--space-6);
  }

  .funnel-card {
    border-radius: var(--radius-lg);
  }

  .funnel-step {
    padding: var(--space-6);
  }

  .funnel-progress {
    padding: var(--space-4) var(--space-6) 0;
  }

  .funnel-step h2 {
    font-size: var(--text-lg);
  }

  .funnel-options-grid {
    grid-template-columns: 1fr;
  }

  .funnel-actions {
    flex-direction: column-reverse;
  }

  .funnel-btn-primary {
    width: 100%;
    justify-content: center;
  }

  .funnel-btn-back {
    width: 100%;
    justify-content: center;
  }

  .funnel-skip-link {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  .funnel-divider {
    margin: 0 var(--space-6);
  }
}
