/* Фирменный стиль ЕвроСтрой (по evrostroyi.ru): синий #0E5EC5, тёмно-синий #214A85, оранжевый #F37021, Roboto */
:root {
  --blue: #0e5ec5;
  --blue-dark: #0a4a9e;
  --navy: #214a85;
  --orange: #f37021;
  --orange-soft: #fff1e8;
  --blue-soft: #eaf1fb;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #222222;
  --muted: #5f6b7a;
  --line: #e1e6ee;
  --good: #23874f;
  --good-soft: #e5f4ec;
  --bad: #c0392b;
  --bad-soft: #fbe9e7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 38, 76, .06), 0 4px 16px rgba(16, 38, 76, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.55 Roboto, -apple-system, "Segoe UI", Arial, sans-serif; }
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
h1 { font-size: 2rem; line-height: 1.2; font-weight: 700; color: var(--navy); margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; font-weight: 700; color: var(--navy); margin: 1.6rem 0 .7rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue); margin-bottom: .55rem; }
.eyebrow::after { content: ""; display: block; width: 40px; height: 3px; background: var(--orange); margin-top: .35rem; border-radius: 2px; }

/* ---------- шапка */
.strip { background: var(--blue); color: #fff; font-size: .82rem; font-weight: 500; padding: .35rem 1.5rem;
  display: flex; justify-content: space-between; gap: 1rem; letter-spacing: .02em; }
.header { background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 2rem;
  padding: .8rem 1.5rem; flex-wrap: wrap; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand img { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-size: 1.45rem; font-weight: 900; color: var(--navy); letter-spacing: -.01em; }
.brand-sub { font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: .14em; text-transform: uppercase;
  border-top: 2px solid var(--orange); padding-top: 2px; margin-top: 3px; align-self: flex-start; }
.nav { display: flex; gap: 1.6rem; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: .35rem 0; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--blue); }
.nav a.on { color: var(--blue); border-bottom-color: var(--orange); }
.logout { display: flex; align-items: center; gap: .8rem; margin: 0; }
.who { color: var(--muted); font-size: .9rem; }

.wrap { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.narrow { max-width: 440px; margin: 2rem auto; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem 2rem; border-top: 1px solid var(--line); background: #fff; }

/* ---------- карточки, формы, кнопки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem;
  margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .7rem; }
.crumbs a { color: var(--muted); }
.flash { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid; }
.flash.ok { background: var(--good-soft); border-color: #bfe3cd; }
.flash.error { background: var(--bad-soft); border-color: #f1c4be; }
input.copy { width: 100%; margin-top: .45rem; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }

label { display: block; font-weight: 500; font-size: .9rem; margin: .85rem 0 .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], select, textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid #cfd6e1; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(14, 94, 197, .15); }
textarea { min-height: 120px; }
textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; min-height: 380px; }
.btn { display: inline-block; background: var(--blue); color: #fff; border: 2px solid var(--blue); border-radius: var(--radius);
  padding: .65rem 1.3rem; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn.secondary, .btn.outline { background: #fff; color: var(--blue); }
.btn.secondary:hover, .btn.outline:hover { background: var(--blue-soft); color: var(--blue); }
.btn.danger { background: #fff; color: var(--bad); border-color: #e7b1aa; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: .35rem .85rem; font-size: .9rem; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: .9rem; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }
.checks label { font-weight: 400; display: flex; gap: .5rem; align-items: center; margin: .3rem 0; }

/* ---------- прогресс и треки */
.bar { height: 10px; background: var(--blue-soft); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #2f7fe0); border-radius: 99px; }
.track-card { display: flex; flex-direction: column; gap: .7rem; border-top: 4px solid var(--blue); }
.track-card h2 { margin: 0; font-size: 1.35rem; }

.modules { list-style: none; padding: 0; margin: 0; }
.modules li { display: flex; gap: 1rem; align-items: center; padding: 1rem 0; border-top: 1px solid var(--line); }
.modules li:first-child { border-top: 0; }
.num { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--blue-soft); color: var(--blue); flex: none; }
.modules .body { flex: 1; min-width: 0; }
.modules .title { font-weight: 500; font-size: 1.05rem; text-decoration: none; color: var(--navy); }
.modules a.title:hover { color: var(--blue); text-decoration: underline; }
.s-passed .num { background: var(--good); color: #fff; }
.s-learning .num, .s-test .num { background: var(--orange); color: #fff; }
.s-locked, .s-preparing { opacity: .55; }
.badge { font-size: .76rem; padding: .2rem .65rem; border-radius: 99px; white-space: nowrap; font-weight: 500; }
.b-passed { background: var(--good-soft); color: var(--good); }
.b-learning, .b-test { background: var(--orange-soft); color: #c4520f; }
.b-blocked { background: var(--bad-soft); color: var(--bad); }
.b-locked, .b-preparing { background: #edf0f4; color: var(--muted); }

.lessons { list-style: none; padding: 0; margin: 0; }
.lessons li { padding: .7rem 0; border-top: 1px solid var(--line); display: flex; gap: .7rem; align-items: center; }
.lessons li:first-child { border-top: 0; }
.lessons a { color: var(--ink); text-decoration: none; font-weight: 500; }
.lessons a:hover { color: var(--blue); }
.tick { width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 2px solid #c9d2df; flex: none; position: relative; }
.tick.on { background: var(--good); border-color: var(--good); }
.tick.on::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ---------- урок */
.lesson-body { font-size: 1.03rem; }
.lesson-body > :first-child, .lesson-body > .video + * { margin-top: 0; }
.lesson-body h2 { font-size: 1.15rem; }
.lesson-body h2::before { content: ""; display: inline-block; width: 4px; height: 1em; background: var(--orange); border-radius: 2px;
  margin-right: .55rem; vertical-align: -2px; }
.lesson-body table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .94rem; display: block; overflow-x: auto; }
.lesson-body th, .lesson-body td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; vertical-align: top; }
.lesson-body th { background: var(--blue-soft); color: var(--navy); font-weight: 500; }
.lesson-body tr:nth-child(even) td { background: #fafbfd; }
.lesson-body blockquote { margin: 1.2rem 0; padding: .8rem 1.1rem; background: var(--orange-soft); border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0; }
.lesson-body blockquote p { margin: .2rem 0; }
.lesson-body li { margin: .2rem 0; }
.video { position: relative; padding-top: 56.25%; margin: 0 0 1.3rem; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* ---------- тест */
.q { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q .qtext { font-weight: 500; margin-bottom: .6rem; color: var(--navy); }
.q label { font-weight: 400; display: flex; gap: .6rem; align-items: flex-start; margin: .4rem 0;
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.q label:hover { border-color: var(--blue); background: var(--blue-soft); }
.q label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.q input { margin-top: .3rem; accent-color: var(--blue); }
.score { font-size: 3rem; font-weight: 900; }
.score.ok { color: var(--good); } .score.no { color: var(--bad); }
.wrong { padding: .8rem 0; border-top: 1px solid var(--line); }

/* ---------- таблицы и отчёты */
table.list { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.list th, table.list td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { color: var(--muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
td.small { white-space: nowrap; }
.matrix { display: flex; gap: 3px; }
.cell { width: 1.4rem; height: 1.4rem; border-radius: 5px; font-size: .7rem; display: grid; place-items: center; color: #fff; font-weight: 700; font-style: normal; }
.c-passed { background: var(--good); } .c-test, .c-learning { background: var(--orange); }
.c-blocked { background: var(--bad); } .c-locked { background: #c3cbd7; } .c-preparing { background: #edf0f4; color: var(--muted); }
.legend { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: .4rem 0 1rem; }
.legend span { display: inline-flex; gap: .35rem; align-items: center; }
.legend .cell { width: .95rem; height: .95rem; }
.scroll { overflow-x: auto; }
.inactive { opacity: .5; }

/* ---------- телефон */
@media (max-width: 720px) {
  .strip .strip-right { display: none; }
  .header { gap: .5rem 1rem; padding: .7rem 1rem; }
  .nav { order: 3; flex-basis: 100%; gap: 1.1rem; overflow-x: auto; }
  .who { display: none; }
  .logout { margin-left: auto; }
  .wrap { padding: 1.3rem 1rem 3rem; }
  h1 { font-size: 1.5rem; }
  .card { padding: 1.1rem 1.1rem; }
  .grid2 { grid-template-columns: 1fr; }
}

/* ---------- книга */
.lesson-body.book { font-family: "PT Serif", Georgia, "Times New Roman", serif; font-size: 1.12rem; line-height: 1.75;
  padding: 2rem 2.4rem; }
.lesson-body.book h2, .lesson-body.book h3 { font-family: Roboto, Arial, sans-serif; }
.lesson-body.book p { margin: 0 0 1rem; }
.lesson-body.book blockquote { font-style: italic; }
.lesson-body.book .script { background: var(--blue-soft); border-radius: var(--radius); padding: .9rem 1.1rem; }
.part-title { margin-top: 0 !important; font-size: 1.4rem !important; color: var(--navy); }
.part-title::before { display: none !important; }
.book-cover { display: flex; gap: 1.1rem; align-items: flex-start; margin-bottom: 1.2rem; }
.book-cover img { margin-top: .3rem; flex: none; }
.toc { padding: 1.1rem 1.6rem; }
.toc-title { font-weight: 700; color: var(--navy); margin-bottom: .4rem; }
.toc ol { margin: 0; padding-left: 1.3rem; }
.toc li { margin: .25rem 0; }
.book-card { border-top: 4px solid var(--orange); }
@media (max-width: 720px) { .lesson-body.book { padding: 1.2rem 1.1rem; font-size: 1.05rem; } }

/* ---------- задачи с числовым ответом */
.num-answer { display: flex; align-items: center; gap: .6rem; max-width: 320px; }
.num-answer input { font-size: 1.05rem; }
.num-answer .unit { color: var(--muted); font-weight: 500; white-space: nowrap; }
.qkind label { margin-right: 1.2rem; }
.lesson-body pre.task, .task { background: #fafbfd; border: 1px dashed #c9d2df; border-radius: 10px; padding: .8rem 1rem; }
@media (max-width: 720px) { .header { position: static; } .nav { flex-wrap: nowrap; } }
