/* --- tests: a question at a time -------------------------------------- */

.test-setup {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.test-setup fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.test-setup legend {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.test-setup .options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.test-setup label.option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
}

.test-setup label.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.test-setup input[type="number"] {
  max-width: 120px;
  min-height: 44px;
  padding: 0 12px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.test-note {
  margin: 0;
  color: var(--danger);
}

.test-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 24px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.test-question .q-label {
  color: var(--muted);
  font-size: 13px;
}

.test-question .q-text {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

button.choice {
  justify-content: flex-start;
  gap: 12px;
  min-height: 64px;
  padding: 10px 16px;
  border: var(--border-w) solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
  font-size: 17px;
  font-weight: 400;
  text-align: left;
}

button.choice:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--accent);
}

button.choice:disabled {
  opacity: 1;
  cursor: default;
}

button.choice .choice-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

button.choice .choice-mark {
  display: inline-flex;
  margin-left: auto;
}

button.choice.right {
  border-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
}

button.choice.right .choice-mark {
  color: var(--ok);
}

button.choice.wrong {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}

button.choice.wrong .choice-mark {
  color: var(--danger);
}

button.choice.dim {
  color: var(--muted);
}

.test-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
}

.test-foot .verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.test-foot .verdict.wrong {
  color: var(--danger);
}

.test-foot .verdict.near {
  color: var(--accent-text);
}

.test-foot .verdict.right {
  color: var(--ok);
}

.test-foot .next {
  margin-left: auto;
}

.answer-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.answer-field input {
  min-height: 56px;
  padding: 0 16px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
}

.answer-field input.near {
  border-color: var(--accent);
}

.answer-diff {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--ink-soft);
}

.answer-diff .diff-word {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
}

.answer-diff mark {
  padding: 0 1px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: inherit;
}

.answer-diff .diff-label {
  color: var(--muted);
  font-size: 13px;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px 32px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.result-score {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 600;
  line-height: 1;
}

.result-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
}

.mistake-cols {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
}

.mistake-cols .yours {
  color: var(--danger);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

@media (max-width: 760px) {
  .choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .test-question {
    padding: 24px 16px;
  }

  .test-question .q-text {
    font-size: 30px;
  }

  .result-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
  }

  .mistake-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .test-foot {
    flex-wrap: wrap;
  }
}

.study-progress .counts .c-right .dot {
  color: var(--ok);
}
