.diag-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(0, 0, 255, 0.94), rgba(0, 0, 204, 0.96)),
    var(--blue);
  color: var(--white);
}

.diag-card {
  position: relative;
  width: min(100%, 520px);
  min-height: min(740px, calc(100svh - 40px));
  display: flex;
  flex-direction: column;
  padding: 22px 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(8, 8, 31, 0.86);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.diag-card:has([data-step="age"].is-active) {
  min-height: auto;
}

.diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.diag-header img {
  width: 94px;
  height: auto;
}

.diag-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  color: var(--yellow);
}

.diag-rating span {
  font-size: 11px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.diag-rating svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.diag-progress {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.58);
}

.diag-progress span:first-child {
  color: var(--yellow);
}

.diag-step {
  display: none;
  flex: 1;
  padding-top: clamp(30px, 6svh, 64px);
}

.diag-step.is-active {
  display: flex;
  flex-direction: column;
}

.diag-kicker {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--yellow);
  text-align: center;
}

.diag-step h1,
.diag-step h2 {
  margin: 0 auto;
  max-width: 17.5ch;
  font-family: var(--display);
  font-size: clamp(34px, 8vw, 50px);
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
}

.diag-subtitle {
  max-width: 27rem;
  margin: 14px auto 0;
  font-size: 17px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.diag-step .diag-question {
  margin: 42px auto 18px;
  max-width: none;
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1.2;
}

.diag-copy {
  max-width: 33rem;
  margin: 22px auto 0;
  font-size: 18px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.76);
  text-align: center;
}

.diag-options {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 34px;
}

[data-step="age"] .diag-options {
  grid-template-columns: 1fr;
  max-width: 360px;
  align-self: center;
  margin-top: 0;
}

[data-step="age"] .diag-options button {
  justify-content: space-between;
  min-height: 52px;
  padding: 0 18px;
  text-align: center;
  white-space: nowrap;
}

[data-step="age"].is-active .diag-options button::after {
  display: inline;
}

.diag-options button,
.diag-primary,
.diag-secondary {
  min-height: 56px;
  border-radius: 8px;
  line-height: 1.1;
  letter-spacing: 0;
}

.diag-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.2;
  text-align: left;
}

.diag-step.is-active .diag-options button::after {
  content: ">";
  color: var(--yellow);
}

.diag-options button:hover,
.diag-options button:focus-visible {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.diag-terms {
  margin: auto 0 0;
  padding-top: 22px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.diag-terms a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.diag-terms span {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
}

.diag-proof-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
}

.diag-proof-row span {
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.76);
  text-transform: uppercase;
}

.diag-actions {
  display: grid;
  gap: 10px;
  margin-top: 34px;
}

.diag-actions[hidden] {
  display: none;
}

.diag-note {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.diag-waitlist-form {
  display: grid;
  gap: 12px;
}

.diag-waitlist-form .diag-primary {
  margin-top: 0;
}

.diag-field {
  display: grid;
  gap: 8px;
}

.diag-field span {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}

.diag-field input {
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: 0;
}

.diag-field input::placeholder {
  color: rgba(255, 255, 255, 0.44);
}

.diag-field input:focus-visible {
  border-color: var(--yellow);
  outline: none;
}

.diag-consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.42;
}

.diag-consent input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--yellow);
}

.diag-consent a {
  color: var(--yellow);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.diag-form-message {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.diag-form-message.is-error {
  color: #ffb5ad;
}

.diag-form-message.is-success {
  color: #d6f8c5;
}

.diag-primary,
.diag-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid transparent;
  padding: 0 18px;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
}

.diag-primary {
  margin-top: auto;
  background: var(--yellow);
  color: #05050f;
  cursor: pointer;
}

.diag-primary:disabled {
  cursor: progress;
  opacity: 0.72;
}

.diag-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.34);
  color: rgba(255, 255, 255, 0.82);
}

.diag-back {
  position: absolute;
  top: 82px;
  left: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 520px) {
  .diag-page {
    align-items: stretch;
    padding: 0;
    background: rgba(8, 8, 31, 1);
  }

  .diag-card {
    width: 100%;
    min-height: 100svh;
    padding: 18px 20px 18px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .diag-progress {
    margin-top: 10px;
  }

  .diag-step {
    padding-top: clamp(30px, 7svh, 58px);
  }

  [data-step="age"] {
    padding-top: 16px;
  }

  [data-step="age"] .diag-kicker {
    margin-bottom: 12px;
    font-size: 11px;
  }

  [data-step="age"] h1 {
    max-width: 15.5ch;
    font-size: clamp(31px, 8.6vw, 36px);
  }

  [data-step="age"] .diag-subtitle {
    max-width: 21rem;
    margin-top: 10px;
    font-size: 15px;
  }

  .diag-step .diag-question {
    margin: 36px auto 16px;
    font-size: 18px;
  }

  [data-step="age"] .diag-options {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-top: 0;
  }

  [data-step="age"] .diag-options button {
    min-height: 50px;
    padding: 0 18px;
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .diag-step.is-active {
    animation: diag-in 180ms ease both;
  }

  @keyframes diag-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
