/* Раздел тестов. Только токены из /public/tokens.css. */
:root {
  /* Производные токены раздела тестов (не из tokens.css) */
  --warning-soft: oklch(97% 0.03 80); /* производный от --warning: мягкая заливка */
  --shadow-soft: oklch(20% 0.02 200 / 0.08); /* мягкая тень для приподнятых элементов */
}
.test-app {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: var(--space-5) var(--space-3) var(--space-7);
  min-height: 60vh;
}
@media (max-width: 540px) {
  .test-app { padding: var(--space-4) var(--space-2) var(--space-6); }
}

.test-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--space-1);
}
.test-title {
  font-size: clamp(1.75rem, 2vw + 1.2rem, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  text-wrap: balance;
  margin-bottom: var(--space-3);
}
.test-lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 62ch;
}
.test-lead + .test-lead { margin-top: var(--space-2); }

/* Пред-экран: выбор рода */
.test-gender {
  margin: var(--space-4) 0;
  border: 0;
  padding: 0;
}
.test-gender legend {
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: var(--space-2);
}
.test-gender__options { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.test-gender__option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--duration-quick) var(--ease-out-quart), background var(--duration-quick) var(--ease-out-quart);
}
.test-gender__option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.test-gender__option input { accent-color: var(--brand); width: 18px; height: 18px; margin: 0; }
.test-gender__option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }

.cta-pill[disabled], .cta-pill[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.test-resume {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.test-resume .cta-pair { margin-top: var(--space-2); }

/* Прохождение */
.test-progress {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  color: var(--text-subtle);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.test-progress__bar {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.test-progress__fill {
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
  transition: width var(--duration-normal) var(--ease-out-quart);
}

.test-item {
  font-size: clamp(1.25rem, 1vw + 1rem, 1.5rem);
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-strong);
  text-wrap: balance;
  min-height: 4.2em;
  margin-bottom: var(--space-4);
}

.test-scale {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3);
}
.test-scale__btn {
  width: 100%;
  min-height: 92px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.3;
  text-align: center;
  transition: border-color var(--duration-quick) var(--ease-out-quart), background var(--duration-quick) var(--ease-out-quart), transform var(--duration-quick) var(--ease-out-quart);
}
.test-scale__num {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--brand-strong);
  font-variant-numeric: tabular-nums;
}
.test-scale__btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.test-scale__btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.test-scale__btn[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-text-on);
}
.test-scale__btn[aria-pressed="true"] .test-scale__num { color: var(--brand-text-on); }

@media (max-width: 720px) {
  .test-scale { grid-template-columns: 1fr; }
  .test-scale__btn {
    min-height: 0;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    padding: 12px 14px;
    font-size: 0.9375rem;
  }
  .test-scale__num { min-width: 1.5em; }
}

.test-nav { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.test-link-btn {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  padding: 8px 4px;
  cursor: pointer;
  transition: color var(--duration-quick) var(--ease-out-quart);
}
.test-link-btn:hover { color: var(--text-strong); }
.test-link-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.test-link-btn[disabled] { opacity: 0.4; cursor: default; }
.test-hint { font-size: 0.8125rem; color: var(--text-subtle); }

/* Результат */
.test-mode {
  display: inline-flex;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  margin: var(--space-3) 0 var(--space-4);
}
.test-mode__btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  transition: background var(--duration-quick) var(--ease-out-quart), color var(--duration-quick) var(--ease-out-quart);
}
.test-mode__btn[aria-pressed="true"] { background: var(--surface); color: var(--brand-strong); box-shadow: 0 1px 2px var(--shadow-soft); }
.test-mode__btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.test-highlight { padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.test-highlight:first-of-type { border-top: 0; }
.test-highlight__name { font-weight: 600; color: var(--text-strong); margin-bottom: 6px; }
.test-highlight__flag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: 8px;
  vertical-align: middle;
}
.test-highlight__text { color: var(--text-muted); line-height: 1.6; max-width: 62ch; }
.test-highlight__short { font-size: 0.9375rem; color: var(--brand-text); margin: -2px 0 var(--space-1); }
.test-sub { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle); margin: var(--space-2) 0 var(--space-1); }
.test-sub--section { color: var(--text-strong); font-size: 1.0625rem; letter-spacing: -0.01em; text-transform: none; margin: 0 0 var(--space-1); }
.test-quotes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.test-quotes li { padding: 10px 14px; border-left: 2px solid var(--brand-soft); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); line-height: 1.5; }
.test-quotes q { quotes: "«" "»"; }
.test-quotes__val { display: inline-block; margin-left: 8px; font-size: 0.8125rem; color: var(--text-subtle); font-variant-numeric: tabular-nums; white-space: nowrap; }
.test-reflect { margin: 0; padding-left: 1.2em; color: var(--text-muted); line-height: 1.55; display: grid; gap: 6px; }
.test-overview { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.test-overview__domain { margin-top: var(--space-3); }
.test-overview__list { list-style: none; padding: 0; margin: 0; }
.test-overview__row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(80px, 1fr) auto; gap: var(--space-2); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.test-overview__name { font-weight: 500; color: var(--text-strong); font-size: 0.9375rem; }
.test-overview__short { display: block; font-weight: 400; font-size: 0.8125rem; color: var(--text-subtle); }
.test-overview__bar { height: 6px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.test-overview__bar span { display: block; height: 100%; background: var(--border-strong); border-radius: inherit; }
.test-overview__row--mid .test-overview__bar span { background: var(--brand); opacity: 0.6; }
.test-overview__row--high .test-overview__bar span { background: var(--brand); }
.test-overview__level { font-size: 0.8125rem; color: var(--text-subtle); white-space: nowrap; }
.test-overview__row--high .test-overview__level { color: var(--brand-strong); font-weight: 600; }
@media (max-width: 540px) {
  .test-overview__row { grid-template-columns: 1fr auto; }
  .test-overview__bar { grid-column: 1 / -1; order: 3; }
  .test-overview__level { white-space: normal; text-align: right; max-width: 40vw; }
}

.test-pro-note {
  font-size: 0.9375rem;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}
.test-domain { margin-top: var(--space-4); }
.test-domain__title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--space-1);
}
.test-table-wrap { overflow-x: auto; }
.test-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.test-table th, .test-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.test-table th { font-weight: 600; color: var(--text-muted); font-size: 0.8125rem; letter-spacing: 0.04em; }
.test-table td.num { text-align: right; }
.test-table tr.is-significant td { background: var(--brand-soft); }
.test-table tr.is-single td { background: var(--warning-soft); }
.test-peaks { color: var(--text-subtle); font-size: 0.875rem; }
@media (max-width: 480px) {
  .test-table { font-size: 0.8125rem; }
  .test-table th, .test-table td { padding: 6px 8px; }
  .test-peaks { font-size: 0.75rem; }
}

.test-cta {
  margin-top: var(--space-6);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--brand-soft);
}
.test-cta p { color: var(--text); max-width: 60ch; }
.test-cta--neutral { background: var(--surface-2); }

.test-actions { margin-top: var(--space-5); display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  .test-progress__fill, .test-scale__btn, .test-mode__btn { transition: none; }
}

/* Каталог */
.test-catalog { list-style: none; padding: 0; margin: var(--space-5) 0 var(--space-4); border-top: 1px solid var(--border); }
.test-catalog__item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--border);
}
.test-catalog__body { min-width: 0; }
.test-catalog__title { font-size: 1.25rem; font-weight: 600; color: var(--text-strong); letter-spacing: -0.01em; margin-bottom: 4px; text-wrap: balance; }
.test-catalog__title a { color: inherit; transition: color var(--duration-quick) var(--ease-out-quart); }
.test-catalog__title a:hover { color: var(--brand-strong); }
.test-catalog__meta { font-size: 0.875rem; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.test-catalog__blurb { margin-top: var(--space-1); color: var(--text-muted); max-width: 60ch; }
.test-catalog__item--soon .test-catalog__title { color: var(--text-muted); font-weight: 500; }
.test-catalog__soon {
  flex-shrink: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-subtle); background: var(--surface-2); padding: 6px 12px; border-radius: var(--radius-pill);
}
.test-catalog__item .cta-pill { flex-shrink: 0; }
@media (max-width: 540px) {
  .test-catalog__item { flex-direction: column; align-items: flex-start; }
}
/* Хлебная крошка страницы опросника */
.test-app--crumb { padding-bottom: 0; min-height: 0; }
.test-crumb { font-size: 0.875rem; color: var(--text-subtle); }
.test-crumb a { color: var(--text-muted); transition: color var(--duration-quick) var(--ease-out-quart); }
.test-crumb a:hover { color: var(--brand-strong); }

/* Прохождения, дисклеймер, ресурс, контраст */
.test-pass { margin-bottom: var(--space-1); }
.test-passes { margin: 0 0 var(--space-3); padding-left: 1.2em; color: var(--text-muted); display: grid; gap: 6px; }
.test-disclaimer { margin: var(--space-3) 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--warning); border-radius: var(--radius-md); background: var(--warning-soft); color: var(--text-strong); }
.test-disclaimer p { margin: 0; font-size: 0.9375rem; line-height: 1.55; }
.test-resource { margin-top: var(--space-5); padding: var(--space-3); background: var(--brand-soft); border-radius: var(--radius-lg); }
.test-resource__list { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; gap: 8px; }
.test-resource__list li { display: flex; justify-content: space-between; gap: var(--space-2); }
.test-resource__name { font-weight: 600; color: var(--text-strong); }
.test-resource__level { color: var(--text-muted); }
.test-resource__level--high { color: var(--brand-strong); font-weight: 600; }
.test-overview__row--adaptive .test-overview__bar span { background: var(--accent-mint); }
.test-title--pass { font-size: 1.5rem; margin-top: var(--space-6); }
.test-pass-section + .test-pass-section { border-top: 1px solid var(--border); }
.test-contrast { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.test-contrast__list { margin: 0; padding-left: 1.2em; color: var(--text); line-height: 1.6; display: grid; gap: 8px; }
#exit-link { margin-left: auto; }
@media (max-width: 540px) { .test-nav { flex-wrap: wrap; } .test-hint { display: none; } }
