@import url("https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;500;600&display=swap");

:root {
  --navy: #1d3557;
  --navy-2: #2b4a75;
  --red: #b3262d;
  --ink: #1f2328;
  --muted: #5f6b7a;
  --line: #dde3ea;
  --bg: #f7f5f0;
  --card: #ffffff;
  --ok: #2f7d4f;
  --radius: 10px;
  --gold: #c8925e;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 Inter, system-ui, -apple-system, sans-serif;
}
h1, h2, h3 { font-family: Merriweather, Georgia, serif; color: var(--navy); line-height: 1.25; }
h1 { font-size: 1.9rem; margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 0 0 .4rem; }
a { color: var(--navy-2); }
p { margin: 0 0 .9rem; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

header.site {
  background: #04192a;
  border-bottom: 1px solid rgba(200, 146, 94, .25);
  color: #fff;
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
header.site .brand { color: #fff; text-decoration: none; font-family: Merriweather, serif; font-weight: 700; letter-spacing: .02em; }
header.site .brand small { display: block; font: 400 .75rem Inter, sans-serif; opacity: .75; letter-spacing: 0; }
nav[data-nav] { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
nav[data-nav] a, nav[data-nav] .link { color: #fff; text-decoration: none; font-size: .92rem; opacity: .9; }
nav[data-nav] a:hover, nav[data-nav] .link:hover { opacity: 1; text-decoration: underline; }

main { padding: 32px 0 64px; }

/* Лицевая страница в цветах обложки */
.hero { background: #04192a radial-gradient(ellipse at 70% 30%, #0e2c45 0%, #04192a 70%); color: #e8e3d8; padding: 48px 0; }
.hero .wrap { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 40px; align-items: center; }
.hero .cover { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
.hero .author { letter-spacing: .3em; text-transform: uppercase; color: var(--gold); font-size: .85rem; margin-bottom: .6rem; }
.hero h1 { color: #fff; font-family: Inter, sans-serif; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; font-size: 2.2rem; }
.hero h1 span { color: var(--gold); }
.hero .sub { font-family: Merriweather, serif; font-size: 1.1rem; color: #fff; margin-bottom: 1.2rem; }
.hero p { max-width: 560px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.4rem; }
.btn.gold { background: var(--gold); color: #04192a; }
.btn.gold:hover { background: #d8a46f; }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .5); }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }
@media (max-width: 700px) {
  .hero { padding: 28px 0; }
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .hero .cover { max-width: 220px; margin: 0 auto; display: block; }
  .hero h1 { font-size: 1.6rem; }
}
section.cat { margin-bottom: 36px; }
section.cat h2 { margin-top: 0; }
footer.site { border-top: 1px solid var(--line); padding: 20px 0 40px; color: var(--muted); font-size: .85rem; }

.lead { font-size: 1.08rem; color: var(--muted); max-width: 640px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.item { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.item:hover { border-color: var(--navy-2); transform: translateY(-1px); }
.item .meta { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.item p { color: var(--muted); font-size: .92rem; margin: 0; }
.item.locked { opacity: .75; }
.badge { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 99px; background: #eef2f7; color: var(--navy); font-weight: 600; }
.badge.lock { background: #fbecec; color: var(--red); }

.btn, button.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--navy); color: #fff; text-decoration: none;
  padding: 12px 22px; border-radius: 8px; font: 600 .95rem Inter, sans-serif;
}
.btn:hover { background: var(--navy-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-small { padding: 6px 12px; font-size: .85rem; }
header.site .btn-small { background: #fff; color: var(--navy); }
button.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }

form .field { margin-bottom: 16px; }
label { display: block; font-weight: 500; margin-bottom: 6px; font-size: .93rem; }
label .opt { color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid #c9d1db; border-radius: 8px;
  font: inherit; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--navy-2); outline-offset: 1px; border-color: transparent; }
.row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.msg { padding: 12px 14px; border-radius: 8px; margin: 12px 0; font-size: .93rem; }
.msg.err { background: #fbecec; color: #8a1c22; }
.msg.ok { background: #e8f4ec; color: #1f5c38; }
.msg.info { background: #eef2f7; color: var(--navy); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.narrow { max-width: 520px; }

/* Тесты */
.q { padding: 18px 0; border-bottom: 1px solid var(--line); }
.q:last-child { border-bottom: 0; }
.q .num { color: var(--muted); font-size: .85rem; }
.q .text { font-weight: 500; margin: 2px 0 12px; }
.likert { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.likert label, .choices label {
  margin: 0; cursor: pointer; border: 1px solid #c9d1db; border-radius: 8px; background: #fff;
  font-weight: 400; font-size: .85rem; transition: background .1s, border-color .1s;
}
.likert label { text-align: center; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.likert label b { font-size: 1rem; }
.choices { display: grid; gap: 8px; }
.choices label { padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.likert input, .choices input { accent-color: var(--navy); }
.likert input { position: absolute; opacity: 0; pointer-events: none; }
.likert label:has(input:checked), .choices label:has(input:checked) { background: #eef2f7; border-color: var(--navy); }
@media (max-width: 600px) {
  .likert { grid-auto-flow: row; grid-auto-columns: auto; }
  .likert label { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; text-align: left; }
}
.progress { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 10px 0; }
.progress .bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--navy); width: 0; transition: width .2s; }
.progress small { color: var(--muted); }

.bars { display: grid; gap: 12px; }
.bars .b { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 56px; gap: 10px; align-items: center; font-size: .92rem; }
.bars .track { position: relative; height: 14px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.bars .track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--navy); border-radius: 99px; }
.bars .track i.prev { background: transparent; border-right: 3px solid var(--red); border-radius: 0; }
.bars .v { text-align: right; font-variant-numeric: tabular-nums; }
.legend { font-size: .82rem; color: var(--muted); display: flex; gap: 16px; margin: 8px 0 0; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; background: var(--navy); border-radius: 2px; }
.legend span.prev::before { background: var(--red); }
.interp { margin-top: 18px; }
.interp .card { margin-bottom: 10px; }

table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }

.hidden { display: none !important; }

@media print {
  header.site, footer.site, .no-print, nav { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
  main { padding: 0; }
}
