:root {
  --bg-1: #0d0d1a;
  --bg-2: #0b0f17;

  --surface-1: rgba(16, 23, 37, 0.72);
  --surface-2: rgba(16, 23, 37, 0.56);
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  --text: rgba(255, 255, 255, 0.94);
  --text-dim: rgba(229, 231, 235, 0.82);
  --text-muted: rgba(156, 163, 175, 0.92);

  --primary: #0066ff;
  --primary-2: #0b57d0;

  --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
  --glow: 0 0 28px rgba(0, 102, 255, 0.28);
  --glow-soft: 0 0 80px rgba(0, 102, 255, 0.18);

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;

  --focus: 0 0 0 4px rgba(0, 102, 255, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(900px 520px at 0% 0%, rgba(0, 102, 255, 0.16), transparent 55%),
    radial-gradient(900px 520px at 100% 100%, rgba(0, 102, 255, 0.14), transparent 55%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

.container {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
}

.main {
  padding: 28px 0 72px;
}

.top {
  display: flex;
  justify-content: center;
  padding: 12px 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 14px;
  box-shadow: var(--glow-soft);
  text-align: center;
}

.brand-logo {
  display: block;
  width: min(420px, 70vw);
  height: auto;
  max-height: 64px;
  object-fit: contain;
}

.card {
  background: linear-gradient(145deg, rgba(16, 23, 37, 0.8) 0%, rgba(16, 23, 37, 0.55) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card-head {
  padding: 18px 18px 0;
}

.card-body {
  padding: 18px;
}

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
}

.progress {
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px;
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 102, 255, 0.35);
  background: rgba(0, 102, 255, 0.12);
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 12px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  box-shadow: var(--glow);
  transition: width 260ms ease;
}

.screen {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.screen.is-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.title-xl {
  margin: 6px 0 0;
  font-size: clamp(28px, 4.3vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.title-md {
  margin: 0;
  font-size: clamp(18px, 3.2vw, 22px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 900;
}

.subtitle-lg {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 16px;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 14px;
  white-space: pre-line;
}

.kicker {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.q-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.choices {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 160ms ease, transform 140ms ease, background 160ms ease, box-shadow 160ms ease;
  user-select: none;
}

.choice:hover {
  border-color: rgba(0, 102, 255, 0.38);
  background: rgba(0, 102, 255, 0.08);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.choice:active {
  transform: translateY(1px);
}

.choice[aria-pressed="true"] {
  border-color: rgba(0, 102, 255, 0.55);
  background: rgba(0, 102, 255, 0.14);
  box-shadow: var(--glow);
}

.choice-bullet {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  margin-top: 2px;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  flex: 0 0 auto;
}

.choice[aria-pressed="true"] .choice-bullet {
  border-color: rgba(0, 102, 255, 0.9);
  box-shadow: 0 0 18px rgba(0, 102, 255, 0.32);
}

.choice-label {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
}

.actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.actions-split {
  justify-content: space-between;
}

.btn {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.08);
  transition: transform 140ms ease, background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
}

.btn:focus {
  outline: none;
  box-shadow: var(--focus);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  border-color: rgba(0, 102, 255, 0.55);
  box-shadow: var(--glow);
}

.btn-primary:hover {
  filter: saturate(1.05);
  box-shadow: 0 18px 55px rgba(0, 102, 255, 0.22);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
}

.label {
  font-weight: 700;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.92);
  padding: 12px 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: rgba(229, 231, 235, 0.5);
  font-weight: 400;
}

input:focus {
  border-color: rgba(0, 102, 255, 0.55);
  box-shadow: var(--focus);
  background: rgba(255, 255, 255, 0.04);
}

.error {
  margin: 10px 0 0;
  font-size: 12px;
  color: rgba(255, 140, 140, 0.95);
  min-height: 16px;
}

.fineprint {
  margin: 12px 0 0;
  font-size: 12px;
  color: rgba(156, 163, 175, 0.92);
}

.result-box {
  margin-top: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.14);
  padding: 12px;
}

.result-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.metric-value {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.95);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.20);
  border-top-color: rgba(255, 255, 255, 0.85);
  display: none;
  animation: spin 0.9s linear infinite;
}

.is-loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 28px));
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(16, 23, 37, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: var(--shadow);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.form-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-2px);
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}
