:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #5a5a5a;
  --line: #e8e4dd;
  --accent: #ff3d6e;
  --accent-dark: #e02858;
  --accent-soft: #fff0f4;
  --success: #00a86b;
  --warn: #f59e0b;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.06), 0 24px 48px rgba(0,0,0,.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app { min-height: 100vh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.screen[hidden] { display: none !important; }
.container { width: 100%; max-width: 720px; margin: 0 auto; }
.container--narrow { max-width: 640px; }

/* Typography */
h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); line-height: 1.15; margin: 0 0 16px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 12px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; margin: 0 0 8px; font-weight: 600; }
.lead { font-size: 1.0625rem; color: var(--ink-soft); margin: 0 0 28px; }
.meta { font-size: 0.875rem; color: var(--ink-soft); margin-top: 24px; }
.meta a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Intro */
.screen--intro { text-align: center; }
.badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
  letter-spacing: 0.01em;
}

/* Buttons */
.btn {
  font: inherit;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  padding: 14px 26px;
  border-radius: 999px;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
  font-size: 1rem;
}
.btn--primary {
  background: var(--ink);
  color: #fff;
}
.btn--primary:hover { background: #000; transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover { background: var(--surface); }
.btn--accent {
  background: var(--accent);
  color: #fff;
}
.btn--accent:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn--block { width: 100%; }

/* Test */
.test-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}
.progress {
  flex: 1;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  width: 0;
  transition: width .4s ease;
}
.progress__label {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

.step { display: none; animation: fadeIn .3s ease; }
.step.is-active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.step__question {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  line-height: 1.25;
}
.step__hint {
  color: var(--ink-soft);
  margin: 0 0 28px;
  font-size: 0.9375rem;
}

/* Options */
.options { display: grid; gap: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s ease;
  font-size: 0.9375rem;
}
.option:hover { border-color: var(--ink); }
.option input { display: none; }
.option__box {
  width: 20px; height: 20px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all .15s ease;
}
.option--radio .option__box { border-radius: 50%; }
.option input:checked + .option__box {
  border-color: var(--accent);
  background: var(--accent);
}
.option input:checked + .option__box::after {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.option--check input:checked + .option__box::after {
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 8 7 12 13 4'/></svg>") center/14px no-repeat;
}
.option--radio input:checked + .option__box::after {
  background: white;
  border-radius: 50%;
  inset: 5px;
}
.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.option__label { flex: 1; }

/* Text inputs */
.field { margin-bottom: 12px; }
.textarea, .input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  resize: vertical;
  transition: border-color .15s ease;
}
.textarea { min-height: 140px; }
.textarea:focus, .input:focus { outline: 0; border-color: var(--ink); }
.char-count {
  text-align: right;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* Conditional section header */
.section-divider {
  margin: 0 0 16px;
  padding: 8px 14px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  display: inline-block;
}

.subgroup { margin-bottom: 28px; }
.subgroup:last-child { margin-bottom: 0; }
.subgroup__title {
  font-weight: 600;
  margin: 0 0 12px;
  font-size: 0.9375rem;
}

/* Footer */
.test-footer {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.test-footer .btn--ghost { padding: 10px 18px; }

/* Loading */
.screen--loading { text-align: center; }
.loader {
  width: 56px;
  height: 56px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 28px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Result */
.screen--result { padding: 56px 20px; align-items: flex-start; }
.result-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.result-block h2 {
  font-size: 1.375rem;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.result-block p { margin: 0 0 14px; color: var(--ink); }
.result-block p:last-child { margin-bottom: 0; }

.insights { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.insight {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--line);
}
.insight--strength { border-color: var(--success); }
.insight--opportunity { border-color: var(--warn); }
.insight--bottleneck { border-color: var(--danger); }
.insight__icon { font-size: 1.125rem; flex-shrink: 0; }
.insight__text { flex: 1; font-size: 0.9375rem; line-height: 1.5; }

.recommendation {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  color: white;
  border: 0;
}
.recommendation h2 { color: white; }
.recommendation p { color: rgba(255,255,255,0.85); }
.recommendation .course-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 16px;
}
.recommendation .course-card h3 {
  color: white;
  font-size: 1.25rem;
  margin: 0 0 6px;
}
.recommendation .course-card p {
  color: rgba(255,255,255,0.75);
  font-size: 0.9375rem;
  margin: 0 0 16px;
}
.course-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.course-actions .btn { padding: 11px 20px; font-size: 0.9375rem; }
.btn--outline-light {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn--outline-light:hover { background: rgba(255,255,255,0.08); }

.route { counter-reset: route; padding: 0; margin: 0; list-style: none; }
.route__item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: route;
}
.route__item:last-child { border-bottom: 0; }
.route__item::before {
  content: counter(route);
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--ink);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}
.route__content { flex: 1; }
.route__content strong { display: block; margin-bottom: 2px; }
.route__content small { color: var(--ink-soft); font-size: 0.875rem; }
.route__content .course-actions { margin-top: 8px; }
.route__content .course-actions .btn { padding: 7px 14px; font-size: 0.8125rem; }
.route__content .btn--ghost { border-color: var(--line); }

.result-actions {
  text-align: center;
  margin-top: 32px;
}

/* Mobile */
@media (max-width: 640px) {
  .screen { padding: 32px 16px; }
  .test-footer { flex-direction: column-reverse; }
  .test-footer .btn { width: 100%; }
  .result-block { padding: 22px; }
}
