/* Общие стили для всех страниц. Лёгкий Material-вдохновлённый вид. */
:root {
  --primary: #6200ee;
  --primary-dark: #4b00b5;
  --primary-light: #ede7f6;
  --surface: #ffffff;
  --bg: #f4f5f7;
  --text: #1d1d1f;
  --text-muted: #5f6368;
  --success: #2e7d32;
  --divider: #e0e0e0;
  --shadow-1: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-2: 0 4px 12px rgba(0,0,0,.12);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Roboto", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.topbar {
  background: var(--primary);
  color: #fff;
  padding: 16px 20px;
  box-shadow: var(--shadow-1);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar h1 { font-size: 1.15rem; margin: 0; font-weight: 500; }
.topbar a.back {
  color: #fff;
  text-decoration: none;
  font-size: 1.4rem;
  line-height: 1;
  opacity: .9;
}
.topbar a.back:hover { opacity: 1; }

.container {
  max-width: 820px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.lead { color: var(--text-muted); margin: 6px 0 0; }

/* --- Список тестов на титульной странице --- */
.test-list { list-style: none; padding: 0; margin: 0; }
.test-list li {
  border-bottom: 1px solid var(--divider);
}
.test-list li:last-child { border-bottom: none; }
.test-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  text-decoration: none;
  color: var(--text);
  transition: background .15s;
  border-radius: 8px;
}
.test-list a:hover { background: var(--primary-light); }
.test-list .t-title { font-weight: 500; }
.test-list .t-sub { color: var(--text-muted); font-size: .85rem; }

.badge {
  flex: none;
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.done { background: #e6f4ea; color: var(--success); }
.badge.todo { background: #eceff1; color: var(--text-muted); }

/* --- Форма теста --- */
.question {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.question.unanswered-highlight { box-shadow: 0 0 0 2px #e53935, var(--shadow-1); }
.q-title { font-weight: 500; margin: 0 0 12px; }
.q-num { color: var(--primary); font-weight: 700; margin-right: 6px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
  margin-bottom: 4px;
}
.option:hover { background: var(--primary-light); }
.option input { margin-top: 4px; flex: none; }
.option .opt-label { font-weight: 600; margin-right: 4px; }

.scale-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.scale-row .option {
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid var(--divider);
  min-width: 64px;
  flex: 1;
}
.scale-row .option .scale-val { font-weight: 700; font-size: 1.05rem; }
.scale-row .option .scale-lbl { font-size: .72rem; color: var(--text-muted); }

/* --- Кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow .15s, background .15s;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-2); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-block { width: 100%; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

/* --- Результат --- */
.result-score {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary);
  margin: 4px 0;
}
.result-score small { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.result-band {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 14px 0;
}
.result-band h3 { margin: 0 0 6px; }

.progress-wrap { margin: 10px 0 0; }
.progress-bar { height: 6px; background: var(--divider); border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s; }
.progress-text { font-size: .8rem; color: var(--text-muted); margin-top: 6px; }

.alert {
  background: #fff3e0;
  border-left: 4px solid #fb8c00;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: #7a4f00;
  font-size: .9rem;
}

.muted { color: var(--text-muted); }
.footer { text-align: center; color: var(--text-muted); font-size: .8rem; padding: 24px 0; }
