/* ---------------- Профориентационный тест ---------------- */

.prof-test {
  display: grid;
  gap: 0.9rem;
  margin: 1.1rem 0 0;
  padding: clamp(1rem, 2.2vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.prof-test__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  gap: 0.7rem;
}

.prof-test-results__lead {
  margin: -0.4rem 0 0.9rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.test-result__match {
  margin-top: 0.15rem;
  color: var(--brand-700);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.test-results--compact .test-result {
  grid-template-columns: auto minmax(0, 1fr);
  padding: 0.7rem;
}

.test-result__cover--t1 {
  background: linear-gradient(135deg, #e4f6f2 0%, #c9ede5 100%);
}

/* шкала «Нет / Скорее нет / Скорее да / Да» */

.test-scale {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.75rem;
  clear: both;
}

.test-scale__option {
  cursor: pointer;
}

.test-scale__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.test-scale__option span {
  display: block;
  padding: 0.45rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  transition:
    border-color 0.16s var(--ease),
    background-color 0.16s var(--ease),
    color 0.16s var(--ease);
}

.test-scale__option:hover span {
  border-color: var(--brand-300);
  background: var(--brand-50);
}

.test-scale__option input:checked + span {
  border-color: var(--brand-600);
  background: var(--brand-600);
  color: #fff;
}

.test-scale__option input:focus-visible + span {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

/* итог теста специальности */

.fit-verdict {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--brand-300);
  border-radius: var(--radius-sm);
  background: var(--brand-50);
}

.fit-verdict__value {
  flex: 0 0 auto;
  color: var(--brand-700);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.fit-verdict__title {
  margin: 0 0 0.2rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.fit-verdict__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

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

  .test-scale {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fit-verdict {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

.prof-test__progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.prof-test__bar {
  flex: 1 1 12rem;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.prof-test__bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-600), var(--brand-400));
  transition: width 0.28s var(--ease);
}

.prof-test__counter {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
}

.test-question {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.18s var(--ease);
}

.test-question.is-answered {
  border-color: var(--brand-300);
}

.test-question__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  float: left;
  width: 100%;
  padding: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
}

.test-question__num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: var(--radius-xs);
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 0.76rem;
  font-weight: 800;
}

.test-options {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.8rem;
  clear: both;
}

.test-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  cursor: pointer;
  transition:
    border-color 0.16s var(--ease),
    background-color 0.16s var(--ease);
}

.test-option:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
}

.test-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.test-option__mark {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  transition: border-color 0.16s var(--ease);
}

.test-option__mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand-600);
  transform: scale(0);
  transition: transform 0.16s var(--ease);
}

.test-option input:checked + .test-option__mark {
  border-color: var(--brand-600);
}

.test-option input:checked + .test-option__mark::after {
  transform: scale(1);
}

.test-option input:checked ~ .test-option__text {
  color: var(--brand-700);
  font-weight: 600;
}

.test-option input:focus-visible + .test-option__mark {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

.test-option__text {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.prof-test__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.3rem;
}

.prof-test__hint {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* результаты */

.prof-test-results {
  margin-top: 1.2rem;
  padding: clamp(1rem, 2.2vw, 1.5rem);
  border: 1px solid var(--brand-300);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin-top: 4.5rem;
}

.test-results {
  display: grid;
  gap: 0.7rem;
}

.test-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  transition:
    border-color 0.18s var(--ease),
    box-shadow 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.test-result:hover {
  border-color: var(--brand-300);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.test-result--top {
  border-color: var(--brand-600);
  background: var(--brand-50);
}

.test-result__cover {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, #e4f6f2 0%, #c9ede5 100%);
  color: #14776b;
}

.test-result__cover--t2 {
  background: linear-gradient(135deg, #eaf7e6 0%, #d3edcc 100%);
  color: #3f7a34;
}

.test-result__cover--t3 {
  background: linear-gradient(135deg, #e8f1fa 0%, #d2e4f6 100%);
  color: #2c5f8a;
}

.test-result__cover--t4 {
  background: linear-gradient(135deg, #faf2e4 0%, #f0e1c6 100%);
  color: #8a6224;
}

[data-theme='dark'] .test-result__cover {
  background: linear-gradient(135deg, #14302c 0%, #1a3b35 100%);
  color: #7fd8c9;
}

.test-result__cover svg {
  width: 30px;
  height: 30px;
}

.test-result__body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.test-result__code {
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.test-result__title {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

.test-result__text {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
