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

/* ── Tokens (Light theme) ── */
:root {
  --bg:             #ffffff;
  --bg-soft:        #f7f9fc;
  --surface:        #ffffff;
  --surface-2:      #f1f5f9;
  --border:         rgba(15, 23, 42, 0.10);
  --border-hover:   rgba(15, 23, 42, 0.20);
  --primary:        #09a5d6;
  --primary-dim:    rgba(9, 165, 214, 0.10);
  --primary-hover:  #0bb8ef;
  --text:           #0f172a;
  --text-2:         #475569;
  --text-3:         #94a3b8;
  --error:          #dc2626;
  --error-bg:       rgba(220, 38, 38, 0.08);
  --error-border:   rgba(220, 38, 38, 0.25);
  --success:        #16a34a;
  --radius:         16px;
  --radius-sm:      12px;
  --shadow-sm:      0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md:      0 4px 16px rgba(15, 23, 42, 0.08);
}

/* ── Base ── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100dvh;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Soft ambient glow - top */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  height: 640px;
  background: radial-gradient(ellipse, rgba(9, 165, 214, 0.10) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ── Shell ── */
.quiz-shell {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 540px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
  position: relative;
  z-index: 1;
}

/* ── Header ── */
.quiz-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
  flex-shrink: 0;
}

.brand-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.intro-logo {
  width: 200px;
  max-width: 70%;
  height: auto;
  margin-bottom: 28px;
  display: block;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #38bdf8);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── Main ── */
.quiz-main {
  flex: 1;
  position: relative;
  padding: 36px 20px 16px;
  z-index: 1;
}

/* ── Steps ── */
.step { display: none; }

.step.active {
  display: block;
  animation: stepForward 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.step.slide-back.active {
  animation: stepBack 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stepForward {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

.step-inner { max-width: 500px; }

.step-inner--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 30px;
}

/* Big emoji at top of each step */
.step-emoji {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 18px;
  display: inline-block;
  animation: emojiBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes emojiBounce {
  0%   { transform: scale(0.6) translateY(-10px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.step-heading {
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--text);
}

.step-sub {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* ── Tiles ── */
.tile-grid {
  display: grid;
  gap: 12px;
}
.tile-grid--2 { grid-template-columns: 1fr 1fr; }
.tile-grid--1 { grid-template-columns: 1fr; }

.tile {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  font-family: inherit;
  transition:
    border-color 0.18s ease,
    background   0.18s ease,
    box-shadow   0.18s ease,
    transform    0.1s  ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  outline: none;
  box-shadow: var(--shadow-sm);
}

.tile--row {
  padding: 18px 20px;
}

.tile:hover {
  border-color: var(--primary);
  background: var(--bg-soft);
  box-shadow: var(--shadow-md);
}

.tile:active { transform: scale(0.98); }

.tile.selected {
  border-color: var(--primary);
  background: var(--primary-dim);
  box-shadow: 0 0 0 3px var(--primary-dim), var(--shadow-md);
}

.tile-emoji {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.tile-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
}

/* ── Forms ── */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.req     { color: var(--primary); }
.optional { color: var(--text-3); font-weight: 400; }

.field {
  width: 100%;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  padding: 16px 18px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.field::placeholder { color: var(--text-3); }

.field:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-dim);
}

.field--xl {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
  padding: 24px;
}

.field--error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px var(--error-bg) !important;
}

.field-error-text {
  font-size: 12px;
  color: var(--error);
  font-weight: 500;
}

.field-hint {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

/* ── Multi-vehicle UI ── */
.vehicle-block + .vehicle-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.vehicle-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.vehicle-block-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

.btn-remove-vehicle {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--error);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

.btn-remove-vehicle:hover {
  background: var(--error-bg);
}

.btn-add-vehicle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 2px dashed var(--border);
  color: var(--text-2);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin: 18px 0 8px;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-add-vehicle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-dim);
}

.add-icon {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

/* ── Action rows ── */
.action-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* ── Buttons ── */
.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(9, 165, 214, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 22px rgba(9, 165, 214, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-submit {
  background: linear-gradient(135deg, var(--primary) 0%, #0d88bb 100%);
  font-size: 17px;
  padding: 20px;
}

.btn-submit:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #0e98d1 100%);
}

.btn-spinner {
  display: inline-flex;
  animation: spin 0.75s linear infinite;
}

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

/* ── Footer ── */
.quiz-footer {
  padding: 10px 20px calc(14px + env(safe-area-inset-bottom, 0));
  z-index: 1;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-3);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  visibility: hidden;
  transition: color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

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

/* ── Error banner ── */
.error-msg {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  padding: 12px 14px;
  margin-bottom: 14px;
}

/* ── Privacy note ── */
.privacy-note {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin-top: 14px;
  line-height: 1.65;
}

/* TCPA consent block */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 10px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}
.consent-checkbox {
  flex-shrink: 0;
  margin-top: 3px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}
.consent-text {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.55;
}

/* ── Success ── */
.success-icon {
  width: 72px;
  height: 72px;
  color: var(--success);
  margin-bottom: 22px;
  animation: popIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.success-msg {
  max-width: 340px;
  margin-bottom: 24px;
}

.success-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}

.summary-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

/* Text Us button — primary CTA on success page */
.btn-text-us {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  margin: 22px auto 0;
  padding: 16px 22px;
  background: #007aff;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn-text-us:hover  { background: #0a84ff; box-shadow: 0 8px 26px rgba(0, 122, 255, 0.45); }
.btn-text-us:active { transform: scale(0.98); }

.btn-home-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: underline;
  opacity: 0.8;
}
.btn-home-link:hover { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 360px) {
  .tile-grid--2 { grid-template-columns: 1fr; }
  .step-heading { font-size: 20px; }
  .step-emoji   { font-size: 40px; }
}

@media (min-width: 540px) {
  .quiz-shell {
    box-shadow: 0 0 60px rgba(15, 23, 42, 0.06);
  }
}
