/* Академия Иберис Групп — видеоплатформа обучения
   Реализация дизайн-документа «Академия Иберис Групп.dc.html» */

:root {
  --ink: #111111;
  --ink-soft: #374151;
  --muted: #6b7280;
  --faint: #898989;
  --line: #e5e7eb;
  --line-soft: #f3f4f6;
  --surface: #f5f5f5;
  --surface-alt: #f8f9fa;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

  /* accentTheme: vibrant (по умолчанию) */
  --accent-blue: #3b82f6;
  --accent-red: #dc2626;
  --accent-amber: #f59e0b;

  --nav-w: 132px;
  --marquee-dur: 14s;
}

[data-theme="monochrome"] {
  --accent-blue: #111111;
  --accent-red: #111111;
  --accent-amber: #111111;
}

[data-theme="brand"] {
  --accent-blue: #2f6fa8;
  --accent-red: #b5455f;
  --accent-amber: #e0a233;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: #242424; text-decoration: underline; }

img { max-width: 100%; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes marqueeScroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes floatSlow { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-8px); } }
@keyframes spinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* motionIntensity: calm — приглушённая анимация */
[data-motion="calm"] .marquee-track,
[data-motion="calm"] .float-6,
[data-motion="calm"] .float-8,
[data-motion="calm"] .float-10,
[data-motion="calm"] .pulse-dot { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.shell { max-width: 1200px; margin: 0 auto; width: 100%; }

/* ---------- Кнопки и общие элементы ---------- */

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  height: 40px;
  padding: 0 18px;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, background 0.2s;
}
.btn:disabled { cursor: not-allowed; opacity: 0.4; }
.btn-lg { height: 44px; padding: 0 22px; }
.btn-primary { background: var(--ink); color: #ffffff; }
.btn-primary:not(:disabled):hover { background: #242424; }
.btn-ghost { background: #ffffff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-alt); }

.link-strong { font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
.link-strong:hover { text-decoration: underline; }

.card-hover { transition: box-shadow 0.2s, transform 0.2s; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.brand-mark { height: 16px; width: auto; object-fit: contain; border-radius: 4px; display: block; }

/* ---------- Шапка ---------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--line-soft);
}

.hdr-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
}

.brand { cursor: pointer; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-logo { height: 20px; width: auto; object-fit: contain; }
.brand-tag {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: var(--ink);
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.nav {
  position: relative;
  display: flex;
  background: var(--surface-alt);
  border-radius: 9999px;
  padding: 6px;
}
.nav-slider {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc((100% - 12px) / 3);
  height: 32px;
  background: #ffffff;
  border-radius: 9999px;
  box-shadow: var(--shadow-sm), var(--shadow-md);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  transform: translateX(calc(var(--nav-i) * 100%));
}
.nav-item {
  position: relative;
  z-index: 1;
  width: var(--nav-w);
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-item.is-active { color: var(--ink); }

.hdr-auth { flex-shrink: 0; }
.hdr-auth .when-in,
.hdr-auth .when-out { display: none; align-items: center; }
.hdr-auth .when-in { gap: 12px; }
.hdr-auth .when-out { gap: 16px; }
[data-auth="in"] .hdr-auth .when-in { display: flex; }
[data-auth="out"] .hdr-auth .when-out { display: flex; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  flex-shrink: 0;
}
.user-name { font-size: 14px; font-weight: 500; color: var(--ink-soft); }

/* ---------- Область экрана ---------- */

.view { flex: 1; display: flex; flex-direction: column; }
.screen { animation: fadeUp 0.4s ease; }
.screen-pad { max-width: 1200px; margin: 0 auto; width: 100%; padding: 48px 32px 96px; }

/* ---------- Главная ---------- */

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 32px 64px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 24px;
}
.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--accent-blue);
  animation: pulseDot 1.6s infinite;
  flex-shrink: 0;
}

.hero h1 {
  font-size: 56px;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -2px;
  margin: 0 0 24px;
  color: var(--ink);
}
.hero-lead {
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 36px;
  max-width: 480px;
}
.hero-actions { display: flex; gap: 16px; margin-bottom: 48px; flex-wrap: wrap; }

.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.stat-num { font-size: 32px; font-weight: 600; letter-spacing: -1px; }
.stat-num.is-blue { color: var(--accent-blue); }
.stat-num.is-red { color: var(--accent-red); }
.stat-num.is-amber { color: var(--accent-amber); }
.stat-label { font-size: 13px; color: var(--muted); }

.hero-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 20px;
  animation: floatSlow 6s ease-in-out infinite;
}
.hero-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.hero-card-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.hero-card-live { font-size: 12px; color: var(--faint); }

.marquee {
  height: 280px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-alt);
  position: relative;
}
/* top/margin вместо padding+gap: высота дубля кратна, петля без рывка */
.marquee-track {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  animation: marqueeScroll var(--marquee-dur) linear infinite;
}
.marquee-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  margin: 0 10px 10px;
}
.marquee-thumb {
  width: 56px;
  height: 38px;
  border-radius: 6px;
  flex-shrink: 0;
  background: repeating-linear-gradient(135deg, #f5f5f5 0px, #f5f5f5 6px, #ececec 6px, #ececec 12px);
}
.marquee-body { min-width: 0; }
.marquee-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.marquee-dur { font-size: 11px; color: var(--faint); }

.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature { background: var(--surface); border-radius: 12px; padding: 32px; }
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-icon.is-blue { background: var(--accent-blue); color: var(--accent-blue); }
.feature-icon.is-red { background: var(--accent-red); color: var(--accent-red); }
.feature-icon.is-amber { background: var(--accent-amber); color: var(--accent-amber); }
.feature-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.feature-text { font-size: 15px; line-height: 1.5; color: var(--ink-soft); }

.section-block { max-width: 1200px; margin: 0 auto; padding: 32px 32px 64px; }

.panel { background: #ffffff; border: 1px solid var(--line); border-radius: 12px; padding: 40px; }

.h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.5px; color: var(--ink); }
.panel > .h2 { margin: 0 0 32px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; position: relative; }
.steps-line { position: absolute; top: 20px; left: 60px; right: 60px; height: 1px; background: var(--line); z-index: 0; }
.step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.step-num {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.step-num.is-blue { background: var(--accent-blue); }
.step-num.is-red { background: var(--accent-red); }
.step-num.is-amber { background: var(--accent-amber); }
.step-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.step-text { font-size: 13px; color: var(--muted); }

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.sec-mini {
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
.sec-mini-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.3;
  min-height: 36px;
}
.sec-mini-meta { font-size: 12px; color: var(--faint); }

.cta {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 96px;
}
.cta-box { background: var(--surface); border-radius: 12px; padding: 48px; text-align: center; }
.cta-box .h2 { margin: 0 0 12px; }
.cta-text { font-size: 16px; color: var(--ink-soft); margin: 0 0 28px; }

/* ---------- Авторизация ---------- */

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  background: var(--surface-alt);
  position: relative;
  overflow: hidden;
}
.blob { position: absolute; border-radius: 9999px; background: var(--surface); }
.blob-a { width: 420px; height: 420px; top: -160px; right: -120px; animation: floatSlow 8s ease-in-out infinite; }
.blob-b { width: 280px; height: 280px; bottom: -100px; left: -80px; animation: floatSlow 10s ease-in-out infinite; }

.auth-card {
  position: relative;
  z-index: 1;
  width: 420px;
  max-width: 100%;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 32px;
}
.auth-tabs {
  display: flex;
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 28px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.auth-tab.is-active { background: #ffffff; color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-title { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 6px; color: var(--ink); }
.auth-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form input {
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #ffffff;
}
.auth-form input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.auth-form .btn { margin-top: 6px; }
.auth-note { font-size: 13px; color: var(--faint); text-align: center; margin-top: 18px; }

/* ---------- Каталог ---------- */

.page-title { font-size: 36px; font-weight: 600; letter-spacing: -1px; color: var(--ink); }
.page-sub { font-size: 15px; color: var(--muted); }

.sec-head { margin-top: 16px; margin-bottom: 32px; }
.sec-head .page-sub { margin-top: 6px; font-size: 14px; }

.sec-card {
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.sec-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 14px;
  min-height: 44px;
}
.sec-card-meta { display: flex; align-items: center; justify-content: space-between; }
.sec-card-meta .count { font-size: 12px; color: var(--faint); }
.sec-card-meta .pct { font-size: 12px; font-weight: 600; color: var(--ink); }

.bar { height: 4px; background: var(--line-soft); border-radius: 9999px; margin-top: 8px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ink); border-radius: 9999px; transition: width 0.4s; }

.vid-card {
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.vid-card.is-locked { opacity: 0.55; cursor: not-allowed; }
.vid-card.is-locked:hover { box-shadow: none; transform: none; }
.vid-thumb {
  height: 140px;
  position: relative;
  background: repeating-linear-gradient(135deg, #f5f5f5 0px, #f5f5f5 10px, #ececec 10px, #ececec 20px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vid-thumb-label { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--faint); }
.vid-lock {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vid-lock > span {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.vid-done {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #10b981;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.vid-body { padding: 16px; }
.vid-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 10px;
  min-height: 40px;
}
.vid-dur { font-size: 12px; color: var(--faint); }

/* ---------- Курс ---------- */

.crumbs { font-size: 13px; color: var(--faint); margin-bottom: 20px; }
.crumbs .crumb { cursor: pointer; color: var(--ink); font-weight: 600; }
.crumbs .crumb:hover { text-decoration: underline; }

.course-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }

.player {
  position: relative;
  background: #101010;
  border-radius: 16px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.player-bg {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background: repeating-linear-gradient(135deg, #1a1a1a 0px, #1a1a1a 14px, #101010 14px, #101010 28px);
}
.player-play {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 9999px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: none;
  padding: 0;
}
.player-play i {
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid var(--ink);
  margin-left: 4px;
}
.player-spin {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border: 3px solid #ffffff;
  border-top-color: transparent;
  border-radius: 9999px;
  animation: spinSlow 1s linear infinite;
}
.player-foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}
.player-name { color: #ffffff; font-size: 15px; font-weight: 600; }
.player-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  margin-top: 10px;
  overflow: hidden;
}
.player-bar > span {
  display: block;
  height: 100%;
  background: #ffffff;
  border-radius: 9999px;
  transition: width 0.15s linear;
}

.quiz {
  margin-top: 32px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
}
.quiz-title { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.quiz-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.quiz-q { margin-bottom: 22px; }
.quiz-q-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink-soft);
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.quiz-opt:hover { border-color: #d1d5db; }
.quiz-opt.is-picked { border-color: var(--ink); background: var(--surface); color: var(--ink); }
.quiz-opt.is-right { border-color: #10b981; background: #d1fae5; color: #065f46; }
.quiz-opt.is-wrong { border-color: #ef4444; background: #fee2e2; color: #991b1b; }
.quiz-opt.is-locked { cursor: default; }
.quiz-opt.is-locked:hover { border-color: inherit; }
.quiz-result {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}
.quiz-result.is-pass { background: #d1fae5; color: #065f46; }
.quiz-result.is-fail { background: #fee2e2; color: #991b1b; }

.playlist { background: var(--surface); border-radius: 12px; padding: 20px; }
.playlist-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.playlist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s;
}
.playlist-item:hover { background: rgba(255, 255, 255, 0.6); }
.playlist-item.is-current { background: #ffffff; }
.playlist-item.is-locked { cursor: not-allowed; }
.playlist-dot {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--ink);
  color: #ffffff;
}
.playlist-dot.is-done { background: #10b981; }
.playlist-dot.is-locked { background: var(--line); }
.playlist-body { min-width: 0; flex: 1; }
.playlist-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-dur { font-size: 11px; color: var(--faint); }

/* ---------- Личный кабинет ---------- */

.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.dash-stat { background: var(--surface); border-radius: 12px; padding: 24px; }
.dash-stat .stat-label { margin-top: 4px; }
.dash-h3 { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 16px; }
.dash-list { display: flex; flex-direction: column; gap: 10px; }
.dash-row {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  transition: border-color 0.2s;
}
.dash-row:hover { border-color: #d1d5db; }
.dash-row-main { flex: 1; min-width: 0; }
.dash-row-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.dash-row-meta { font-size: 12px; color: var(--faint); margin-top: 2px; }
.dash-row .bar { width: 140px; height: 6px; margin-top: 0; flex-shrink: 0; }
.badge {
  width: 92px;
  text-align: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--line-soft);
  color: var(--muted);
}
.badge.is-done { background: #d1fae5; color: #065f46; }
.badge.is-progress { background: #fef3c7; color: #92400e; }

/* ---------- Подвал ---------- */

.ftr { background: #101010; color: #a1a1aa; padding: 64px 32px 32px; margin-top: auto; }
[data-screen="auth"] .ftr,
[data-screen="course"] .ftr { display: none; }

.ftr-inner { max-width: 1200px; margin: 0 auto; }
.ftr-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 48px; }
.ftr-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ftr-logo-box { background: #ffffff; border-radius: 8px; padding: 6px 10px; display: flex; align-items: center; }
.ftr-logo-box img { height: 14px; width: auto; object-fit: contain; }
.ftr-brand-name { color: #ffffff; font-weight: 600; font-size: 15px; letter-spacing: -0.3px; }
.ftr-about { font-size: 14px; line-height: 1.5; max-width: 280px; }
.ftr-head { color: #ffffff; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.ftr-links { display: flex; flex-direction: column; gap: 10px; font-size: 14px; align-items: flex-start; }
.ftr-links span { cursor: pointer; }
.ftr-links span:hover { color: #ffffff; }
.ftr-links-static span { cursor: default; }
.ftr-links-static span:hover { color: inherit; }
.ftr-brands { display: flex; flex-direction: column; gap: 12px; }
.ftr-brand-chip { background: #ffffff; border-radius: 6px; padding: 8px 12px; width: fit-content; }
.ftr-brand-chip img { height: 16px; width: auto; object-fit: contain; display: block; }
.ftr-bottom { border-top: 1px solid #1a1a1a; padding-top: 24px; font-size: 13px; color: var(--muted); }

/* ---------- Адаптив ---------- */

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 64px 24px 48px; }
  .hero h1 { font-size: 44px; letter-spacing: -1.4px; }
  .features { grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 48px 24px; }
  .feature { padding: 24px; }
  .section-block, .cta { padding-left: 24px; padding-right: 24px; }
  .screen-pad { padding: 40px 24px 72px; }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .course-grid { grid-template-columns: 1fr; }
  .hdr-inner { padding: 0 24px; }
  :root { --nav-w: 116px; }
}

@media (max-width: 900px) {
  :root { --nav-w: 108px; }
  .nav-item { font-size: 13px; }
  .features { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 28px; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps-line { display: none; }
  .ftr-grid { grid-template-columns: 1fr 1fr; }
}

/* Шапка перестаёт помещаться в одну строку — логотип и вход сверху, навигация ниже */
@media (max-width: 880px) {
  .hdr-inner { flex-wrap: wrap; height: auto; padding: 12px 24px; gap: 10px; }
  .nav { order: 3; width: 100%; }
  .nav-item { flex: 1; width: auto; }
}

@media (max-width: 700px) {
  :root { --nav-w: 96px; }
  .nav-item { font-size: 11px; }
  .hdr-inner { padding: 12px 16px; }
  .brand { gap: 8px; }
  .brand-logo { height: 18px; }
  .brand-tag { display: none; }
  .hdr-auth .when-out { gap: 10px; }
  .hdr-auth .btn { font-size: 13px; height: 36px; padding: 0 14px; }
  .avatar { width: 32px; height: 32px; }
  .hero { padding: 40px 16px 32px; }
  .hero h1 { font-size: 34px; letter-spacing: -1px; }
  .hero-lead { font-size: 16px; }
  .hero-stats { gap: 24px; }
  .features { padding: 32px 16px; }
  .section-block { padding: 24px 16px 40px; }
  .cta { padding: 0 16px 64px; }
  .cta-box { padding: 32px 20px; }
  .screen-pad { padding: 32px 16px 56px; }
  .auth-wrap { padding: 40px 16px; }
  .auth-card { padding: 24px; }
  .page-title { font-size: 28px; letter-spacing: -0.6px; }
  .h2 { font-size: 22px; }
  .grid-5, .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .dash-row { flex-wrap: wrap; gap: 10px; }
  .dash-row-main { flex-basis: 100%; }
  .dash-row .bar { flex: 1; width: auto; }
  .ftr { padding: 48px 16px 24px; }
  .ftr-grid { grid-template-columns: 1fr; gap: 28px; margin-bottom: 32px; }
  .ftr-about { max-width: none; }
}

@media (max-width: 460px) {
  .grid-5, .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1; }
  .hero h1 { font-size: 28px; }
  .sec-mini-title, .sec-card-title, .vid-title { min-height: 0; }
}

/* ==========================================================================
   Компоненты, добавленные при переводе клиента на API
   ========================================================================== */

/* ---------- Сообщения ---------- */

.alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 16px;
}
.alert.is-error   { background: #fee2e2; color: #991b1b; }
.alert.is-success { background: #d1fae5; color: #065f46; }

.loading {
  padding: 64px 0;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}

.narrow { max-width: 720px; }
.center-panel { text-align: center; padding: 48px 32px; }
.center-panel .h2 { margin-bottom: 12px; }
.center-panel .page-sub { margin-bottom: 24px; }
.big-icon { font-size: 40px; margin-bottom: 16px; }

/* ---------- Схема обучения на главной ---------- */

.steps-vertical { display: flex; flex-direction: column; gap: 18px; }
.step-row { display: flex; align-items: flex-start; gap: 14px; }
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.step-dot.is-blue  { background: var(--accent-blue); }
.step-dot.is-red   { background: var(--accent-red); }
.step-dot.is-amber { background: var(--accent-amber); }
.step-row b { font-size: 14px; color: var(--ink); }
.step-note { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* ---------- Плеер ---------- */

.player-wrap { margin-bottom: 8px; }
.player-el {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #101010;
  border-radius: 16px;
  display: block;
}

/* ---------- Курсы ---------- */

.course-card {
  position: relative;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.course-card .badge { position: absolute; top: 16px; right: 16px; width: auto; }
.course-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 8px;
  padding-right: 90px;
}
.course-card-desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 760px;
  margin: 0 0 28px;
}

.lecture-list { display: flex; flex-direction: column; gap: 8px; }
.lecture-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lecture-row:hover { border-color: #d1d5db; box-shadow: var(--shadow-sm); }
.lecture-row.is-locked { opacity: 0.6; cursor: not-allowed; }
.lecture-row.is-locked:hover { border-color: var(--line); box-shadow: none; }
.lecture-num {
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  background: var(--ink);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.lecture-num.is-done   { background: #10b981; }
.lecture-num.is-locked { background: var(--line); color: var(--muted); }
.lecture-main { min-width: 0; flex: 1; }
.lecture-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.lecture-meta { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ---------- Тест ---------- */

.quiz-locked { opacity: 0.75; }
.attempts-left { font-size: 13px; color: var(--muted); margin-left: 14px; }

/* ---------- Сертификаты ---------- */

.cert-list { display: flex; flex-direction: column; gap: 10px; }
.cert-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
}
.cert-main { flex: 1; min-width: 0; }
.cert-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.cert-meta { font-size: 12px; color: var(--faint); margin-top: 3px; }

/* ---------- Скрываем навигацию до входа ---------- */

[data-auth="out"] .nav,
[data-pending="yes"] .nav { display: none; }

@media (max-width: 700px) {
  .course-card-title { padding-right: 0; }
  .course-card .badge { position: static; display: inline-block; margin-bottom: 10px; }
  .attempts-left { display: block; margin: 10px 0 0; }
}

/* Ссылка на панель управления — только лекторам и администраторам */
.when-staff { display: none; }
[data-staff="yes"] .when-staff { display: inline; }

/* ---------- Превью и обложки ---------- */

.vid-thumb.has-poster {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.card-cover {
  height: 132px;
  margin: -24px -24px 18px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface);
  border-radius: 12px 12px 0 0;
}
.sec-card .card-cover { margin: -20px -20px 16px; }

.lecture-thumb {
  width: 76px;
  height: 43px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface);
  flex-shrink: 0;
}

.player-el { object-fit: contain; }

@media (max-width: 700px) {
  .lecture-thumb { display: none; }
  .card-cover { height: 108px; }
}
