:root {
  --bg-0: #0a0d12;
  --bg-1: #10151d;
  --card: rgba(255,255,255,0.055);
  --card-border: rgba(255,255,255,0.09);
  --card-hover: rgba(255,255,255,0.09);
  --text: #f3f6f8;
  --text-dim: #9aa5b1;
  --accent: #22d3ee;
  --accent-2: #a3e635;
  --accent-grad: linear-gradient(135deg, #22d3ee 0%, #34d399 55%, #a3e635 100%);
  --danger: #fb7185;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background: var(--bg-0);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(34,211,238,0.14), transparent 70%),
    radial-gradient(50% 35% at 85% 100%, rgba(163,230,53,0.10), transparent 70%),
    var(--bg-0);
  display: flex;
  justify-content: center;
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.phone-frame {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

/* On wide viewports, present as a contained mobile card, not a stretched desktop layout */
@media (min-width: 560px) {
  body { padding: 32px 16px; }
  .phone-frame {
    min-height: min(860px, calc(100dvh - 64px));
    border-radius: 34px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 40px 100px -30px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.02);
    overflow: hidden;
    background: var(--bg-1);
  }
}

.quiz-header[hidden] { display: none; }

.quiz-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(18px + var(--safe-top)) 20px 14px;
  flex-shrink: 0;
}

.back-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, color .15s ease;
}
.back-btn:active { transform: scale(0.88); }
.back-btn.is-hidden { opacity: 0; pointer-events: none; }

.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent-grad);
  box-shadow: 0 0 12px rgba(34,211,238,0.55);
  transition: width .5s cubic-bezier(.22,1,.36,1);
}

.step-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quiz-stage {
  flex: 1;
  position: relative;
  padding: 8px 22px calc(28px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.step {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
}

.step.enter-right { animation: slideInRight .42s cubic-bezier(.22,1,.36,1) both; }
.step.enter-left { animation: slideInLeft .42s cubic-bezier(.22,1,.36,1) both; }

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

/* ---------- Welcome ---------- */
.welcome-step {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding-top: 20px;
}

.hero-badge {
  width: 132px;
  height: 132px;
  margin-bottom: 18px;
  filter: drop-shadow(0 12px 30px rgba(34,211,238,0.28));
  animation: floaty 4.5s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent-2);
  background: rgba(163,230,53,0.1);
  border: 1px solid rgba(163,230,53,0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.welcome-step h1 {
  font-size: 27px;
  line-height: 1.28;
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.welcome-step p {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 30px;
  max-width: 360px;
}

.trust-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
}
.trust-row svg { flex-shrink: 0; color: var(--accent-2); }

/* ---------- Question steps ---------- */
.q-kicker {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin: 10px 0 8px;
}
.q-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.32;
  margin: 0 0 22px;
  letter-spacing: -0.01em;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  transition: transform .18s cubic-bezier(.22,1,.36,1), background .18s ease, border-color .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.option-card:active { transform: scale(0.97); }
.option-card:hover { background: var(--card-hover); }

.option-card .emoji {
  font-size: 22px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
}

.option-card .label { flex: 1; }
.option-card .sub {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 2px;
}

.option-card .check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s cubic-bezier(.22,1,.36,1);
}
.option-card .check svg {
  opacity: 0;
  transform: scale(0.4);
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
}

.option-card.is-selected {
  border-color: rgba(34,211,238,0.55);
  background: linear-gradient(135deg, rgba(34,211,238,0.14), rgba(163,230,53,0.08));
  box-shadow: 0 0 0 1px rgba(34,211,238,0.25), 0 8px 24px -8px rgba(34,211,238,0.35);
}
.option-card.is-selected .check {
  background: var(--accent-grad);
  border-color: transparent;
}
.option-card.is-selected .check svg { opacity: 1; transform: scale(1); color: #04121a; }

.option-card.is-selected { animation: pop .38s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

.spacer { flex: 1; }

/* ---------- Contact form ---------- */
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input::placeholder { color: rgba(255,255,255,0.28); }
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(34,211,238,0.14);
}
.field input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(251,113,133,0.12);
}
.field .error-msg {
  font-size: 12.5px;
  color: var(--danger);
  margin-top: 6px;
  min-height: 16px;
}

.privacy-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 4px 0 22px;
}
.privacy-note svg { flex-shrink: 0; margin-top: 2px; color: var(--accent-2); }

/* ---------- Buttons ---------- */
.btn-primary {
  appearance: none;
  border: none;
  width: 100%;
  padding: 17px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent-grad);
  color: #04121a;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform .15s cubic-bezier(.22,1,.36,1), box-shadow .15s ease, opacity .15s ease;
  box-shadow: 0 10px 26px -10px rgba(34,211,238,0.55);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-primary .spin {
  display: inline-block;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2.5px solid rgba(4,18,26,0.35);
  border-top-color: #04121a;
  animation: spin .7s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Thank you ---------- */
.thanks-step {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.check-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  box-shadow: 0 0 0 10px rgba(34,211,238,0.08), 0 20px 40px -14px rgba(34,211,238,0.5);
  animation: badgeIn .55s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes badgeIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.check-badge svg {
  color: #04121a;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw .45s ease .25s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.thanks-step h1 {
  font-size: 25px;
  font-weight: 800;
  margin: 0 0 12px;
}
.thanks-step p {
  font-size: 15.5px;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 340px;
  margin: 0 0 8px;
}
.thanks-step .manager-note {
  margin-top: 22px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--card-border);
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.manager-note .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent-grad);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  color: #04121a;
}

@media (max-height: 700px) {
  .hero-badge { width: 100px; height: 100px; margin-bottom: 10px; }
  .welcome-step h1 { font-size: 23px; }
}
