/* ============================================================
   tests-runner.css — styles for the test-taking experience
   on single-tests.php. Class names match the legacy state-machine
   JS (do not rename .testing_row / .nums / .question / .variants
   / .result / etc — the inline jQuery reads these selectors).
   ============================================================ */

.testing_title .t-meta {
  font-size: 0.55em;
  font-weight: 500;
  color: var(--d-500);
  margin-left: 8px;
  white-space: nowrap;
}

.testing_container {
  padding-bottom: 64px;
}

.testing_container > .row {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Question number strip ───────────────────────────────── */
.testing_row .nums {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--d-100);
  border-radius: var(--rd-md);
  box-shadow: var(--sh-sm);
}

.testing_row .nums .item {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--d-700);
  background: var(--d-50);
  border: 1.5px solid var(--d-100);
  border-radius: var(--rd-sm);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
  user-select: none;
}

.testing_row .nums .item:hover {
  border-color: var(--d-300);
  transform: translateY(-1px);
}

.testing_row .nums .item.filled {
  background: color-mix(in oklab, var(--sage-500) 14%, var(--paper));
  border-color: color-mix(in oklab, var(--sage-500) 35%, transparent);
  color: var(--d-800);
}

.testing_row .nums .item.active {
  background: var(--r-600);
  border-color: var(--r-600);
  color: #fff;
  box-shadow: 0 6px 16px rgba(173, 35, 36, 0.25);
}

/* ── Questions stack ─────────────────────────────────────── */
.testing_row .questions {
  position: relative;
}

.testing_row .question {
  display: none;
  padding: 32px;
  background: var(--paper);
  border: 1px solid var(--d-100);
  border-radius: var(--rd-md);
  box-shadow: var(--sh-md);
}

.testing_row .question.active {
  display: block;
}

.testing_row .question h4 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--d-900);
  margin: 0 0 22px;
}

/* ── Variants (answer rows) ──────────────────────────────── */
.testing_row .variants {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.testing_row .variants .item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--d-50);
  border: 1.5px solid var(--d-100);
  border-radius: var(--rd-sm);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.testing_row .variants .item:hover {
  border-color: var(--d-300);
  background: var(--paper);
}

.testing_row .variants .item input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 2px solid var(--d-300);
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color .15s ease;
}

.testing_row .variants .item input[type="radio"]:checked {
  border-color: var(--r-600);
}

.testing_row .variants .item input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--r-600);
}

.testing_row .variants .item label {
  flex: 1;
  font-size: 15px;
  line-height: 1.5;
  color: var(--d-800);
  cursor: pointer;
}

.testing_row .variants .item label::before {
  content: '';
  position: absolute;
  inset: 0;
}

.testing_row .variants .item.item_correct {
  background: color-mix(in oklab, var(--sage-500) 12%, var(--paper));
  border-color: color-mix(in oklab, var(--sage-500) 45%, transparent);
}

.testing_row .variants .item.item_correct input[type="radio"] {
  border-color: var(--sage-500);
}

.testing_row .variants .item.item_correct input[type="radio"]::after {
  background: var(--sage-500);
}

.testing_row .variants .item.item_wrong {
  background: color-mix(in oklab, var(--r-500) 10%, var(--paper));
  border-color: color-mix(in oklab, var(--r-500) 45%, transparent);
}

.testing_row .variants .item.item_wrong input[type="radio"]:checked::after {
  background: var(--r-500);
}

/* ── Per-question feedback message ───────────────────────── */
.testing_row .testing-result {
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--rd-sm);
  display: none;
}

.testing_row .testing-result_correct,
.testing_row .testing-result_wrong {
  display: block;
}

.testing_row .testing-result_correct {
  background: color-mix(in oklab, var(--sage-500) 14%, var(--paper));
  color: color-mix(in oklab, var(--sage-500) 65%, var(--d-900));
}

.testing_row .testing-result_wrong {
  background: color-mix(in oklab, var(--r-500) 12%, var(--paper));
  color: var(--r-700);
}

/* ── Action buttons row ──────────────────────────────────── */
.testing_row > #answer_btn,
.testing_row > .btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.testing_row > .btns {
  align-items: center;
}

/* ── Results screen ──────────────────────────────────────── */
.testing_container .result {
  display: none;
  padding: 40px;
  background: var(--paper);
  border: 1px solid var(--d-100);
  border-radius: var(--rd-md);
  box-shadow: var(--sh-lg);
  text-align: center;
}

.testing_container .result h3 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--d-900);
  margin: 0 0 24px;
}

.testing_container .result__item {
  display: none;
  padding: 24px;
  margin: 0 auto 24px;
  max-width: 580px;
  background: var(--d-50);
  border: 1px solid var(--d-100);
  border-radius: var(--rd-sm);
  text-align: left;
}

.testing_container .result__item__mark {
  font-size: 17px;
  font-weight: 700;
  color: var(--d-900);
  margin: 0 0 10px;
}

.testing_container .result__item__mark__value {
  color: var(--r-600);
  margin-left: 6px;
}

.testing_container .result__item p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--d-600);
  margin: 0;
}

.testing_container .result .table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 580px;
  margin: 0 auto 28px;
}

.testing_container .result .table .item {
  padding: 20px;
  background: var(--cream-50);
  border-radius: var(--rd-sm);
  text-align: center;
}

.testing_container .result .table .item p {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--d-500);
  margin: 0 0 6px;
}

.testing_container .result .table .item h5 {
  font-size: 28px;
  font-weight: 800;
  color: var(--r-600);
  margin: 0;
  line-height: 1;
}

.testing_container .testing-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

/* ── "Ваши ответы" review heading ────────────────────────── */
.testing_container .results-block {
  display: none;
  padding: 16px 0 4px;
  border-top: 1px dashed var(--d-200);
}

.testing_container .results-block__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--d-900);
  margin: 0;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .testing_row .question {
    padding: 22px 18px;
  }
  .testing_row .question h4 {
    font-size: 17px;
  }
  .testing_row .nums .item {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
  .testing_container .result {
    padding: 28px 20px;
  }
  .testing_container .result h3 {
    font-size: 24px;
  }
  .testing_container .result .table {
    grid-template-columns: 1fr;
  }
  .testing_container .result .table .item h5 {
    font-size: 24px;
  }
}
