/* =========================================================
   INSPERIA TECHNOLOGY — Product Discovery Quiz
   LIGHT THEME — white + blue, fully animated.
   All colors live here as custom properties.
========================================================= */
:root {
  /* Blues (from the logo) */
  --blue-700: #0d47a1;
  --blue-600: #1560c4;
  --blue-500: #1e6fd0;   /* primary */
  --blue-400: #2f8ae6;
  --cyan-500: #1ca0e3;   /* bright accent */
  --cyan-400: #46bdf5;

  /* Surfaces / neutrals */
  --sky-50:  #f2f7ff;
  --sky-100: #e6f0ff;
  --sky-200: #d5e6ff;
  --white:   #ffffff;

  /* Ink (text) */
  --ink-900: #0a1b3d;    /* headings */
  --ink-600: #3d4f72;    /* body */
  --ink-400: #6f81a6;    /* muted */

  --line:        rgba(30, 111, 208, 0.16);
  --line-strong: rgba(30, 111, 208, 0.34);
  --card:        #ffffff;

  --grad-accent: linear-gradient(135deg, var(--blue-500) 0%, var(--cyan-500) 100%);
  --grad-text:   linear-gradient(120deg, var(--blue-600), var(--cyan-500), var(--blue-500));
  --grad-bg:     linear-gradient(160deg, #ffffff 0%, var(--sky-50) 45%, var(--sky-100) 100%);

  --radius-container: 26px;
  --radius-card: 16px;
  --radius-btn: 12px;

  --shadow-sm:   0 6px 18px -8px rgba(20, 80, 180, 0.28);
  --shadow-md:   0 18px 44px -20px rgba(20, 80, 180, 0.38);
  --shadow-lg:   0 40px 90px -40px rgba(20, 70, 160, 0.45);
  --shadow-glow: 0 14px 34px -10px rgba(30, 111, 208, 0.55);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 340ms;

  --maxw: 1100px;
}

/* ---------------- Reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink-600);
  background:
    radial-gradient(1200px 820px at 50% 40%, rgba(5, 10, 26, 0) 0%, rgba(4, 8, 20, 0.35) 62%, rgba(3, 6, 16, 0.72) 100%),
    url("assets/home-hero-bg.png") center center / cover no-repeat,
    #05070f;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* Animated fine grid */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(30, 111, 208, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 111, 208, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(900px 640px at 32% 40%, #000 12%, transparent 78%);
  animation: gridDrift 42s linear infinite;
}
@keyframes gridDrift { to { background-position: 44px 44px; } }

/* ---------------- App shell ---------------- */
.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 56px);
}

.screen {
  width: 100%;
  max-width: var(--maxw);
  animation: screen-in var(--dur) var(--ease) both;
}
.screen[hidden] { display: none; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   WELCOME
============================================================ */
.welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.welcome-copy { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.welcome-copy .badge { margin-top: 0; }

/* Dark-hero text treatment — all white text on the dark image */
.welcome .brand__name { color: #ffffff; }
.welcome .brand__name span { color: rgba(255, 255, 255, 0.82); }
.welcome .welcome-title {
  color: #7fc9ff; /* light blue */
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.55);
}
/* Accent line kept white for contrast against the light-blue line */
.welcome .grad {
  background: none;
  -webkit-text-fill-color: #ffffff;
  color: #ffffff;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.6);
}
.welcome .welcome-sub {
  color: #7fc9ff; /* light blue */
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
}
.welcome .badge {
  background: rgba(16, 34, 74, 0.55);
  border-color: rgba(120, 165, 235, 0.4);
  color: #ffffff;
  backdrop-filter: blur(6px);
}
.welcome .badge__dot { background: #ffffff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16); }
.welcome .chip {
  background: rgba(12, 26, 58, 0.5);
  border-color: rgba(120, 165, 235, 0.28);
  color: #ffffff;
  box-shadow: none;
  backdrop-filter: blur(6px);
}
.welcome .chip svg { stroke: #ffffff; }

.brand { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 26px; }
.brand__mark { filter: drop-shadow(0 8px 18px rgba(30, 111, 208, 0.3)); }
.brand__name {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 20px;
  color: var(--ink-900);
}
.brand__name span { color: var(--blue-500); font-weight: 500; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--blue-600);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 22px;
}
.badge__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan-500);
  box-shadow: 0 0 0 4px rgba(28, 160, 227, 0.18);
  animation: dotPulse 2.4s var(--ease) infinite;
}
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(28, 160, 227, 0.2); }
  50%      { box-shadow: 0 0 0 7px rgba(28, 160, 227, 0); }
}

.welcome-title {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  margin: 0 0 18px;
}
.grad {
  background: var(--grad-text);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 6s ease infinite;
}
@keyframes gradShift { to { background-position: 200% center; } }

.welcome-sub {
  color: var(--ink-600);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.6;
  max-width: 46ch;
  margin: 0 0 24px;
}

.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0; margin: 0 0 32px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--ink-600);
  font-size: 13px; font-weight: 500;
}
.chip svg { width: 16px; height: 16px; fill: none; stroke: var(--blue-500); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  padding: 13px 22px;
  font-weight: 600;
  font-size: 15px;
  color: var(--white);
  background: transparent;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), border-color var(--dur) var(--ease), opacity var(--dur);
  -webkit-tap-highlight-color: transparent;
}
.btn__arrow { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur) var(--ease); }
.btn__mark { border-radius: 6px; background: rgba(255,255,255,0.9); padding: 2px; }

.btn--primary { background: var(--grad-accent); box-shadow: var(--shadow-glow); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 18px 46px -10px rgba(30, 111, 208, 0.7); }
.btn--primary:hover .btn__arrow { transform: translateX(4px); }
.btn--primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; filter: grayscale(0.25); }

.btn--ghost {
  border-color: var(--line-strong);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--blue-600);
}
.btn--ghost:hover { border-color: var(--blue-500); transform: translateY(-1px); }
.btn--ghost:hover .btn__arrow--left { transform: translateX(-4px); }

.btn--text { background: none; color: var(--ink-400); text-decoration: underline; text-underline-offset: 4px; padding: 10px; }
.btn--text:hover { color: var(--blue-500); }

/* Subtle, non-highlighted button (used on the dark hero) */
.btn--outline {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
  box-shadow: none;
}
.btn--outline:hover { border-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.12); }
.btn--outline:hover .btn__arrow { transform: translateX(4px); }

.btn--lg { padding: 16px 26px; font-size: 16px; }
.btn--block { width: 100%; }

/* ---------------- Converging visual ---------------- */
.visual { display: flex; justify-content: center; }
.visual__stage { position: relative; width: min(100%, 440px); aspect-ratio: 1 / 1; }
.visual__lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.visual__lines line {
  stroke: rgba(30, 111, 208, 0.3);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
  animation: dash 12s linear infinite;
}
@keyframes dash { to { stroke-dashoffset: -90; } }

.node { position: absolute; }
.node--core {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 120px; height: 120px;
  display: grid; place-items: center;
  border-radius: 24px;
  background: linear-gradient(160deg, #ffffff, var(--sky-100));
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 50px -14px rgba(30, 111, 208, 0.5), 0 0 0 8px rgba(46, 189, 245, 0.08);
  animation: corePulse 3.6s var(--ease) infinite;
}
.node--core img { filter: drop-shadow(0 4px 10px rgba(30, 111, 208, 0.35)); }
@keyframes corePulse {
  0%, 100% { box-shadow: 0 20px 46px -16px rgba(30,111,208,0.45), 0 0 0 6px rgba(46,189,245,0.08); }
  50%      { box-shadow: 0 24px 60px -12px rgba(30,111,208,0.6),  0 0 0 12px rgba(46,189,245,0.14); }
}

.node--card {
  top: 50%; left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%) translate(calc(var(--x) * 2.1), calc(var(--y) * 2.1));
  width: 150px;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  font-size: 12.5px; font-weight: 500; color: var(--ink-900);
  line-height: 1.25;
}
.node__ico { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: var(--blue-500); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@keyframes converge {
  from { transform: translate(-50%, -50%) translate(calc(var(--x) * 2.1), calc(var(--y) * 2.1)); }
  to   { transform: translate(-50%, -50%) translate(calc(var(--x) * 1.82), calc(var(--y) * 1.82)); }
}

/* ============================================================
   QUIZ
============================================================ */
.quiz {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-container);
  box-shadow: var(--shadow-lg);
  padding: clamp(22px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.quiz-top { display: flex; flex-direction: column; gap: 18px; }

/* Brand lockup */
.quiz-brand { display: inline-flex; align-items: center; gap: 11px; }
.quiz-brand__mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad-accent);
  color: var(--white);
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px -8px rgba(30, 111, 208, 0.75);
}
.quiz-brand__name {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: "Sora", sans-serif;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.quiz-brand__name b { font-weight: 700; color: var(--ink-900); }

.progress { display: flex; align-items: center; gap: 14px; }
.progress__track { flex: 1; height: 8px; border-radius: 999px; background: var(--sky-100); overflow: hidden; }
.progress__fill {
  height: 100%; width: 14%;
  border-radius: 999px;
  background: var(--grad-accent);
  box-shadow: 0 0 14px -2px rgba(28, 160, 227, 0.6);
  transition: width 480ms var(--ease);
  position: relative; overflow: hidden;
}

.quiz-body {
  min-height: 320px;
  display: flex;
  overflow: visible;
  perspective: 2000px;
  perspective-origin: left center;
}
.q-frame {
  width: 100%;
  position: relative;
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
}
/* Page shading while a page turns (like a book spine shadow) */
.q-frame::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 12px;
  background: linear-gradient(95deg, rgba(20, 80, 180, 0.16), rgba(20, 80, 180, 0) 42%);
  opacity: 0;
  transition: opacity 260ms var(--ease);
}
.q-frame.page-out { animation: pageOut 360ms cubic-bezier(0.5, 0, 0.75, 0.35) both; }
.q-frame.page-out::after { opacity: 1; }
.q-frame.page-in  { animation: pageIn 480ms var(--ease) both; }
@keyframes pageOut {
  0%   { transform: rotateY(0deg); opacity: 1; }
  100% { transform: rotateY(-108deg); opacity: 0; }
}
@keyframes pageIn {
  0%   { transform: rotateY(72deg); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

.q-eyebrow { color: var(--blue-500); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 8px; }
.q-title { font-family: "Sora", sans-serif; font-weight: 700; font-size: clamp(22px, 3vw, 32px); line-height: 1.18; letter-spacing: -0.01em; color: var(--ink-900); margin: 0 0 6px; }
.q-hint { color: var(--ink-400); font-size: 13px; margin: 0 0 12px; }

.options { display: grid; gap: 12px; margin-top: 18px; }

.option {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
  color: var(--ink-900);
  text-align: left; width: 100%;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
              transform 160ms var(--ease), box-shadow var(--dur) var(--ease);
}
.option:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.option:focus-visible { outline: 3px solid rgba(46, 189, 245, 0.55); outline-offset: 2px; }
.option:active { transform: scale(0.99); }

.option__ico {
  flex: 0 0 auto; width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--sky-50);
  border: 1px solid var(--line);
  transition: all var(--dur) var(--ease);
}
.option__ico svg { width: 20px; height: 20px; fill: none; stroke: var(--blue-500); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.option__label { flex: 1; font-size: 15.5px; font-weight: 600; }
.option__body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.option__body .option__label { flex: none; }
.option__desc { font-size: 13px; font-weight: 500; color: var(--ink-500); line-height: 1.35; }

.option__check {
  flex: 0 0 auto; width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid; place-items: center;
  transition: all var(--dur) var(--ease);
}
.option__check svg { width: 14px; height: 14px; fill: none; stroke: var(--white); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.5); transition: all var(--dur) var(--ease); }

.option.is-selected {
  border-color: var(--blue-500);
  background: linear-gradient(135deg, rgba(30, 111, 208, 0.1), rgba(28, 160, 227, 0.08));
  box-shadow: 0 0 0 3px rgba(46, 189, 245, 0.18), var(--shadow-md);
}
.option.is-selected .option__ico { background: var(--grad-accent); border-color: transparent; }
.option.is-selected .option__ico svg { stroke: var(--white); }
.option.is-selected .option__check { background: var(--grad-accent); border-color: transparent; transform: scale(1.05); }
.option.is-selected .option__check svg { opacity: 1; transform: scale(1); }

.q-confirm {
  min-height: 22px;
  margin: 18px 0 0;
  color: var(--ink-600);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.q-confirm.show { opacity: 1; transform: translateY(0); }

/* ---- Free-form question inputs (website / select / textarea) ---- */
.q-input { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; animation: cardPop 460ms var(--ease) both; }

.field--lg input { height: 58px; font-size: 16px; }

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink-700);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur), background var(--dur), transform var(--dur);
}
.checkline:hover { border-color: var(--line-strong); }
.checkline:focus-visible { outline: 3px solid rgba(46, 189, 245, 0.55); outline-offset: 2px; }
.checkline__box {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.6px solid var(--line-strong);
  border-radius: 7px;
  background: var(--white);
  transition: background var(--dur), border-color var(--dur);
}
.checkline__box svg { width: 15px; height: 15px; fill: none; stroke: var(--white); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.6); transition: opacity var(--dur), transform var(--dur); }
.checkline.is-checked { border-color: var(--blue-500); background: rgba(30, 111, 208, 0.06); }
.checkline.is-checked .checkline__box { background: var(--grad-accent); border-color: transparent; }
.checkline.is-checked .checkline__box svg { opacity: 1; transform: scale(1); }

.q-select {
  width: 100%;
  height: 58px;
  padding: 0 44px 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6b86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px;
  color: var(--ink-800);
  font: inherit;
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.q-select:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(30, 111, 208, 0.14); }

.q-textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink-800);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.q-textarea::placeholder { color: var(--ink-400); }
.q-textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(30, 111, 208, 0.14); }

.code-error {
  margin: 8px 0 0;
  padding: 0;
  color: #ff8fa8;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.referral-yn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.referral-yn__btn {
  min-height: 72px;
}

.referral-code {
  margin-top: 4px;
  animation: cardPop 460ms var(--ease) both;
}

@media (max-width: 560px) {
  .referral-yn { grid-template-columns: 1fr; }
}

.quiz-actions { display: flex; justify-content: space-between; gap: 14px; }
.quiz-actions--single { justify-content: flex-end; }
.quiz-actions--single .btn { min-width: 190px; }

/* ============================================================
   DETAILS — collect name + email first
============================================================ */
.details { display: flex; justify-content: center; }
.details-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-container);
  box-shadow: var(--shadow-lg);
  padding: clamp(28px, 4vw, 44px);
  overflow: hidden;
}
.details-card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 6px;
  background: var(--grad-accent);
}
.details-card .badge { margin-bottom: 18px; }
.details-title {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  margin: 0 0 10px;
}
.details-sub { color: var(--ink-600); font-size: 15px; line-height: 1.55; margin: 0 0 24px; }
.ref-note {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; margin: 0 0 20px;
  border-radius: 999px;
  background: var(--sky-50);
  border: 1px solid var(--line);
  color: var(--blue-600);
  font-size: 13px; font-weight: 600;
}
.ref-note::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan-500);
  box-shadow: 0 0 0 4px rgba(28, 160, 227, 0.18);
}
.details-form { display: flex; flex-direction: column; gap: 6px; }
.field-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; text-align: left; }
.details-form .btn--lg { margin-top: 6px; }
.details-note { text-align: center; color: var(--ink-400); font-size: 13px; margin: 12px 0 0; }

/* Staggered entrance */
.details.is-active .details-card > * { animation: rise 560ms var(--ease) both; }
.details.is-active .badge         { animation-delay: 60ms; }
.details.is-active .details-title { animation-delay: 150ms; }
.details.is-active .details-sub   { animation-delay: 240ms; }
.details.is-active .details-form  { animation-delay: 330ms; }

/* ============================================================
   FINAL — redesigned card
============================================================ */
.final { display: flex; justify-content: center; position: relative; }
.final-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-container);
  box-shadow: var(--shadow-lg);
  padding: clamp(30px, 5vw, 52px) clamp(24px, 4vw, 48px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.final-card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 6px;
  background: var(--grad-accent);
}

.final-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--sky-50);
  border: 1px solid var(--line);
  color: var(--blue-600);
  font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 22px;
}

.final-mark { position: relative; width: 118px; height: 118px; display: grid; place-items: center; margin-bottom: 22px; }
.final-mark img { filter: drop-shadow(0 6px 16px rgba(30, 111, 208, 0.4)); }
.final-ring { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; }
.final-ring circle {
  stroke: var(--cyan-500);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 339;
  stroke-dashoffset: 339;
  transform: rotate(-90deg);
  transform-origin: center;
  filter: drop-shadow(0 0 6px rgba(28, 160, 227, 0.5));
  animation: ring 1.1s var(--ease) 0.25s forwards;
}
@keyframes ring { to { stroke-dashoffset: 0; } }

.final-title { font-family: "Sora", sans-serif; font-weight: 800; font-size: clamp(24px, 4vw, 36px); line-height: 1.14; letter-spacing: -0.02em; color: var(--ink-900); margin: 0 0 14px; }
.final-sub { color: var(--ink-600); font-size: 16px; line-height: 1.6; margin: 0 0 28px; }

.final-form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.final-label { color: var(--ink-900); font-weight: 600; font-size: 14px; }

.field { position: relative; display: flex; align-items: center; }
.field__ico { position: absolute; left: 16px; width: 20px; height: 20px; fill: none; stroke: var(--ink-400); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke var(--dur); }
.field input {
  width: 100%;
  padding: 15px 16px 15px 46px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--line-strong);
  background: var(--sky-50);
  color: var(--ink-900);
  font-size: 15px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur);
}
.field input::placeholder { color: var(--ink-400); }
.field input:focus { outline: none; border-color: var(--blue-500); background: var(--white); box-shadow: 0 0 0 4px rgba(30, 111, 208, 0.14); }
.field:focus-within .field__ico { stroke: var(--blue-500); }

.field-error { color: #d63a5a; font-size: 13px; margin: 2px 0 4px; text-align: left; }
.final-form .btn--lg { margin-top: 6px; }

.final-done { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; }
.final-done__check {
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-accent);
  box-shadow: var(--shadow-glow);
  animation: popCheck 500ms var(--ease) both;
}
.final-done__check svg { width: 28px; height: 28px; fill: none; stroke: var(--white); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: drawCheck 500ms var(--ease) 220ms forwards; }
.final-done p { color: var(--blue-600); font-weight: 700; margin: 0; }
.final-note { color: var(--ink-400) !important; font-weight: 500 !important; font-size: 13.5px; max-width: 40ch; }

.final-booking {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.final-booking__label {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink-900);
  text-align: center;
}

.final-booking .btn { width: 100%; justify-content: center; text-decoration: none; }
@keyframes popCheck { from { transform: scale(0); } 70% { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

/* Confetti */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.confetti__piece {
  position: absolute; top: -16px;
  width: 9px; height: 14px;
  opacity: 0;
  animation-name: confettiFall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
@keyframes confettiFall {
  0%   { opacity: 0; transform: translate(0, -20px) rotate(0deg); }
  8%   { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift, 0), 620px) rotate(680deg); }
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
  .welcome-grid { grid-template-columns: 1fr; }
  .visual { order: -1; }
  .visual__stage { width: min(84%, 340px); }

  .app { padding: 0; place-items: stretch; }
  .screen { max-width: 100%; }

  .welcome { padding: 28px 22px 40px; }

  .quiz {
    border-radius: 0; border: none; box-shadow: none;
    min-height: 100dvh;
    padding: 22px 20px calc(96px + env(safe-area-inset-bottom));
    background: var(--white);
  }
  .quiz-body { min-height: auto; flex: 1; }

  .quiz-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 30px -12px rgba(20, 80, 180, 0.25);
    backdrop-filter: blur(10px);
  }
  .quiz-actions .btn { flex: 1; }
  .btn--ghost { flex: 0 0 auto !important; min-width: 96px; }

  .final { padding: 28px 18px; }
}

@media (max-width: 400px) {
  .welcome-title { font-size: 30px; }
  .node--card { width: 118px; font-size: 11px; padding: 9px 10px; }
  .option { padding: 14px 14px; }
  .option__label { font-size: 14.5px; }
}

@media (min-width: 901px) {
  .welcome { padding: 12px; }
}

/* ============================================================
   MOTION LAYER — "fully animated"
============================================================ */
/* Logos gently float */
.brand__mark, .quiz-brand__mark { animation: floatY 5s var(--ease) infinite; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Welcome copy — staggered rise-in */
.welcome.is-active .welcome-copy > * { animation: rise 640ms var(--ease) both; }
.welcome.is-active .welcome-copy > .brand         { animation-delay: 60ms; }
.welcome.is-active .welcome-copy > .badge         { animation-delay: 150ms; }
.welcome.is-active .welcome-copy > .welcome-title { animation-delay: 240ms; }
.welcome.is-active .welcome-copy > .welcome-sub   { animation-delay: 340ms; }
.welcome.is-active .welcome-copy > .chips         { animation-delay: 440ms; }
.welcome.is-active .welcome-copy > .btn           { animation-delay: 540ms; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Welcome visual scales in */
.welcome.is-active .visual__stage { animation: stageIn 800ms var(--ease) 200ms both; }
@keyframes stageIn { from { opacity: 0; transform: scale(0.82) rotate(-4deg); } to { opacity: 1; transform: none; } }

/* Problem cards pop in, then converge */
.node--card {
  animation: cardIn 560ms var(--ease) both, converge 5s var(--ease) infinite alternate;
}
.node--card:nth-child(2) { animation-delay: 500ms, 500ms; }
.node--card:nth-child(3) { animation-delay: 620ms, 800ms; }
.node--card:nth-child(4) { animation-delay: 740ms, 1100ms; }
.node--card:nth-child(5) { animation-delay: 860ms, 1400ms; }
.node--card:nth-child(6) { animation-delay: 980ms, 1700ms; }
.node--card:nth-child(7) { animation-delay: 1100ms, 2000ms; }
@keyframes cardIn {
  from { opacity: 0; transform: translate(-50%, -50%) translate(calc(var(--x) * 2.6), calc(var(--y) * 2.6)) scale(0.7); }
  to   { opacity: 1; transform: translate(-50%, -50%) translate(calc(var(--x) * 2.1), calc(var(--y) * 2.1)) scale(1); }
}

/* Sheen sweep across primary buttons */
.btn--primary { position: relative; overflow: hidden; isolation: isolate; }
.btn--primary > * { position: relative; z-index: 2; }
.btn--primary::after {
  content: ""; position: absolute; top: 0; left: -60%; z-index: 1;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-18deg);
  animation: sheen 4.5s ease-in-out infinite;
}
.btn--primary:disabled::after { animation: none; opacity: 0; }
@keyframes sheen { 0%,62% { left: -60%; } 85%,100% { left: 130%; } }

/* Progress shimmer */
.progress__fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  transform: translateX(-100%);
  animation: progShimmer 2.4s ease-in-out infinite;
}
@keyframes progShimmer { to { transform: translateX(200%); } }

/* Answer cards stagger-in */
.options .option {
  animation: optionIn 480ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms + 120ms);
}
@keyframes optionIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Ripple on selection */
.option { position: relative; overflow: hidden; }
.ripple {
  position: absolute; left: 28px; top: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 189, 245, 0.4), transparent 70%);
  transform: scale(0); pointer-events: none;
  animation: ripple 620ms var(--ease) forwards;
}
@keyframes ripple { to { transform: scale(26); opacity: 0; } }

/* Option icon micro-motion */
.option__ico { transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.option:hover .option__ico { transform: scale(1.08) rotate(-4deg); }
.option.is-selected .option__ico { animation: icoPop 360ms var(--ease); }
@keyframes icoPop { 0% { transform: scale(0.85); } 55% { transform: scale(1.14) rotate(-6deg); } 100% { transform: scale(1); } }

/* Continue button nudges its arrow when it becomes enabled */
.quiz-actions .btn--primary:not(:disabled) .btn__arrow { animation: nudge 1.8s var(--ease) infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

/* Section headings underline sweep */
.q-title::after {
  content: "";
  display: block;
  width: 54px; height: 3px; margin-top: 12px;
  border-radius: 3px;
  background: var(--grad-accent);
  transform-origin: left;
  animation: underline 520ms var(--ease) both;
  animation-delay: 180ms;
}
@keyframes underline { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

/* Confirmation line icon-free pulse when it appears */
.q-confirm.show { animation: confirmPop 420ms var(--ease); }
@keyframes confirmPop { 0% { transform: translateY(10px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }

/* Final screen reveal */
.final.is-active .final-card > * { animation: rise 620ms var(--ease) both; }
.final.is-active .final-pill  { animation-delay: 60ms; }
.final.is-active .final-mark  { animation-delay: 160ms; }
.final.is-active .final-title { animation-delay: 300ms; }
.final.is-active .final-sub   { animation-delay: 420ms; }
.final.is-active .final-done  { animation-delay: 520ms; }
.final.is-active .final-booking { animation-delay: 640ms; }
.final.is-active .final-form  { animation-delay: 540ms; }
.final-mark img { animation: floatY 4.5s var(--ease) infinite; }

/* ============================================================
   Reduced motion
============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .q-frame, .q-frame.page-in, .q-frame.page-out { animation: none !important; transform: none !important; }
  .q-frame::after { display: none !important; }
  .confetti { display: none !important; }
}
