/* ─── Reset & Base ─────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #1a1a2e;
  --navy-light: #222244;
  --navy-mid: #2a2a4a;
  --teal: #00d4aa;
  --teal-dark: #00b894;
  --teal-glow: rgba(0, 212, 170, 0.15);
  --white: #ffffff;
  --gray-100: #f5f5f7;
  --gray-200: #e8e8ed;
  --gray-300: #c7c7cc;
  --gray-400: #8e8e93;
  --gray-500: #636366;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);
  --danger: #ff6b6b;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--navy);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Progress Bar ─────────────────────────────────────────────────────────── */

.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--navy-light);
  z-index: 100;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  border-radius: 0 2px 2px 0;
}

/* ─── Container ────────────────────────────────────────────────────────────── */

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Screens ──────────────────────────────────────────────────────────────── */

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  animation: fadeIn 0.4s ease-out;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@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);
  }
}

.slide-in-right {
  animation: slideInRight 0.35s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.35s ease-out;
}

/* ─── Landing Page ─────────────────────────────────────────────────────────── */

.landing {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 60px;
}

.landing-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.landing h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--white), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing .subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 440px;
  line-height: 1.5;
}

.landing .meta {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.landing .meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.landing .meta-item .icon {
  color: var(--teal);
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: var(--navy);
  box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 212, 170, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--navy-mid);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 2px solid var(--teal);
}

.btn-outline:hover {
  background: var(--teal-glow);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.9rem;
}

/* ─── Question Screen ──────────────────────────────────────────────────────── */

.question-screen {
  padding-top: 32px;
}

.question-counter {
  font-size: 0.85rem;
  color: var(--teal);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.question-text {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 32px;
}

/* ─── Options ──────────────────────────────────────────────────────────────── */

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  flex: 1;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--navy-light);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1rem;
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-height: 52px;
}

.option:hover {
  border-color: rgba(0, 212, 170, 0.3);
  background: var(--navy-mid);
}

.option.selected {
  border-color: var(--teal);
  background: var(--teal-glow);
}

.option-radio {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 2px solid var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.option.selected .option-radio {
  border-color: var(--teal);
  background: var(--teal);
}

.option.selected .option-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--navy);
}

/* Checkbox style for multi-select */
.option-checkbox {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 6px;
  border: 2px solid var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.option.selected .option-checkbox {
  border-color: var(--teal);
  background: var(--teal);
}

.option.selected .option-checkbox::after {
  content: '\2713';
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.option-label {
  flex: 1;
}

/* Other text input inside option */
.other-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gray-400);
  color: var(--text-primary);
  font-size: 1rem;
  padding: 4px 0;
  outline: none;
  transition: border-color var(--transition);
}

.other-input:focus {
  border-color: var(--teal);
}

.other-input::placeholder {
  color: var(--text-muted);
}

/* ─── Slider (Q10) ─────────────────────────────────────────────────────────── */

.slider-container {
  margin-bottom: 32px;
  flex: 1;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.slider-value {
  text-align: center;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--teal);
  margin-bottom: 24px;
  transition: transform 0.15s ease;
}

.slider-track {
  position: relative;
  width: 100%;
  padding: 20px 0;
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--navy-light);
  outline: none;
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal);
  border: 3px solid var(--navy);
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type='range']::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

input[type='range']::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal);
  border: 3px solid var(--navy);
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.4);
  cursor: pointer;
}

.slider-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 12px;
}

/* ─── Textarea (open-ended) ────────────────────────────────────────────────── */

.textarea-container {
  flex: 1;
  margin-bottom: 32px;
}

.quiz-textarea {
  width: 100%;
  min-height: 150px;
  padding: 16px;
  background: var(--navy-light);
  border: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}

.quiz-textarea:focus {
  border-color: var(--teal);
}

.quiz-textarea::placeholder {
  color: var(--text-muted);
}

.textarea-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ─── Navigation Buttons ───────────────────────────────────────────────────── */

.nav-buttons {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
  padding-bottom: 24px;
}

.nav-buttons .btn {
  flex: 1;
}

.nav-buttons .btn-back {
  flex: 0 0 auto;
  padding: 16px 20px;
}

/* ─── Lead Form ────────────────────────────────────────────────────────────── */

.lead-form {
  padding-top: 32px;
}

.lead-form h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.lead-form .form-subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group label .required {
  color: var(--teal);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--navy-light);
  border: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus {
  border-color: var(--teal);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input.error {
  border-color: var(--danger);
}

.error-msg {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 6px;
  display: none;
}

.form-input.error + .error-msg {
  display: block;
}

/* ─── Loading Screen ───────────────────────────────────────────────────────── */

.loading-screen {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid var(--navy-light);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 24px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* ─── Thank You Screen ─────────────────────────────────────────────────────── */

.thankyou-screen {
  align-items: center;
  text-align: center;
  padding-top: 60px;
}

.thankyou-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--navy);
  font-size: 2.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.thankyou-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
}

.thankyou-message {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

.thankyou-card {
  background: linear-gradient(135deg, var(--navy-light), var(--navy-mid));
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 100%;
  margin-bottom: 40px;
  border: 1px solid rgba(0, 212, 170, 0.15);
  box-shadow: var(--shadow);
}

.thankyou-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.thankyou-card p:last-child {
  margin-bottom: 0;
}

.thankyou-timeline {
  color: var(--teal) !important;
  font-size: 1.05rem !important;
}

.thankyou-timeline strong {
  color: var(--white);
}

.thankyou-footer {
  text-align: center;
}

.thankyou-footer .brand {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 16px;
}

.thankyou-footer .brand a {
  color: var(--teal);
  text-decoration: none;
}

/* ─── Footer ───────────────────────────────────────────────────────────────── */

.footer {
  text-align: center;
  padding: 20px 0;
  margin-top: auto;
}

.footer .brand {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer .brand a {
  color: var(--teal);
  text-decoration: none;
}

/* ─── Multi-select hint ────────────────────────────────────────────────────── */

.multi-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ─── Desktop tweaks ───────────────────────────────────────────────────────── */

@media (min-width: 768px) {
  .container {
    padding: 40px 24px;
  }

  .landing h1 {
    font-size: 2.5rem;
  }

  .question-text {
    font-size: 1.5rem;
  }

  .option {
    padding: 18px 22px;
  }
}

/* ─── Safe area for mobile ─────────────────────────────────────────────────── */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .nav-buttons {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}
