:root {
  --bg: #040506;
  --card: rgba(7, 9, 12, 0.76);
  --card-deep: rgba(11, 14, 18, 0.94);
  --text: #fffdf6;
  --soft: #d7d0c2;
  --muted: #918a7e;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.3);
  --gold: #f5c96c;
  --green: #72f0a0;
  --blue: #6ea9ff;
  --danger: #ff756b;
  --ink: #070809;
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.9, 0.18, 1);
  color-scheme: dark;
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

body::selection {
  background: rgba(114, 240, 160, 0.32);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.experience {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  place-items: center;
  padding: 0.75rem;
  isolation: isolate;
}

.atmosphere,
.atmosphere__image,
.atmosphere__shade,
.atmosphere__matrix,
.atmosphere__line {
  position: fixed;
  inset: 0;
}

.atmosphere {
  z-index: -2;
  overflow: hidden;
  background: var(--bg);
}

.atmosphere__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.16) brightness(0.5);
  opacity: 0.74;
  transform: scale(1.05);
  animation: sceneBreath 16s var(--ease) infinite alternate;
}

.atmosphere__shade {
  background:
    linear-gradient(180deg, rgba(4, 5, 6, 0.55), rgba(4, 5, 6, 0.82)),
    linear-gradient(90deg, rgba(4, 5, 6, 0.94), rgba(4, 5, 6, 0.42), rgba(4, 5, 6, 0.92)),
    conic-gradient(from 210deg at 50% 46%, rgba(114, 240, 160, 0.18), rgba(245, 201, 108, 0.2), rgba(110, 169, 255, 0.18), transparent, rgba(114, 240, 160, 0.18));
}

.atmosphere__matrix {
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent, #000 16%, #000 78%, transparent);
  animation: matrixMove 20s linear infinite;
}

.atmosphere__line {
  left: -26%;
  width: 152%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(114, 240, 160, 0.12), rgba(245, 201, 108, 0.95), rgba(110, 169, 255, 0.12), transparent);
  box-shadow: 0 0 36px rgba(245, 201, 108, 0.38);
  transform: rotate(-16deg);
  animation: signalLine 7s linear infinite;
}

.atmosphere__line--a {
  top: 24%;
}

.atmosphere__line--b {
  top: 76%;
  animation-delay: -3.5s;
}

.diagnostic-card {
  position: relative;
  width: min(700px, 100%);
  min-height: min(720px, calc(100svh - 1.5rem));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045)),
    var(--card);
  box-shadow:
    0 46px 120px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(30px);
  isolation: isolate;
  transform:
    perspective(900px)
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg));
  transition: transform 240ms var(--ease);
}

.diagnostic-card::before {
  position: absolute;
  inset: -2px;
  z-index: -1;
  background: conic-gradient(from 120deg, var(--gold), var(--green), var(--blue), transparent, var(--gold));
  filter: blur(20px);
  opacity: 0.74;
  content: "";
}

.diagnostic-card::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 0%, transparent 44%, rgba(255, 255, 255, 0.14) 50%, transparent 56%, transparent 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 32%);
  background-size: 230% 100%, auto;
  opacity: 0.42;
  pointer-events: none;
  animation: cardSheen 5.4s var(--ease) infinite;
  content: "";
}

.diagnostic-form {
  position: relative;
  z-index: 1;
  min-height: inherit;
}

.bot-field {
  display: none;
}

.flow {
  display: grid;
  min-height: min(720px, calc(100svh - 1.5rem));
  grid-template-rows: auto auto 1fr auto auto auto;
  gap: 0.78rem;
  padding: clamp(0.85rem, 2.6vw, 1.25rem);
}

.flow[hidden],
.success[hidden] {
  display: none;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hud__brand,
.hud__count,
.step__eyebrow,
.answer__index,
.success__label {
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 0.71rem;
  font-weight: 950;
}

.hud__brand {
  color: var(--soft);
}

.hud__count {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 0.74rem;
  background: rgba(255, 255, 255, 0.075);
  color: var(--gold);
  white-space: nowrap;
}

.progress {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.progress__bar {
  display: block;
  width: 14.29%;
  height: 100%;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(4, 5, 6, 0.26) 0 8px,
      transparent 8px 16px
    ),
    linear-gradient(90deg, var(--green), var(--gold), var(--blue));
  box-shadow: 0 0 28px rgba(114, 240, 160, 0.36);
  transition: width 540ms var(--ease);
}

.stage {
  position: relative;
  display: grid;
  min-height: 438px;
  align-items: stretch;
  perspective: 1000px;
}

.stage__glow {
  position: absolute;
  inset: 9% -14%;
  background: linear-gradient(90deg, rgba(114, 240, 160, 0.16), rgba(245, 201, 108, 0.14), rgba(110, 169, 255, 0.16));
  filter: blur(44px);
  opacity: 0.74;
  transform: skewY(-7deg);
  animation: innerGlow 5.2s var(--ease) infinite alternate;
}

.step {
  position: relative;
  z-index: 1;
  display: none;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(0.92rem, 3vw, 1.18rem);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    var(--card-deep);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.step::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-120%);
  transition: transform 780ms var(--ease);
  content: "";
}

.step.is-active {
  display: grid;
  align-content: center;
  animation: stepIn 560ms var(--ease) both;
}

.step.is-active::before {
  transform: translateX(120%);
}

.step__number {
  position: absolute;
  top: 0.56rem;
  right: 0.78rem;
  color: rgba(255, 255, 255, 0.095);
  font-size: 4.15rem;
  font-weight: 950;
  line-height: 1;
}

.step__eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 0.56rem;
  color: var(--green);
}

legend {
  position: relative;
  z-index: 1;
  width: min(100%, 14ch);
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 2.18rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.02;
}

.answers {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.68rem;
}

.answer {
  --lift: 0px;
  position: relative;
  display: grid;
  min-height: 56px;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 0.68rem 0.78rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 850;
  transform: translateY(var(--lift)) scale(1);
  transition:
    transform 230ms var(--ease),
    border-color 230ms var(--ease),
    background 230ms var(--ease),
    box-shadow 230ms var(--ease);
}

.answer::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(114, 240, 160, 0.24), transparent 44%),
    linear-gradient(135deg, transparent, rgba(245, 201, 108, 0.18));
  opacity: 0;
  transition: opacity 230ms var(--ease);
  content: "";
}

.answer::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--green), var(--gold), var(--blue));
  opacity: 0;
  transform: scaleY(0.35);
  transition:
    opacity 230ms var(--ease),
    transform 230ms var(--ease);
  content: "";
}

.answer input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.answer > span {
  position: relative;
  z-index: 1;
}

.answer__index {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--soft);
  transition:
    background 230ms var(--ease),
    color 230ms var(--ease),
    transform 230ms var(--ease);
}

.answer__copy {
  font-size: 0.94rem;
}

.answer:hover {
  --lift: -4px;
  border-color: rgba(245, 201, 108, 0.46);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.answer:hover::before,
.answer.is-selected::before {
  opacity: 1;
}

.answer.is-selected {
  border-color: rgba(114, 240, 160, 0.74);
  background:
    linear-gradient(135deg, rgba(114, 240, 160, 0.22), rgba(245, 201, 108, 0.12)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(114, 240, 160, 0.2);
  animation: answerPop 340ms var(--ease) both;
}

.answer.is-selected::after {
  opacity: 1;
  transform: scaleY(1);
}

.answer.is-selected .answer__index {
  background: var(--green);
  color: var(--ink);
  transform: rotate(-8deg) scale(1.08);
}

.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(45deg);
  animation: sparkFly 520ms var(--ease) forwards;
}

.field {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.48rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
}

.fields {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.72rem;
}

textarea,
input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.085);
  color: var(--text);
  font-weight: 760;
  transition:
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

input[type="text"],
input[type="tel"],
input[type="email"] {
  min-height: 52px;
  padding: 0 0.95rem;
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 0.95rem;
}

textarea::placeholder,
input::placeholder {
  color: rgba(255, 253, 246, 0.44);
}

textarea:focus,
input:focus {
  border-color: rgba(114, 240, 160, 0.68);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(114, 240, 160, 0.16);
  outline: 0;
}

.insight {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  padding: 0.72rem 0.8rem;
  background: rgba(255, 255, 255, 0.065);
  color: var(--soft);
  font-size: 0.9rem;
  font-weight: 780;
}

.insight span {
  display: block;
  animation: insightIn 360ms var(--ease) both;
}

.form-message {
  min-height: 1.2rem;
  margin: 0;
  color: var(--danger);
  font-size: 0.92rem;
  font-weight: 850;
}

.form-message.is-success {
  color: var(--green);
}

.actions {
  display: grid;
  grid-template-columns: 0.38fr 0.62fr;
  gap: 0.72rem;
}

.actions .button[hidden] {
  display: none;
}

.actions .button:last-child {
  grid-column: 2;
}

.button {
  position: relative;
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  text-align: center;
  font-weight: 950;
  line-height: 1.1;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    opacity 180ms var(--ease);
}

.button::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.34) 50%, transparent 100%);
  transform: translateX(-115%);
  transition: transform 520ms var(--ease);
  content: "";
}

.button:hover {
  transform: translateY(-2px);
}

.button:hover::before {
  transform: translateX(115%);
}

.button:focus-visible,
.answer:focus-within {
  outline: 3px solid rgba(110, 169, 255, 0.35);
  outline-offset: 3px;
}

.button--next {
  background: linear-gradient(135deg, var(--green), var(--gold) 48%, var(--blue));
  color: var(--ink);
  box-shadow:
    0 18px 38px rgba(114, 240, 160, 0.18),
    0 18px 42px rgba(245, 201, 108, 0.16);
}

.button--back {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
}

.button--light {
  background: var(--text);
  color: var(--ink);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.success {
  display: grid;
  min-height: min(720px, calc(100svh - 1.5rem));
  align-content: center;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 1.5rem);
  animation: stepIn 620ms var(--ease) both;
}

.success__mark {
  width: 4rem;
  height: 4rem;
  border: 1px solid rgba(114, 240, 160, 0.5);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(114, 240, 160, 0.36), rgba(245, 201, 108, 0.12)),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 46px rgba(114, 240, 160, 0.25);
}

.success__label {
  margin: 0;
  color: var(--green);
}

.success h1 {
  max-width: 11ch;
  margin: 0;
  color: var(--text);
  font-size: 2.65rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
}

.success p {
  max-width: 38rem;
  margin: 0;
  color: var(--soft);
  font-weight: 680;
}

@keyframes sceneBreath {
  from {
    transform: scale(1.05) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.11) translate3d(-1.2%, 0.6%, 0);
  }
}

@keyframes matrixMove {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 96px 48px;
  }
}

@keyframes signalLine {
  from {
    transform: translateX(-18%) rotate(-16deg);
  }
  to {
    transform: translateX(18%) rotate(-16deg);
  }
}

@keyframes cardSheen {
  0%,
  44% {
    background-position: 200% 0, 0 0;
  }
  100% {
    background-position: -120% 0, 0 0;
  }
}

@keyframes innerGlow {
  from {
    transform: translateX(-3%) skewY(-7deg);
    opacity: 0.42;
  }
  to {
    transform: translateX(3%) skewY(-7deg);
    opacity: 0.76;
  }
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97) rotateX(4deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
  }
}

@keyframes answerPop {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.025) rotate(-0.35deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes sparkFly {
  0% {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(0.4) rotate(45deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(1.4) rotate(160deg);
  }
}

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

@media (min-width: 760px) {
  .experience {
    padding: 1rem;
  }

  .flow {
    padding: 1.2rem;
  }

  legend {
    font-size: 2.6rem;
  }

  .success h1 {
    font-size: 4rem;
  }
}

@media (max-width: 520px) {
  .experience {
    padding: 0.58rem;
    place-items: start center;
  }

  .diagnostic-card,
  .diagnostic-form,
  .flow,
  .success {
    min-height: calc(100svh - 1.16rem);
  }

  .hud__brand {
    max-width: 13ch;
    font-size: 0.68rem;
  }

  .hud__count {
    min-height: 32px;
    padding: 0 0.65rem;
  }

  .stage {
    min-height: 438px;
  }

  .step__number {
    font-size: 3.28rem;
  }

  legend {
    font-size: 1.8rem;
  }

  .answer {
    min-height: 58px;
  }

  .actions {
    grid-template-columns: 0.37fr 0.63fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
