/* ===========================================================
   Токены: светлая тема по умолчанию, тёмная по системе или кнопке
   =========================================================== */
:root {
  --bg: #fbf7f4;
  --bg-alt: #f5e9e5;
  --surface: #ffffff;
  --surface-2: #faf3f0;
  --border: #eadfda;
  --border-strong: #dccbc5;
  --text: #2e2230;
  --muted: #6f6170;
  --subtle: #7c6d7c;
  --accent: #9e5462;
  --accent-hover: #864352;
  --accent-soft: #f1dcda;
  --accent-text: #ffffff;
  --plum: #3f2a3c;
  --plum-deep: #2f1f2d;
  --warm: #a8623a;
  --warm-soft: #f7e6da;
  --success: #3d7458;
  --success-soft: #e3efe8;
  --danger: #b3261e;
  --danger-soft: #fbe4e2;
  --shadow-sm: 0 1px 2px rgba(63, 42, 60, .05);
  --shadow-md: 0 12px 32px -16px rgba(63, 42, 60, .22);
  --shadow-lg: 0 24px 60px -24px rgba(63, 42, 60, .32);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239e5462' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8'/%3E%3C/svg%3E");
  color-scheme: light;
}

/* ===========================================================
   Основа
   =========================================================== */
*, *::before, *::after { box-sizing: border-box; min-width: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s ease, color .3s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.12;
  color: var(--text);
}
h1 { font-size: clamp(2.3rem, 4.6vw, 3.2rem); }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-soft); color: var(--text); }

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.page { padding-top: 40px; padding-bottom: 88px; min-height: 60vh; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.inline { display: inline; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.stack > * + * { margin-top: 20px; }
.page-head { margin-bottom: 28px; }
.page-head h1 { margin-bottom: 6px; }
.page-head p { color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; font-size: 14px; font-weight: 500; color: var(--muted); }
.back-link:hover { color: var(--text); }
.back-link .icon { width: 16px; height: 16px; }

/* ===========================================================
   Кнопки
   =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s var(--ease), box-shadow .2s ease;
}
.btn:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}
.btn:active { transform: scale(.98); }
.btn .icon { width: 17px; height: 17px; }

.btn-arrow::after {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .25s var(--ease);
}
.btn-arrow:hover::after { transform: translateX(3px); }

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
.btn-outline:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--border);
  box-shadow: none;
}
.btn-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  box-shadow: none;
}
.btn-sm { min-height: 36px; padding: 0 15px; font-size: 14px; }
.btn-lg { min-height: 48px; padding: 0 24px; }
.btn-block { width: 100%; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.icon-button:hover { color: var(--text); border-color: var(--border-strong); }
.icon-button.is-active { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }
a.icon-button { text-decoration: none; }
.icon-button .icon { width: 17px; height: 17px; }

.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }

/* ===========================================================
   Шапка
   =========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background-color .3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 68px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: -.01em;
  color: var(--text);
  flex-shrink: 0;
}
.brand:hover { color: var(--text); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
  transition: transform .4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }
.brand-mark .icon { width: 19px; height: 19px; stroke-width: 2.1; }

.main-nav { display: flex; gap: 4px; margin: 0 auto; }
.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.is-active { color: var(--accent); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-actions .icon-button, .header-actions .btn { white-space: nowrap; flex-shrink: 0; }
.main-nav { flex-wrap: nowrap; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 180px;
  height: 38px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .icon { width: 16px; height: 16px; }


/* ===========================================================
   Сообщения
   =========================================================== */
.messages { display: grid; gap: 10px; margin-top: 20px; }
.msg {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 15px;
}
.msg > .icon {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  stroke-width: 2.4;
}
.msg-error > .icon { background: var(--danger-soft); color: var(--danger); }
.msg-warning > .icon { background: var(--warm-soft); color: var(--warm); }

/* ===========================================================
   Главная: первый экран (статичный, без анимации)
   =========================================================== */
.hero { position: relative; padding: 88px 0 72px; overflow: hidden; isolation: isolate; text-align: center; }
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto;
  height: 720px;
  background:
    radial-gradient(ellipse 40% 45% at 30% 45%, var(--accent-soft), transparent 70%),
    radial-gradient(ellipse 35% 40% at 75% 35%, var(--warm-soft), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.hero-content { max-width: 780px; margin: 0 auto; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.hero-badge .icon { width: 16px; height: 16px; color: var(--accent); }
.hero h1 {
  margin: 8px 0 18px;
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.08;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.subtitle { max-width: 36em; margin: 0 auto; font-size: 1.125rem; color: var(--muted); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

.hero-points, .check-list { list-style: none; padding: 0; margin: 0; }
.hero-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; margin-top: 30px; }
.hero-points li, .check-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.check-list { display: grid; gap: 12px; }
.check-list li { font-size: 15px; color: var(--text); }
.hero-points li::before, .check-list li::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft) var(--check-icon) center / 11px no-repeat;
}

/* Полоса преимуществ */
.strip { padding-bottom: 16px; }
.strip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.strip-item { display: flex; gap: 14px; padding: 24px 26px; }
.strip-item + .strip-item { border-left: 1px solid var(--border); }
.strip-item .feature-icon { width: 40px; height: 40px; margin: 0; }
.strip-item strong { display: block; font-size: 15px; margin-bottom: 2px; }
.strip-item span { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ===========================================================
   Секции и панели
   =========================================================== */
.section { padding: 88px 0 104px; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-heading { max-width: 620px; margin: 0 auto 44px; text-align: center; }
.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-heading h2 { font-size: clamp(1.85rem, 3.4vw, 2.6rem); text-wrap: balance; }
.section-heading p:not(.eyebrow) { margin-top: 14px; font-size: 1.0625rem; color: var(--muted); text-wrap: pretty; }

.card, .panel {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.card > h2:first-child, .panel > h2:first-child, .card > h3:first-child { margin-bottom: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.card-title h2, .card-title h3 { margin: 0; }
.card-title .icon { width: 20px; height: 20px; color: var(--accent); }
.feature-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.feature-icon .icon { width: 21px; height: 21px; }
.empty-state { max-width: 520px; margin: 0 auto; text-align: center; }
.empty-state .feature-icon { margin: 0 auto 16px; }
.empty-state p { color: var(--muted); }
.empty-state .btn { margin-top: 18px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.chip .icon { width: 15px; height: 15px; color: var(--accent); }
.chip-sm { padding: 4px 10px; font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-warm { background: var(--warm-soft); color: var(--warm); border-color: transparent; }

/* ===========================================================
   Каталог
   =========================================================== */
.course-grid, .grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.course-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform .3s var(--ease), box-shadow .3s ease, border-color .3s ease;
}
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); color: var(--text); }
.course-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: radial-gradient(ellipse 70% 80% at 30% 20%, var(--accent-soft), transparent 70%), var(--surface-2);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
}
.course-cover-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-md);
  transition: transform .4s var(--ease);
}
.course-card:hover .course-cover-icon { transform: scale(1.06) rotate(-4deg); }
.course-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.course-card:hover .course-cover img { transform: scale(1.03); }
.course-cover { overflow: hidden; }
.course-cover-icon .icon { width: 26px; height: 26px; }
.course-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 20px 22px 22px; }
.course-body h3 { margin: 0; font-size: 1.5rem; }
.course-body p { margin: 0; font-size: 15px; color: var(--muted); }
.course-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; }
.price { font-weight: 700; letter-spacing: -.01em; }
.price-free { color: var(--accent); }

/* ===========================================================
   Курс, программа, урок
   =========================================================== */
.course-hero { margin-bottom: 32px; }
.course-hero h1 { margin: 6px 0 10px; }
.course-hero .lead { max-width: 46em; font-size: 1.1rem; color: var(--muted); }
.course-hero .row { margin-top: 16px; }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.course-aside { position: sticky; top: 88px; }
.aside-price { font-size: 2.2rem; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; margin-bottom: 18px; }
.course-aside .check-list { margin: 20px 0 0; }
.course-aside .check-list li { font-size: 14px; }
.aside-note { margin-top: 12px; font-size: 13px; color: var(--muted); }
.prose { font-size: 1.02rem; }
.prose p { margin-bottom: .9em; }

.program-module + .program-module { margin-top: 18px; }
.program-module h3 { display: flex; align-items: center; gap: 10px; font-family: var(--font); font-size: 15px; font-weight: 700; letter-spacing: 0; margin-bottom: 10px; }
.module-num {
  font-family: var(--font);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.program-lessons { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.program-lessons li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  transition: border-color .2s ease, background-color .2s ease;
}
.program-lessons li:hover { border-color: var(--border-strong); }
.program-lessons li a { color: var(--text); font-weight: 500; }
.program-lessons li a:hover { color: var(--accent); }
.program-lessons li.current { border-color: var(--accent); background: var(--accent-soft); }
.program-lessons li.current a { color: var(--text); font-weight: 600; }
.program-lessons .badge { margin-left: auto; }

/* Отметка урока: кружок; пройден — зелёная галочка, закрыт — замок, открытый — play */
.check {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  color: transparent;
  font-size: 0;
}
.check.done { border-color: transparent; background: var(--accent-soft) var(--check-icon) center / 12px no-repeat; }
.check.locked, .check.preview { border: 0; background: var(--surface-2); color: var(--subtle); }
.check.preview { background: var(--accent-soft); color: var(--accent); }
.check .icon { width: 12px; height: 12px; stroke-width: 2.2; }

.lesson-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.lesson-sidebar { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow: auto; padding: 20px; }
.lesson-sidebar .program-module + .program-module { margin-top: 16px; }
.lesson-sidebar .program-lessons li { padding: 8px 10px; font-size: 14px; }
.lesson-sidebar .progress { margin-bottom: 18px; }
.lesson-article h1 { margin-bottom: 20px; }
.video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-md);
}
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }

/* Водяной знак поверх видео: не мешает нажимать на плеер, повторяется на всю площадь */
.watermark {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  background-repeat: repeat;
  background-size: 360px 200px;
}
.video-fullscreen {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  cursor: pointer;
}
.video-fullscreen:hover { background: rgba(0, 0, 0, .65); }
.video-fullscreen[hidden] { display: none; }
.video-fullscreen .icon { width: 20px; height: 20px; stroke-width: 2; }
.protected-video:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; box-shadow: none; }
.protected-video:fullscreen video { object-fit: contain; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 8px; }
.complete-box.done, .done-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Прогресс */
.progress { display: grid; gap: 8px; }
.progress-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s var(--ease); }
.progress-label { font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Тест */
.quiz-question { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.quiz-question p { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; margin-bottom: 10px; }
.choice {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.choice:hover { border-color: var(--border-strong); background: var(--surface-2); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.quiz-result {
  display: grid;
  gap: 2px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
}
.quiz-result.passed { background: var(--success-soft); }
.quiz-result.passed strong { color: var(--success); }
.quiz-result.failed { background: var(--danger-soft); }
.quiz-result.failed strong { color: var(--danger); }

/* ===========================================================
   Формы
   =========================================================== */
form .form-fields > div, .field { margin-bottom: 16px; }
label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=number], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input::placeholder, textarea::placeholder { color: var(--subtle); }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea { min-height: 96px; resize: vertical; }
.helptext { display: block; margin-top: 6px; font-size: 13px; color: var(--subtle); }
.errorlist { list-style: none; padding: 0; margin: 4px 0 6px; color: var(--danger); font-size: 14px; }

.auth-card { max-width: 440px; margin: 24px auto 0; padding: 36px; box-shadow: var(--shadow-md); }
.auth-card .brand-mark { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 18px; }
.auth-card .brand-mark .icon { width: 25px; height: 25px; }
.auth-card h1 { font-size: 1.75rem; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 24px; }
.auth-card .btn-block { margin-top: 6px; }
.auth-footer { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); text-align: center; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.filters > * { flex: 1 1 170px; }
.filters input[type=search] { flex: 3 1 260px; }
.filters .btn { flex: 0 0 auto; }

/* ===========================================================
   CRM
   =========================================================== */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 24px; }
.stat {
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 4px; font-size: 13px; color: var(--muted); }
.stat-accent { background: var(--accent-soft); border-color: transparent; }
.stat-accent .stat-value { color: var(--accent); }

.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); font-size: 15px; }
th { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--subtle); }
tbody tr { transition: background-color .15s ease; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td a { color: var(--text); font-weight: 500; }
td a:hover { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tags form { margin-left: 4px; }
.tags input[type=text] { min-height: 36px; padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.tag:not(:has(button)) { padding-right: 12px; }
.tag button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.tag button:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.notes { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.notes li { padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-size: 15px; }
.notes .meta { margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--subtle); }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 18px; }
.pagination a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; }
.pagination a:hover { border-color: var(--border-strong); }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--muted); }
details.card[open] > summary::after { content: "–"; }
details.card > summary .icon { color: var(--accent); }

/* ===========================================================
   Подвал (как на сайте студии)
   =========================================================== */
.site-footer { margin-top: 24px; padding-top: clamp(48px, 6vw, 72px); background: var(--plum-deep); color: #d9cad5; font-size: .95rem; }
.site-footer a { color: #f3eaf0; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer-grid nav, .footer-grid > div:not(:first-child) { display: flex; flex-direction: column; gap: 8px; }
.footer-brand { font-family: var(--font-head); font-size: 1.6rem; font-weight: 600; color: #fff !important; }
.footer-grid p { margin: 10px 0 0; max-width: 30em; }
.footer-title { margin: 0 0 6px !important; color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .88rem; }
.footer-bottom span { margin-right: auto; }

/* ===========================================================
   Адаптивность
   =========================================================== */
@media (max-width: 960px) {
  .course-layout, .lesson-layout, .two-col { grid-template-columns: 1fr; }
  .course-aside, .lesson-sidebar { position: static; max-height: none; }
  .lesson-sidebar { order: 2; }
}

/* Меню разделов второй строкой шапки: у преподавателя — на любом широком экране (с его кнопками строка
   не помещается и в полный контейнер 1160px, пункты меню сжимаются уже текста), у остальных — на средних */
@media (min-width: 961px) {
  .has-tools .header-inner { height: auto; min-height: 64px; flex-wrap: wrap; gap: 6px 16px; padding-top: 10px; padding-bottom: 8px; }
  .has-tools .header-actions { margin-left: auto; }
  .has-tools .main-nav { order: 3; width: 100%; margin: 0 -4px; overflow-x: auto; scrollbar-width: none; }
}
@media (min-width: 961px) and (max-width: 1180px) {
  .header-inner { height: auto; min-height: 64px; flex-wrap: wrap; gap: 6px 16px; padding-top: 10px; padding-bottom: 8px; }
  .header-actions { margin-left: auto; }
  .main-nav { order: 3; width: 100%; margin: 0 -4px; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
}

/* Мобильное меню за кнопкой ☰ — как на сайте студии */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle .icon { width: 24px; height: 24px; }
.nav-toggle-open { display: inline-flex; }
.nav-toggle-close, .nav-open .nav-toggle-open { display: none; }
.nav-open .nav-toggle-close { display: inline-flex; }
.main-nav .mobile-only, .main-nav .nav-cta { display: none; }

@media (max-width: 960px) {
  /* backdrop-filter делает шапку контейнером для fixed-панели — на мобильных выключаем */
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .header-inner { height: 72px; flex-wrap: nowrap; gap: 12px; }
  .header-actions { margin-left: auto; }
  .header-actions .header-cta, .header-actions .tool-btn, .hide-sm { display: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: fixed;
    inset: 72px 0 0 0;
    z-index: 99;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 12px 16px 40px;
    background: var(--bg);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .nav-open .main-nav { opacity: 1; visibility: visible; transform: none; }
  body.nav-open { overflow: hidden; }
  .main-nav a:not(.btn), .main-nav .nav-logout button {
    display: block;
    width: 100%;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: none;
    color: var(--text);
    font-family: var(--font-head);
    font-size: 1.6rem;
    font-weight: 600;
    text-align: left;
  }
  .main-nav a:not(.btn).is-active { color: var(--accent); background: none; }
  .main-nav .mobile-only { display: block; }
  .main-nav .nav-logout { margin: 0; }
  .main-nav .nav-logout button { cursor: pointer; color: var(--muted); }
  .main-nav .nav-cta { display: flex; margin-top: 28px; padding-block: 1em; color: var(--accent-text); }
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hide-sm { display: none; }
  .brand { font-size: 1.3rem; }
  .container { padding: 0 16px; }
  .hero { padding: 48px 0 48px; }
  .strip-grid { grid-template-columns: 1fr; }
  .strip-item + .strip-item { border-left: 0; border-top: 1px solid var(--border); }
  .section { padding: 64px 0 72px; }
  .page { padding-top: 28px; padding-bottom: 64px; }
  .card, .panel { padding: 20px; }
  .auth-card { padding: 26px 22px; }
  .course-grid, .grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 br { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
