/* Контрольные тесты — the list page and the quiz page (/test/, /test/{id}/). */

/* ── List ──────────────────────────────────────────────────────────────── */
.test-list {
  margin-top: 20px;
}

.test-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.test-list__item {
  list-style: none;
  margin-top: 15px;
}

/* ── Quiz ──────────────────────────────────────────────────────────────── */
/* The condition and the feedback texts are admin-authored HTML: the legacy reset
   strips default margins, so restore them the way the old `#text p` rules did. */
.test-quiz__intro {
  margin-top: 30px;
  line-height: 1.6;
}

.test-quiz__intro p,
.test-result__feedback p {
  margin: 1em 0;
}

.test-quiz__empty {
  margin-top: 20px;
}

.test-form {
  margin-top: 20px;
}

/* Two columns of questions on wide screens, one on narrow ones. */
.test-form__questions {
  counter-reset: test-question;
  display: grid;
  gap: 35px 10%;
  grid-template-columns: 1fr 1fr;
  list-style: none;
  margin: 0;
  padding: 0;
}

.test-question {
  counter-increment: test-question;
  list-style: none;
}

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

.test-question__text {
  float: left;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
  padding: 0;
  width: 100%;
}

.test-question__text::before {
  content: counter(test-question) ". ";
}

.test-question__answer {
  clear: both;
  font-size: 14px;
  margin: 10px 0 0;
  position: relative;
}

.test-question__radio {
  left: 0;
  position: absolute;
  top: 3px;
}

.test-question__answer label {
  cursor: pointer;
  display: block;
  margin-left: 22px;
}

/* Result and error notices */
.test-form__notice {
  border-top: 1px solid var(--color-border);
  margin-top: 35px;
  padding-top: 15px;
}

.test-form__notice p {
  margin: 6px 0 0;
}

.test-form__notice--error p {
  color: #900;
  font-weight: 700;
}

.test-form__notice--success p {
  margin-top: 15px;
}

/* Lead fields */
.test-form__fields {
  border-top: 1px solid var(--color-border);
  margin-top: 35px;
  padding-top: 25px;
}

.test-form__field {
  align-items: baseline;
  display: grid;
  gap: 4px 20px;
  grid-template-columns: 45% 1fr;
  margin-bottom: 12px;
}

.test-form__field label {
  font-weight: 400;
}

.test-form__field input[type="text"] {
  box-sizing: border-box;
  padding: 6px 8px;
  width: 98%;
}

.test-form__field--error input[type="text"] {
  border-color: #c00;
}

.test-form__field .field-error {
  grid-column: 2;
  margin: 0;
}

.test-form__required {
  color: #900;
}

.test-form__cellphone input[type="text"]:first-of-type {
  width: 60px;
}

.test-form__cellphone input[type="text"]:last-of-type {
  width: 110px;
}

.test-form__actions {
  display: flex;
  justify-content: space-between;
  margin-top: 25px;
}

/* Production shows both buttons filled (reset on the left, submit on the right). */
.test-form__button {
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  padding: 8px 24px;
}

.test-form__button:hover {
  background: var(--color-primary-dark);
}

@media (max-width: 768px) {
  .test-form__questions {
    grid-template-columns: 1fr;
  }

  .test-form__field {
    grid-template-columns: 1fr;
  }

  .test-form__field .field-error {
    grid-column: 1;
  }
}
