/* NeuroLearn — mobile-first (ТЗ §13). Проверено на ~375px и ~1440px. */
:root {
  --bg: #f6f7fb; --card: #ffffff; --ink: #1d2433; --muted: #667085;
  --accent: #3b5bdb; --accent-ink: #ffffff; --ok: #2f9e44; --bad: #e03131;
  --warn-bg: #fff3bf; --warn-ink: #7c5e10; --line: #e4e7ee;
  --hy-bg: #e7f5ff; --hy-line: #74c0fc; --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font: 16px/1.55 -apple-system, "Segoe UI", Roboto, "PT Sans", Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  display: flex; min-height: 100vh; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  flex-wrap: wrap; position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--ink); }
.nav a.accent { color: var(--accent); font-weight: 600; }
.inline-form { display: inline; }
.linklike { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { text-decoration: underline; }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 16px; flex: 1; }
.layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .layout.with-tree { grid-template-columns: 300px 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 16px; margin-bottom: 16px; }
.card h1, .card h2 { margin-top: 0; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; }

.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--accent);
       background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
       cursor: pointer; text-align: center; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: var(--card); color: var(--accent); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* Формы */
.form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.form label { font-weight: 600; font-size: .92rem; }
.form input[type=text], .form input[type=email], .form input[type=password], .form textarea, .form select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
textarea { min-height: 120px; }
.error-box { background: #ffe3e3; border: 1px solid var(--bad); color: #7a1c1c;
             border-radius: 8px; padding: 10px 12px; }
.info-box { background: var(--hy-bg); border: 1px solid var(--hy-line); border-radius: 8px; padding: 10px 12px; }

/* Варианты ответа: крупные кнопки на мобильном (ТЗ §13) */
.options { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.option-btn {
  width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); font: inherit; cursor: pointer;
}
.option-btn:hover { border-color: var(--accent); }
.option-btn .opt-letter { font-weight: 700; color: var(--accent); margin-right: 8px; }
.option-static { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.option-static.correct { border-color: var(--ok); background: #ebfbee; }
.option-static.wrong-chosen { border-color: var(--bad); background: #fff0f0; }

.verdict-ok { color: var(--ok); font-weight: 700; }
.verdict-bad { color: var(--bad); font-weight: 700; }

/* Плашки */
.high-yield { background: var(--hy-bg); border-left: 4px solid var(--hy-line);
              border-radius: 8px; padding: 10px 14px; margin: 14px 0; }
.high-yield strong { color: #1864ab; }
.badge { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 999px;
         vertical-align: middle; }
.badge.unverified { background: var(--warn-bg); color: var(--warn-ink); }
.badge.selfgrade { background: #e9ecef; color: var(--muted); }
.badge.locked { background: #e9ecef; color: var(--muted); }
.badge.passed { background: #ebfbee; color: var(--ok); }
.badge.in-progress { background: var(--hy-bg); color: #1864ab; }
.badge.premium { background: #f3e8ff; color: #7048e8; }

/* Прогресс */
.progress { background: #e9ecef; border-radius: 999px; height: 10px; overflow: hidden; }
.progress > div { background: var(--accent); height: 100%; border-radius: 999px; }
.progress-line { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.progress-line .progress { flex: 1; }
.progress-line .pct { min-width: 44px; text-align: right; font-size: .85rem; color: var(--muted); }

/* Дерево контента */
.tree-item { display: flex; align-items: center; justify-content: space-between; gap: 8px;
             padding: 10px 6px; border-bottom: 1px solid var(--line); }
.tree-item:last-child { border-bottom: none; }
.tree-item.locked { opacity: .55; }

/* Таблицы: горизонтальная прокрутка на узких экранах (ТЗ §13) */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: 10px 0; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg); }

/* Теория */
.theory { font-size: 1.02rem; }
.theory h2, .theory h3 { margin: 18px 0 8px; }
.sources-details summary { cursor: pointer; color: var(--muted); }
.sources-details ul { margin: 8px 0; }

/* Карточки самопроверки */
.selfcheck-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; }
.selfcheck-answer { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.selfcheck-item.revealed .selfcheck-answer { display: block; }

.step-indicator { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.step-indicator span { font-size: .78rem; padding: 3px 10px; border-radius: 999px;
                       background: #e9ecef; color: var(--muted); }
.step-indicator span.active { background: var(--accent); color: #fff; }
.step-indicator span.done { background: #ebfbee; color: var(--ok); }

.footer { padding: 18px 16px; border-top: 1px solid var(--line); background: var(--card); }
.disclaimer { max-width: 960px; margin: 0 auto; color: var(--muted); font-size: .82rem; }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.stat-num { font-size: 1.6rem; font-weight: 800; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filter-bar select, .filter-bar input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.pagination { display: flex; gap: 10px; justify-content: center; margin: 14px 0; }
