/* ══════════════════════════════════════════
   ПЕРЕМЕННЫЕ
══════════════════════════════════════════ */
:root {
  --orange: #FF5722;
  --orange-light: #FF7043;
  --orange-dim: rgba(255,87,34,0.12);
  --bg: #0f0f13;
  --surface: #18181f;
  --surface2: #1e1e28;
  --border: rgba(255,255,255,0.07);
  --text: #f0ede8;
  --muted: #7a7a8c;
  --correct: #22c55e;
  --wrong: #ef4444;
  --correct-dim: rgba(34,197,94,0.12);
  --wrong-dim: rgba(239,68,68,0.12);
}

/* ЭКРАН ВЫБОРА ТЕСТА */
.selection-screen {
  padding: 40px 20px;
  text-align: center;
}

.test-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto;
}

.test-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 24px;
  width: 260px;
  cursor: pointer;
  transition: all 0.3s;
}

.test-card:hover {
  transform: translateY(-8px);
  border-color: var(--orange);
  box-shadow: 0 0 30px rgba(255,87,34,0.25);
}

.test-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.test-card h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 22px;
  margin-bottom: 8px;
}

.test-card p {
  color: var(--muted);
  font-size: 14px;
}

/* ══════════════════════════════════════════
   СБРОС И БАЗА
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Onest', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Фоновая текстура */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 10%, rgba(255,87,34,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(255,87,34,0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ══════════════════════════════════════════
   ШАПКА
══════════════════════════════════════════ */
.start-screen {
  text-align: center;
  padding: 80px 20px;
}

.test-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 56px; height: 56px;
  background: var(--orange);
  border-radius: 12px;
  display: grid; place-items: center;
  font-family: 'Unbounded', sans-serif;
  font-weight: 900; font-size: 18px;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 0 28px rgba(255,87,34,0.4);
}

.header-title h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.3px;
}

.header-title p { font-size: 13px; color: var(--muted); margin-top: 2px; }

.timer-badge {
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 18px;
  font-family: 'Unbounded', sans-serif;
  font-size: 18px; font-weight: 700;
  color: var(--orange);
  letter-spacing: 1px;
  min-width: 90px; text-align: center;
  transition: color 0.3s;
}

.timer-badge.urgent {
  color: var(--wrong);
  animation: pulse-timer 1s infinite;
}

@keyframes pulse-timer {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ══════════════════════════════════════════
   НАВИГАЦИЯ
══════════════════════════════════════════ */
.nav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 28px;
}

.nav-label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 14px;
}

.nav-dots { display: flex; flex-wrap: wrap; gap: 8px; }

.nav-dot {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: 'Unbounded', sans-serif;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.nav-dot:hover            { border-color: var(--orange); color: var(--orange); }
.nav-dot.active           { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 0 12px rgba(255,87,34,0.45); }
.nav-dot.answered         { border-color: var(--correct); color: var(--correct); }
.nav-dot.answered::after  {
  content: ''; position: absolute; bottom: 1px; right: 1px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--correct);
}
.nav-dot.active.answered  { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ══════════════════════════════════════════
   КАРТОЧКА ВОПРОСА
══════════════════════════════════════════ */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 20px;
  animation: slide-in 0.35s cubic-bezier(.22,.68,0,1.2);
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.question-header {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 28px 28px 24px;
  border-bottom: 1px solid var(--border);
}

.q-num {
  font-family: 'Unbounded', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--orange);
  background: var(--orange-dim);
  border-radius: 8px; padding: 5px 12px;
  white-space: nowrap; flex-shrink: 0; margin-top: 2px;
}

.q-text { font-size: 17px; line-height: 1.55; font-weight: 400; }

/* ══════════════════════════════════════════
   ВАРИАНТЫ ОТВЕТОВ
══════════════════════════════════════════ */
.options {
  padding: 20px 28px 28px;
  display: flex; flex-direction: column; gap: 10px;
}

.option {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.option:hover:not(.locked)       { border-color: var(--orange); background: var(--orange-dim); }
.option.selected:not(.locked)    { border-color: var(--orange); background: var(--orange-dim); }
.option.correct                  { border-color: var(--correct); background: var(--correct-dim); }
.option.wrong                    { border-color: var(--wrong);   background: var(--wrong-dim); }
.option.locked                   { cursor: default; }

.opt-letter {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid currentColor;
  display: grid; place-items: center;
  font-family: 'Unbounded', sans-serif;
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  flex-shrink: 0; transition: all 0.2s;
}

.option.selected:not(.locked) .opt-letter { color: var(--orange); border-color: var(--orange); }

.option.selected:not(.locked) .opt-letter::after,
.option.correct .opt-letter::after {
  content: ''; display: block;
  width: 10px; height: 10px; border-radius: 50%;
  background: currentColor;
}

.option.correct .opt-letter { color: var(--correct); border-color: var(--correct); }
.option.wrong   .opt-letter { color: var(--wrong);   border-color: var(--wrong);   }
.option.wrong   .opt-letter::after { content: '✕'; font-size: 9px; background: none; }

.opt-text { font-size: 15px; line-height: 1.4; }

/* ══════════════════════════════════════════
   ПРОГРЕСС-БАР
══════════════════════════════════════════ */
.progress-bar-wrap { margin-bottom: 18px; }

.progress-bar-track {
  height: 4px; background: var(--surface2); border-radius: 99px; overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange) 0%, var(--orange-light) 100%);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ══════════════════════════════════════════
   НИЖНЯЯ ПАНЕЛЬ
══════════════════════════════════════════ */
.footer-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}

.progress-info { font-size: 13px; color: var(--muted); }
.progress-info b { color: var(--text); }

.btn {
  font-family: 'Unbounded', sans-serif;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 14px 28px; border-radius: 12px; border: none;
  cursor: pointer; transition: all 0.2s;
}

.btn-outline {
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

.btn-primary {
  background: var(--orange); color: #fff;
  box-shadow: 0 0 20px rgba(255,87,34,0.35);
}
.btn-primary:hover {
  background: var(--orange-light);
  box-shadow: 0 0 28px rgba(255,87,34,0.5);
  transform: translateY(-1px);
}

.btn-danger {
  background: transparent; color: var(--wrong);
  border: 1.5px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: var(--wrong-dim); }

/* ══════════════════════════════════════════
   ЭКРАН РЕЗУЛЬТАТА
══════════════════════════════════════════ */
.result-screen {
  text-align: center; padding: 60px 20px;
  animation: slide-in 0.4s ease;
}

.result-circle {
  width: 140px; height: 140px; border-radius: 50%;
  margin: 0 auto 32px;
  display: grid; place-items: center;
  position: relative;
}

.result-circle svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.result-circle circle { fill: none; stroke-width: 6; }
.result-circle .track { stroke: var(--surface2); }
.result-circle .fill  { stroke: var(--orange); stroke-linecap: round; transition: stroke-dashoffset 1.2s ease; }

.result-pct {
  font-family: 'Unbounded', sans-serif;
  font-size: 36px; font-weight: 900; color: var(--orange);
  position: relative; z-index: 1;
}

.result-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 26px; font-weight: 700; margin-bottom: 10px;
}

.result-sub { color: var(--muted); font-size: 15px; margin-bottom: 40px; }

.result-stats {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 40px;
}

.stat-pill {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 28px; min-width: 130px;
}

.stat-num       { font-family: 'Unbounded', sans-serif; font-size: 28px; font-weight: 900; }
.stat-num.c     { color: var(--correct); }
.stat-num.w     { color: var(--wrong); }
.stat-num.sk    { color: var(--muted); }
.stat-lbl       { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ══════════════════════════════════════════
   РАЗБОР ОТВЕТОВ
══════════════════════════════════════════ */
.review-section { margin-top: 40px; text-align: left; }

.review-title {
  font-family: 'Unbounded', sans-serif; font-size: 14px; font-weight: 700;
  letter-spacing: 0.5px; color: var(--muted); text-transform: uppercase;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

.review-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px; margin-bottom: 10px;
}

.review-item .ri-q     { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.review-item .ri-answers { display: flex; flex-direction: column; gap: 5px; }

.ri-ans {
  font-size: 13px; color: var(--muted);
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid transparent;
}
.ri-ans.correct { color: var(--correct); background: var(--correct-dim); border-color: rgba(34,197,94,0.2); }
.ri-ans.wrong   { color: var(--wrong);   background: var(--wrong-dim);   border-color: rgba(239,68,68,0.2); }

/* ══════════════════════════════════════════
   МОДАЛЬНОЕ ОКНО
══════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: grid; place-items: center; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}

.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 32px; max-width: 400px; width: 90%;
  transform: scale(0.95); transition: transform 0.2s;
  text-align: center;
}

.modal-overlay.show .modal-box { transform: scale(1); }

.modal-icon { font-size: 48px; margin-bottom: 16px; }
.modal-box h2 { font-family: 'Unbounded', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.modal-box p  { color: var(--muted); font-size: 14px; margin-bottom: 28px; line-height: 1.5; }
.modal-btns   { display: flex; gap: 10px; justify-content: center; }

/* ══════════════════════════════════════════
   АДАПТИВ
══════════════════════════════════════════ */
@media (max-width: 600px) {
  .question-header { padding: 20px; flex-direction: column; gap: 10px; }
  .options         { padding: 14px 20px 20px; }
  .footer-bar      { flex-direction: column; align-items: stretch; }
  .footer-bar .btn { text-align: center; }
  header           { flex-wrap: wrap; }
}
