/* Закрытая часть: кабинет и страница урока. */

/* ---------- Шапка кабинета ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.top-in {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
}
.top .logo {
  font-weight: 900;
  font-size: 17px;
  letter-spacing: -.02em;
  color: #fff;
  text-decoration: none;
}
.top .logo span { color: var(--yellow); }
.top-sep { margin-right: auto; font-size: 14px; color: rgba(255, 255, 255, .5); }
/* Переключатель разделов в шапке разбора: видно, где ты и куда вернуться. */
.top-parts { display: flex; gap: 4px; margin-left: auto; }
.top-part {
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, .6);
  text-decoration: none;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.top-part:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.top-part.is-on { background: rgba(255, 255, 255, .14); color: #fff; }

.top a.back { font-size: 14px; color: rgba(255, 255, 255, .7); text-decoration: none; }
.top a.back:hover { color: #fff; }

/* ---------- Переключатель курсов ---------- */

.tabs-wrap { border-top: 1px solid rgba(255, 255, 255, .1); }
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 13px 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, .6);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tab b {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .35);
  margin-right: 5px;
}
.tab:hover { color: #fff; }
.tab.is-on { color: #fff; border-bottom-color: var(--yellow); }
.tab.is-on b { color: var(--yellow); }

/* Серия дней — тихая мотивация, а не медаль на пол-экрана. */
.streak {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--yellow);
  border: 1px solid rgba(255, 221, 45, .4);
  border-radius: 100px;
  padding: 5px 11px;
  margin-right: 16px;
}

.tab.is-locked { opacity: .55; }

/* ---------- Баннеры: покупка, продолжение, подтверждение ---------- */

.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-radius: var(--r);
  margin-bottom: 24px;
  text-decoration: none;
  color: inherit;
}
.banner b { display: block; font-size: 17px; margin-bottom: 4px; }
.banner span { font-size: 14px; color: var(--ink-60); }

.banner--offer { background: var(--ink); color: #fff; --ink-60: rgba(255, 255, 255, .68); }
.banner--offer b { color: var(--yellow); }

.banner--next { background: var(--cream-2); border: 1px solid var(--line); }
.banner--next:hover { border-color: var(--ink); }

.banner--ok {
  background: rgba(255, 221, 45, .22);
  border: 1px solid var(--yellow);
  font-weight: 600;
  display: block;
  padding: 16px 22px;
  font-size: 15px;
}

/* ---------- Карточки курсов ---------- */

.cards { display: grid; gap: 14px; }

.ccard {
  display: grid;
  /* Без номера курса колонок две: иначе текст уезжает в колонку под номер. */
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 26px;
  align-items: center;
  padding: 26px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.ccard:hover { border-color: var(--ink); }
.ccard:active { transform: translateY(1px); }

.ccard:has(.ccard-ib) { grid-template-columns: 74px minmax(0, 1fr) 190px; }
.ccard-ib {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1;
}
.ccard-body h2 { font-size: clamp(19px, 2vw, 25px); letter-spacing: -.015em; }
.ccard-body p { font-size: 15px; color: var(--ink-60); margin: 6px 0 0; }
.ccard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-40);
}
.ccard-prog { text-align: right; }
.ccard-pct { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.ccard-prog .bar { margin: 8px 0 6px; min-width: 0; }

/* Некупленный курс и карточки детей живут по тем же правилам, но тише. */
.ccard--locked, .ccard--kid, .ccard--add { background: transparent; border-style: dashed; }
.ccard--locked:hover, .ccard--add:hover { border-color: var(--ink); }

.code {
  font-family: var(--mono);
  letter-spacing: .18em;
  background: var(--yellow);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--ink);
}

.kid-courses { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pickbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
  cursor: pointer;
}
.pickbox input { accent-color: var(--ink); }

.kid-fields { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.kid-fields input {
  padding: 10px 16px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--paper);
  min-width: 0;
  flex: 1 1 140px;
}

.l-meta .free { color: var(--red); }

@media (max-width: 760px) {
  .banner { flex-direction: column; align-items: stretch; }
  .ccard { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px; }
  .ccard:has(.ccard-ib) { grid-template-columns: 52px minmax(0, 1fr); }
  .ccard-ib { font-size: 26px; }
  .ccard-prog { grid-column: 1 / -1; text-align: left; display: flex; align-items: center; gap: 12px; }
  .ccard-prog .bar { margin: 0; flex: 1; }
}

/* ---------- Экран ввода кода ---------- */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  padding: 24px;
}
.gate-box { width: 100%; max-width: 380px; text-align: center; }
.gate h1 { font-size: 27px; margin-bottom: 10px; }
.gate p { color: rgba(255, 255, 255, .6); font-size: 15px; margin-bottom: 26px; }
.gate input {
  width: 100%;
  padding: 15px 18px;
  font: inherit;
  font-size: 16px;
  text-align: center;
  letter-spacing: .05em;
  color: #fff;
  background: #1A1A1A;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 100px;
  margin-bottom: 12px;
}
.gate input::placeholder { color: rgba(255, 255, 255, .3); letter-spacing: 0; }
.gate .err { color: #FF8A6E; font-size: 14px; min-height: 20px; margin-top: 12px; }

/* ---------- Прогресс курса ---------- */

.progress-head {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.bar {
  height: 6px;
  border-radius: 100px;
  background: var(--cream-2);
  overflow: hidden;
  margin-top: 14px;
  min-width: 240px;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--yellow);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .4s var(--ease);
}

/* ---------- Список модулей ---------- */

.m-block { border-bottom: 1px solid var(--line); padding: 30px 0; }
.m-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 14px;
}
.m-num {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ink-40);
}
.m-title { font-size: clamp(20px, 2.2vw, 27px); font-weight: 700; letter-spacing: -.015em; }
.m-count { font-family: var(--mono); font-size: 12px; color: var(--ink-40); margin-left: auto; }

.l-row {
  display: grid;
  grid-template-columns: 34px 22px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 13px 8px 13px 0;
  border-top: 1px dashed var(--line-soft);
  text-decoration: none;
  color: inherit;
  transition: background-color .15s var(--ease);
  border-radius: var(--r-sm);
}
.l-row:hover { background: rgba(14, 14, 14, .04); }
.l-n { font-family: var(--mono); font-size: 12px; color: var(--ink-40); }
.l-t { font-size: 16px; }
.l-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-40);
  display: flex;
  gap: 12px;
  white-space: nowrap;
}
.l-meta .kid { color: var(--red); }

/* Кружок статуса «пройдено» */
.tick {
  width: 20px; height: 20px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: transparent;
}
.l-row.done .tick { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.l-row.done .l-t { color: var(--ink-60); }

.soon { opacity: .55; }
.soon .l-meta { color: var(--ink-40); }

/* ---------- Страница урока ---------- */

/* Боковые отступы берём из .wrap — их нельзя обнулять, иначе текст ляжет на края. */
.lesson { padding: 44px var(--gut) 96px; }
.lesson-head { margin-bottom: 32px; }
.lesson h1 { font-size: clamp(28px, 4vw, 46px); margin: 14px 0 16px; }
.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.chip {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-60);
}
.chip--kid { border-color: var(--red); color: var(--red); }

.player {
  aspect-ratio: 16 / 9;
  max-height: 64vh;
  background: var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 40px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .45);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  padding: 20px;
}
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }

/* Пока видео не записано — вместо кадра 16:9 достаточно узкой полосы. */
.player--empty {
  aspect-ratio: auto;
  min-height: 96px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-40);
  margin-bottom: 32px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  align-items: start;
}

/* Конспект */
.notes { font-size: 17px; line-height: 1.65; max-width: 68ch; }
.notes h2 {
  font-size: 23px;
  margin: 40px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.notes h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.notes h3 { font-size: 18px; margin: 26px 0 10px; }
.notes p { margin: 0 0 14px; }
.notes ul, .notes ol { margin: 0 0 18px; padding-left: 22px; }
.notes li { margin-bottom: 7px; }
.notes strong { font-weight: 700; }
.notes code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--cream-2);
  padding: 2px 6px;
  border-radius: 4px;
}
.notes blockquote {
  margin: 22px 0;
  padding: 0 0 0 22px;
  border-left: 1px solid var(--line);
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: -.01em;
  color: var(--ink-80);
}
.tbl-scroll { overflow-x: auto; margin-bottom: 20px; }
.notes table { border-collapse: collapse; width: 100%; font-size: 15px; }
.notes th, .notes td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.notes th { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-60); }

/* Боковая колонка */
.aside { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 16px; }
.check li {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  line-height: 1.45;
}
.check li:last-child { border-bottom: 0; }
.check ul { list-style: none; margin: 0; padding: 0; }
.check .n { font-family: var(--mono); font-size: 11px; color: var(--red); padding-top: 3px; }
.check b { display: block; }
.check span.d { color: var(--ink-60); font-size: 14px; }

/* Основное действие — вперёд, поэтому «дальше» кнопкой, «назад» — тихой ссылкой. */
.lesson-nav {
  display: grid;
  justify-items: center;
  gap: 16px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.lesson-nav .btn { max-width: 560px; }

.lesson-back {
  font-size: 15px;
  color: var(--ink-60);
  text-decoration: none;
  padding: 4px 0;
}
.lesson-back:hover { color: var(--ink); text-decoration: underline; }

/* Задание урока — единственный акцентный блок в колонке. */
.task {
  background: var(--ink);
  color: #fff;
  --ink-60: rgba(255, 255, 255, .7);
}
.task p { font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .82); margin: 0 0 10px; }
.task p:last-child { margin-bottom: 0; }
.task ul, .task ol { margin: 0; padding-left: 20px; font-size: 15px; color: rgba(255, 255, 255, .82); }

.state { padding: 80px 0; text-align: center; color: var(--ink-60); }

@media (max-width: 900px) {
  .lesson-grid { grid-template-columns: 1fr; gap: 36px; }
  .aside { position: static; }
  .l-row { grid-template-columns: 28px 20px 1fr; }
  .l-meta { display: none; }
}

/* ---------- Отзыв ученика ---------- */

.review-ask {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  padding: 22px 26px;
  background: var(--cream-2);
  border-radius: var(--r);
}
.review-ask b { font-size: 17px; }
.review-ask span { font-size: 15px; color: var(--ink-60); margin-right: auto; max-width: 62ch; }
.review-ask--early { background: transparent; border: 1px dashed var(--line); }

.review-form textarea {
  width: 100%;
  padding: 16px 18px;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  resize: vertical;
}
.review-fields { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.review-fields input {
  flex: 1 1 240px;
  padding: 13px 18px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--paper);
  min-width: 0;
}
.review-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin-top: 14px;
}
.review-foot .tiny { margin-right: auto; max-width: 58ch; }
