/* ================================================================
   Povion — Test Styles (quiz, progress, results)
   ================================================================ */

.test-container {
  max-width: 720px;
  margin: var(--space-8) auto;
  padding: 0 var(--space-4);
}

.screen { display: none; }
.screen.active { display: block; }

/* ── START SCREEN ────────────────────────────────────────────── */
.test-title {
  font-size: clamp(24px, 3vw + 8px, 34px);
  font-weight: 800; text-align: center;
  margin-bottom: var(--space-3);
}
.test-title em {
  font-style: normal; color: var(--brand);
}

.test-desc {
  font-size: 15px; color: var(--ink-2);
  text-align: center; margin-bottom: var(--space-6);
  line-height: 1.6; max-width: 560px; margin-inline: auto;
}

.btn-start {
  display: block; margin: 0 auto;
  padding: 16px 48px;
  background: var(--brand);
  color: #fff; border: none;
  border-radius: var(--radius-md);
  font-size: 17px; font-weight: 700;
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn-start:hover {
  background: var(--brand-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(47,111,237,.3);
}
.btn-start:active { transform: scale(.97); }

/* ── DRAFT BANNER ────────────────────────────────────────────── */
.draft-banner {
  background: var(--gold-3);
  border: 1.5px solid #f0d78c;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  text-align: center;
}
.draft-banner p {
  margin: 0 0 var(--space-3);
  color: var(--ink-2); font-weight: 600;
}
.draft-banner__actions {
  display: flex; gap: var(--space-3);
  justify-content: center; flex-wrap: wrap;
}
.btn-start--small { margin: 0; padding: 12px 28px; font-size: 15px; }

/* ── QUIZ SCREEN ─────────────────────────────────────────────── */
.progress-bar-container {
  width: 100%; height: 8px;
  background: var(--surface-hover);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-5);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--brand);
  border-radius: var(--radius-full);
  transition: width .4s var(--ease);
}

.quiz-meta {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: var(--space-3);
  gap: var(--space-3);
}

.track-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  background: var(--brand-3);
  color: var(--brand);
  font-size: 12px; font-weight: 700;
}

.question-counter {
  font-size: 13px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.question-text {
  font-size: clamp(18px, 2.5vw + 6px, 24px);
  font-weight: 700; color: var(--ink);
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

.question-hint {
  margin-bottom: var(--space-4);
  font-size: 13px; color: var(--ink-3);
}

/* ── OPTIONS ─────────────────────────────────────────────────── */
.options-container {
  display: flex; flex-direction: column;
  gap: var(--space-3); margin-bottom: var(--space-6);
}

.option-label {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 14px 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  font-size: 15px;
  min-height: 44px;
}
.option-label:hover {
  border-color: var(--brand);
  background: var(--brand-3);
}
.option-label.selected {
  border-color: var(--brand);
  background: var(--brand-3);
  box-shadow: 0 0 0 3px rgba(47,111,237,.12);
}
.option-label input[type="radio"],
.option-label input[type="checkbox"] {
  margin: 0; transform: scale(1.2);
  accent-color: var(--brand);
  flex-shrink: 0;
}
.option-label span { flex: 1; }

/* ── ACHIEVEMENTS TABLE ──────────────────────────────────────── */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin-bottom: var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.stage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.stage-table th, .stage-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: center;
}
.stage-table th {
  background: var(--surface-2);
  color: var(--ink); font-weight: 600;
  font-size: 13px;
}
.stage-table td:first-child {
  text-align: left; font-weight: 600;
  color: var(--brand);
}
.stage-table input[type="radio"] {
  transform: scale(1.4);
  accent-color: var(--brand);
  cursor: pointer;
}

/* ── NAVIGATION ──────────────────────────────────────────────── */
.quiz-nav {
  display: flex; gap: var(--space-3);
  align-items: center; padding-bottom: var(--space-4);
}

.btn-next {
  flex: 1;
  padding: 14px;
  background: var(--ink-3);
  color: #fff; border: none;
  border-radius: var(--radius-md);
  font-size: 16px; font-weight: 700;
  cursor: not-allowed;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn-next.active {
  background: var(--brand);
  cursor: pointer;
}
.btn-next.active:hover { background: var(--brand-2); }
.btn-next:active { transform: scale(.97); }

.btn-prev, .btn-secondary {
  padding: 14px 24px;
  background: var(--surface);
  color: var(--ink-2);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.btn-prev:hover, .btn-secondary:hover {
  background: var(--surface-hover);
}

/* ── RESULT SCREEN ───────────────────────────────────────────── */
.result-actions {
  display: flex; gap: var(--space-3);
  justify-content: center; margin-top: var(--space-6);
  flex-wrap: wrap;
}
.result-actions .btn-start { margin: 0; }

.result-card {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--brand);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.result-card h3 {
  margin-top: 0; color: var(--ink);
  font-size: 19px; display: flex;
  align-items: center; gap: var(--space-2);
}
.result-card h3::before {
  content: attr(data-place);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--brand-3); color: var(--brand);
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 800;
}

.result-card p {
  margin: 8px 0; font-size: 14px;
  color: var(--ink-2); line-height: 1.5;
}

.chance-high { color: var(--ok); font-weight: 700; }
.chance-mid   { color: #d97706; font-weight: 700; }
.chance-low   { color: var(--urgent); font-weight: 700; }

.result-card__note { color: var(--ink-3); font-size: 12px; }

.result-card__header {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: var(--space-3);
}

.result-card__catalog-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 14px;
  background: var(--brand);
  color: #fff; border-radius: var(--radius-full);
  text-decoration: none; font-size: 13px; font-weight: 600;
  transition: background var(--dur) var(--ease);
}
.result-card__catalog-link:hover { background: var(--brand-2); }

/* Chance bar */
.chance-bar {
  width: 100%; height: 8px;
  background: var(--surface-hover);
  border-radius: var(--radius-full);
  margin: 8px 0; overflow: hidden;
}
.chance-bar__fill {
  height: 100%; border-radius: var(--radius-full);
  transition: width .6s var(--ease);
}
.chance-bar__fill--high { background: var(--ok); }
.chance-bar__fill--mid   { background: #d97706; }
.chance-bar__fill--low   { background: var(--urgent); }

/* ── RESULTS OLYMPIADS ───────────────────────────────────────── */
.results-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.result-olympiads {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--line-strong);
}
.result-olympiads__title {
  font-size: 13px; font-weight: 700;
  color: var(--ink); margin-bottom: var(--space-3);
}
.result-olympiads__list {
  display: flex; flex-direction: column; gap: var(--space-2);
}
.result-olymp-item {
  display: flex; justify-content: space-between;
  align-items: center; gap: var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3); font-size: 14px;
}
.result-olymp-item__info {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0; flex: 1;
}
.result-olymp-item__title {
  font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-olymp-item__meta {
  font-size: 12px; color: var(--ink-3);
}
.result-olymp-item__link {
  color: var(--brand); font-weight: 600;
  text-decoration: none; white-space: nowrap;
  font-size: 13px; flex-shrink: 0;
}
.result-olymp-item__link:hover { text-decoration: underline; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .quiz-nav { flex-direction: column; }
  .btn-prev, .btn-secondary { width: 100%; text-align: center; }
  .result-card__header { flex-direction: column; align-items: flex-start; }
  .result-olymp-item { flex-direction: column; align-items: flex-start; }
}
