:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --primary: #0056d2;
  --text: #1a202c;
  --muted: #637085;
  --warning: #f59e0b;
  --critical: #dc2626;
  --success: #059669;
  --card: #ffffff;
  --border: #d7dde5;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  --radius-lg: 18px;
  --radius-md: 12px;
  --font-sans: "Inter", "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Roboto Mono", "JetBrains Mono", "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 420px at 0% -10%, rgba(0, 86, 210, 0.08), transparent 60%),
    radial-gradient(900px 400px at 100% 10%, rgba(5, 150, 105, 0.06), transparent 60%),
    linear-gradient(180deg, #f4f6f8 0%, #eef2f6 100%);
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 32, 44, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 32, 44, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

body.is-locked {
  overflow: hidden;
}

.app {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  margin: 0 auto;
}

.screen {
  min-height: 100vh;
  padding: 20px 20px 28px;
  display: none;
  flex-direction: column;
  gap: 24px;
}

.screen.is-active {
  display: flex;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6b7280;
}

.app-header__icon,
.app-header__icon svg {
  width: 20px;
  height: 20px;
}

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

.hero h1 {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  vertical-align: middle;
}

.hero-tag--success {
  color: #065f46;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.18), rgba(5, 150, 105, 0.06));
  border-color: rgba(5, 150, 105, 0.35);
}

.hero-tag--critical {
  color: #7f1d1d;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.18), rgba(220, 38, 38, 0.06));
  border-color: rgba(220, 38, 38, 0.35);
}

.hero__sub {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.hero-bullets {
  list-style: none;
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 86, 210, 0.15);
  background: rgba(0, 86, 210, 0.04);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.hero-bullets li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
}

.hero-bullets__icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(0, 86, 210, 0.35);
  background: rgba(0, 86, 210, 0.08);
  position: relative;
  margin-top: 2px;
}

.hero-bullets__icon::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 2px;
  background: rgba(0, 86, 210, 0.65);
}

.hero-image {
  align-self: center;
  display: flex;
  justify-content: center;
  padding: 8px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #e2e8f0;
}

.hero-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 78vw;
  max-height: 340px;
  object-fit: contain;
}


.btn {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(0, 86, 210, 0.18);
}

.btn-warning {
  background: var(--warning);
  color: #1a202c;
  box-shadow: 0 10px 18px rgba(245, 158, 11, 0.2);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.quiz-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-title {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.progress {
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress__track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #dde3ec;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #1971f2);
  border-radius: inherit;
  transition: width 0.3s ease-in-out;
}

.progress__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  min-width: 60px;
  text-align: right;
}

.question-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question-card.is-exiting {
  animation: slideOutLeft 0.22s ease forwards;
}

.question-card.is-entering {
  animation: slideInRight 0.26s ease forwards;
}

.question-kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--font-mono);
}

.question-text {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}

.options {
  display: grid;
  gap: 12px;
}

.option-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: #ffffff;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  line-height: 1.4;
  transition: border 0.2s ease, background 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.option-card:hover {
  border-color: rgba(0, 86, 210, 0.6);
}

.option-card:focus-visible {
  outline: 2px solid rgba(0, 86, 210, 0.7);
  outline-offset: 2px;
}

.option-card.is-selected {
  border-color: var(--primary);
  background: rgba(0, 86, 210, 0.06);
}

.option-letter {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.option-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.option-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.result-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #7f1d1d;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-banner__icon,
.result-banner__icon svg {
  width: 16px;
  height: 16px;
}

.result-headline {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
}

.gauge {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.gauge__visual {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge__svg {
  width: min(260px, 100%);
  height: auto;
}

.gauge__track {
  stroke: #e2e8f0;
  stroke-width: 14;
  fill: none;
}

.gauge__meter {
  stroke: var(--warning);
  stroke-width: 14;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.8s ease;
}

.gauge__value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  position: absolute;
  bottom: 14px;
}

.gauge__caption {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.result-lead {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.diagnostic-grid {
  display: grid;
  gap: 12px;
}

.diagnostic-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: var(--card);
}

.diagnostic-card__icon,
.diagnostic-card__icon svg {
  width: 20px;
  height: 20px;
}

.diagnostic-card__title {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.diagnostic-card__status {
  font-size: 13px;
  font-weight: 600;
}

.diagnostic-card__status.success {
  color: var(--success);
}

.diagnostic-card__status.critical {
  color: var(--critical);
}

.result-pitch {
  display: grid;
  gap: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 86, 210, 0.18);
  background: rgba(0, 86, 210, 0.04);
}

.screen--vsl {
  gap: 18px;
}

.app-header--vsl {
  color: #7c8aa0;
}

.vsl-headline {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
}

.vsl-player {
  background: transparent;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--shadow);
  padding: 0;
  min-height: 220px;
}

.vsl-player vturb-smartplayer {
  display: block;
  width: 100%;
}

@media (max-width: 720px) {
  .vsl-player {
    margin-left: -20px;
    margin-right: -20px;
    border-radius: 0;
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.loading-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.loading-card {
  width: min(420px, 90vw);
  background: #0b1220;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 22px 20px;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loading-visual {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spinner {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.25);
  border-top-color: #f8fafc;
  animation: spin 1s linear infinite;
}

.spinner.is-active {
  display: block;
}

.loading-icon {
  width: 28px;
  height: 28px;
  color: var(--success);
  display: none;
}

.loading-icon.is-active {
  display: block;
}

.loading-icon svg {
  width: 100%;
  height: 100%;
}

.loading-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.loading-title.is-alert {
  color: var(--warning);
  animation: alertBlink 0.9s ease-in-out infinite;
}

.loading-checks {
  display: none;
  gap: 6px;
  font-size: 13px;
  color: rgba(248, 250, 252, 0.76);
}

.loading-checks.is-active {
  display: grid;
}

.loading-checks div {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.loading-checks.is-active div {
  opacity: 1;
  transform: translateY(0);
}

.loading-checks.is-active div:nth-child(2) {
  transition-delay: 0.12s;
}

.loading-checks.is-active div:nth-child(3) {
  transition-delay: 0.24s;
}

.loading-bar {
  display: none;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.loading-bar.is-active {
  display: block;
}

.loading-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, var(--success));
  transition: width 1s ease;
}

.loading-bar__fill.is-animating {
  width: 100%;
}

.loading-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(248, 250, 252, 0.6);
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-24px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes alertBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@media (min-width: 720px) {
  .screen {
    padding: 32px 28px 40px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .diagnostic-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
