:root {
  --navy: #1a1830;
  --navy-soft: #302d4d;
  --orange: #ff6a2c;
  --orange-deep: #ec4c1e;
  --orange-soft: #ffa45f;
  --green: #25d366;
  --bg: #faf9fc;
  --card-bg: #ffffff;
  --text: #101114;
  --text-muted: #5b5a68;
  --border: #ece9f2;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --font-head: "Space Grotesk", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --shadow-card: 0 30px 60px -30px rgba(26, 24, 48, 0.3), 0 8px 20px -12px rgba(26, 24, 48, 0.12);
  --shadow-btn: 0 14px 28px -10px rgba(255, 106, 44, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* ---------- Ambient background ---------- */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
}
body::before {
  width: 480px;
  height: 480px;
  top: -180px;
  left: -160px;
  background: radial-gradient(circle, rgba(255, 106, 44, 0.35), rgba(255, 106, 44, 0) 70%);
  animation: drift1 16s ease-in-out infinite alternate;
}
body::after {
  width: 520px;
  height: 520px;
  bottom: -220px;
  right: -180px;
  background: radial-gradient(circle, rgba(26, 24, 48, 0.25), rgba(26, 24, 48, 0) 70%);
  animation: drift2 18s ease-in-out infinite alternate;
}
@keyframes drift1 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.08); }
}
@keyframes drift2 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-30px, -25px) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

.topbar {
  padding: 18px 24px;
  display: flex;
  align-items: center;
}
.logo { height: 32px; width: auto; filter: drop-shadow(0 4px 10px rgba(26, 24, 48, 0.12)); }

#app {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 40px;
}

.screen {
  display: none;
  width: 100%;
  max-width: 640px;
}
.screen.active { display: block; animation: fadeUp .45s cubic-bezier(.16,1,.3,1); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 106, 44, 0.06), transparent 55%),
    var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--orange-soft), var(--navy));
  background-size: 200% 100%;
  animation: sheen 6s linear infinite;
}
@keyframes sheen {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--orange-deep);
  background: linear-gradient(135deg, rgba(255, 106, 44, 0.14), rgba(255, 164, 95, 0.1));
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  border: 1px solid rgba(255, 106, 44, 0.18);
}

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--navy);
  margin: 0 0 12px;
  line-height: 1.15;
}

h1 {
  font-size: 34px;
  font-weight: 700;
  background: linear-gradient(120deg, var(--navy) 40%, var(--orange-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 { font-size: 26px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }

.lead {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 16px;
}

.points {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.points li {
  font-size: 15px;
  color: var(--text-muted);
  padding-left: 22px;
  position: relative;
}
.points li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--orange);
  font-weight: 700;
}

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius-pill);
  padding: 16px 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 45%, transparent 60%);
  transform: translateX(-120%);
  transition: transform .6s ease;
  z-index: 1;
}
.btn:hover::after { transform: translateX(120%); }

.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #201002;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { box-shadow: 0 18px 34px -10px rgba(255, 106, 44, 0.65); filter: brightness(1.03); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-outline:hover { background: rgba(26, 24, 48, 0.05); }
.btn-lg { width: 100%; padding: 18px 28px; font-size: 16px; }

/* ---------- Quiz ---------- */
.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.progress-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(26, 24, 48, 0.08);
}
.progress-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--orange-soft), var(--orange));
  background-size: 200% 100%;
  border-radius: var(--radius-pill);
  transition: width .4s cubic-bezier(.65,0,.35,1);
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  animation: shimmer 1.8s ease-in-out infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.category-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--navy);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.question-text { font-size: 21px; margin-bottom: 6px; }
.question-sub { font-size: 14px; color: var(--text-muted); margin: 0 0 20px; }

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

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: #fff;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.option:hover {
  border-color: var(--orange-soft);
  background: #fff8f4;
  transform: translateX(3px);
  box-shadow: 0 8px 20px -14px rgba(255, 106, 44, 0.5);
}
.option .opt-letter {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.option.selected {
  border-color: var(--orange);
  background: linear-gradient(135deg, rgba(255, 106, 44, 0.1), rgba(255, 164, 95, 0.05));
  box-shadow: 0 10px 24px -14px rgba(255, 106, 44, 0.55);
  animation: pop .3s cubic-bezier(.34,1.56,.64,1);
}
.option.selected .opt-letter {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  transform: scale(1.1);
}
@keyframes pop {
  0% { transform: scale(.98); }
  55% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

/* visual options (Q2) */
.visual-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.visual-option {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  background: #fff;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
  text-align: center;
}
.visual-option:hover {
  border-color: var(--orange-soft);
  transform: translateY(-3px);
  box-shadow: 0 14px 26px -16px rgba(255, 106, 44, 0.5);
}
.visual-option.selected {
  border-color: var(--orange);
  background: linear-gradient(135deg, rgba(255, 106, 44, 0.1), rgba(255, 164, 95, 0.05));
  box-shadow: 0 14px 26px -16px rgba(255, 106, 44, 0.55);
  animation: pop .3s cubic-bezier(.34,1.56,.64,1);
}
.visual-option .v-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  color: var(--navy);
}

/* spot-the-flaw pairs */
.pair-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  min-height: 170px;
  font-size: 10px;
  color: var(--navy);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mini p { margin: 0; font-size: 10px; color: var(--text-muted); line-height: 1.4; }
.mini-title { font-family: var(--font-head); font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.mini-cta {
  margin-top: auto;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
}

/* spacing */
.mini-row { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--bg); border-radius: 8px; }
.mini-row i { width: 14px; height: 14px; border-radius: 50%; background: var(--orange-soft); }
.mini-row span { flex: 1; font-weight: 600; }
.mini-row b { color: var(--text-muted); }
.mini-spacing.flawed .mini-row:nth-child(2) { margin-top: -3px; }
.mini-spacing.flawed .mini-row:nth-child(3) { margin-left: 8px; }
.mini-spacing.flawed .mini-row:nth-child(4) { margin-top: 12px; padding: 5px 8px; }

/* contrast */
.mini-contrast.flawed .mini-title { color: #c4c0d3; }
.mini-contrast.flawed p { color: #cfcbdc; }
.mini-contrast.flawed .mini-cta { background: #ffd9c7; color: #fff; }

/* hierarchy */
.mini-eyebrow { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; color: var(--orange-deep); }
.mini-amount { font-family: var(--font-head); font-weight: 700; font-size: 30px; line-height: 1; }
.mini-hierarchy.flawed .mini-eyebrow { font-size: 14px; color: var(--navy); }
.mini-hierarchy.flawed .mini-amount { font-size: 10px; font-weight: 500; }
.mini-hierarchy.flawed p { font-size: 13px; color: var(--navy); }

/* touch targets */
.mini-btnrow { margin-top: auto; display: flex; gap: 6px; }
.mini-btnrow span {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-weight: 700;
}
.mini-btnrow span:last-child { flex: 2; }
.mini-targets.flawed .mini-btnrow { gap: 1px; }
.mini-targets.flawed .mini-btnrow span { padding: 1px 0; font-size: 7px; border-radius: 3px; }

/* consistency */
.mini-input {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  color: var(--text-muted);
}
.mini-consistency.flawed .mini-input:nth-of-type(3) { border-radius: 0; border-color: var(--orange); padding: 4px 8px; }
.mini-consistency.flawed .mini-cta { border-radius: 0; background: var(--orange); }

/* phone nav mockups */
.phone-mock {
  width: 100%;
  aspect-ratio: 3/5;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.phone-mock .screen-body { flex: 1; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.phone-mock .row { height: 6px; border-radius: 3px; background: #e3e0ee; }
.phone-mock .row.w60 { width: 60%; }
.phone-mock .row.w80 { width: 80%; }
.phone-mock .row.w40 { width: 40%; }

.nav-messy { flex-wrap: wrap; flex-direction: row !important; gap: 3px; padding: 6px; }
.nav-messy span {
  font-size: 7px;
  background: #e3e0ee;
  border-radius: 4px;
  padding: 3px 5px;
  color: var(--text-muted);
}

.nav-tabbar { flex-direction: column; }
.nav-tabbar .tabbar {
  margin-top: auto;
  display: flex;
  justify-content: space-around;
  padding: 6px 4px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.nav-tabbar .tabbar div { width: 14px; height: 14px; border-radius: 4px; background: var(--orange); opacity: 0.85; }
.nav-tabbar .tabbar div:not(:first-child) { background: #cfcbdd; }

.nav-hamburger .top-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px; }
.nav-hamburger .burger { display: flex; flex-direction: column; gap: 2px; }
.nav-hamburger .burger span { width: 14px; height: 2px; background: var(--navy); border-radius: 1px; }

/* messy UI mockup for Q3 */
.messy-ui {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  padding: 16px;
  margin-bottom: 18px;
  position: relative;
}
.messy-ui .mu-title { height: 10px; width: 50%; background: #d9d5e6; border-radius: 4px; margin-bottom: 10px; }
.messy-ui .mu-row { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.messy-ui .mu-btn {
  font-size: 10px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
}
.messy-ui .mu-btn.orange { background: var(--orange); }
.messy-ui .mu-btn.green { background: var(--green); color: #07361a; }
.messy-ui .mu-btn.navy { background: var(--navy); }
.messy-ui .mu-btn.grey { background: #b9b6c6; }
.messy-ui .mu-block { height: 8px; background: #e3e0ee; border-radius: 4px; margin-bottom: 6px; }
.messy-ui .mu-block.w90 { width: 90%; }
.messy-ui .mu-block.w70 { width: 70%; }
.messy-ui .mu-block.w50 { width: 50%; }

/* ---------- Results ---------- */
.results-card { text-align: center; }
.profile-badge {
  font-size: 40px;
  margin: 4px auto 4px;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
}
.profile-badge::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 106, 44, 0.22), transparent 70%);
  animation: badgeGlow 2.4s ease-in-out infinite;
  z-index: -1;
}
@keyframes badgeGlow {
  0%, 100% { transform: scale(.9); opacity: .7; }
  50% { transform: scale(1.15); opacity: 1; }
}
.score {
  font-family: var(--font-head);
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(120deg, var(--orange-deep), var(--orange-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 4px 0 12px;
  animation: fadeUp .5s cubic-bezier(.16,1,.3,1) .1s backwards;
}
.level-split { font-size: 13px; font-weight: 600; color: var(--text-muted); margin: -4px 0 12px; }
.level-next { color: var(--orange-deep); letter-spacing: 0.06em; margin-bottom: 4px; }
.profile-desc { color: var(--text-muted); font-size: 15px; margin: 0 0 28px; }

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  text-align: left;
  background: linear-gradient(160deg, var(--bg), #fff);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 28px;
}
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { font-size: 14px; color: var(--text); padding-left: 22px; position: relative; }
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.next-skill { font-size: 14px; color: var(--text-muted); margin: 0; }

/* ---------- Lead gen ---------- */
.leadgen-card h2 { margin-bottom: 14px; }
.gift-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.gift-list li {
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.gift-list li:hover { transform: translateY(-2px); box-shadow: 0 8px 16px -12px rgba(26, 24, 48, 0.3); }

.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--navy); }
.field input, .field select {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:focus, .field select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 106, 44, 0.14);
}
.form-error { color: #c0392b; font-size: 13px; margin: -4px 0 14px; }

/* ---------- Thank you ---------- */
.thankyou-card { text-align: center; }
.thankyou-card .lead { font-weight: 400; font-size: 15px; color: var(--text-muted); }
.thankyou-card .profile-badge { font-size: 44px; }
.ty-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

.site-footer {
  text-align: center;
  padding: 18px;
  font-size: 12px;
  color: var(--text-muted);
}
.site-footer a { color: var(--navy); }

/* ---------- Focus accessibility ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, .option:focus-visible, .visual-option:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
  .card { padding: 26px 18px; border-radius: 18px; }
  h1 { font-size: 27px; }
  h2 { font-size: 22px; }
  .results-grid { grid-template-columns: 1fr; }
  .gift-list { grid-template-columns: 1fr; }
  .visual-options { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .visual-option .v-label { font-size: 10px; }
  body::before, body::after { filter: blur(50px); opacity: 0.4; }
}
