/**
 * Курс Write Guide — оформление в стиле Apple.
 * Системный шрифт, трекинг по размеру, стеклянная шапка, hairline-разделители.
 */

.wg {
  --wg-ink: #17150f;
  --wg-muted: #8b8578;
  --wg-line: rgba(23, 21, 15, .14);
  --wg-bg: #f4f1ec;
  --wg-hover: rgba(23, 21, 15, .05);
  --wg-radius: 18px;
  --wg-wrap: 980px;

  color: var(--wg-ink);
  background: var(--wg-bg);
  font: 100%/1.5 "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: clamp(60px, 10vh, 120px);
}

/* ---------- Стеклянная липкая шапка ---------- */
.wg__bar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow .3s ease;
}
.wg__bar.is-stuck { box-shadow: 0 1px 0 var(--wg-line); }
.wg__bar-inner {
  max-width: var(--wg-wrap); margin-inline: auto;
  padding: 12px clamp(16px, 4vw, 28px);
  display: flex; align-items: center; gap: 16px;
  font-size: .82rem; letter-spacing: .01em;
}
.wg__back { color: var(--wg-muted); text-decoration: none; transition: color .2s; }
.wg__back:hover { color: var(--wg-ink); }
.wg__bar-title { font-weight: 600; letter-spacing: -.01em; }
.wg__until { margin-left: auto; color: var(--wg-muted); font-variant-numeric: tabular-nums; }

/* ---------- Обложка раздела ---------- */
.wg__hero {
  max-width: var(--wg-wrap); margin-inline: auto;
  padding: clamp(48px, 9vw, 110px) clamp(16px, 4vw, 28px) clamp(28px, 5vw, 56px);
  text-align: center;
}
.wg__title {
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 1.05;             /* тесное межстрочное на крупном */
  letter-spacing: -.025em;       /* отрицательный трекинг на крупном */
  font-weight: 700; margin: 0;
}
.wg__sub {
  margin: 14px auto 0; max-width: 34ch;
  color: var(--wg-muted); font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.45; letter-spacing: 0;
}

/* ---------- Список уроков ---------- */
.wg__list {
  list-style: none; margin: 0 auto; padding: 0;
  max-width: var(--wg-wrap);
  padding-inline: clamp(16px, 4vw, 28px);
}
.wg__lesson { border-top: 1px solid var(--wg-line); }
.wg__lesson:last-child { border-bottom: 1px solid var(--wg-line); }

.wg__head {
  width: 100%; display: flex; align-items: center; gap: clamp(14px, 3vw, 26px);
  padding: clamp(18px, 3vw, 26px) 6px;
  background: none; border: 0; cursor: pointer; text-align: left;
  color: inherit; font: inherit;
  border-radius: 12px;
  transition: background-color .18s ease, transform .12s ease;
}
.wg__head:hover { background: var(--wg-hover); }
.wg__head:active { transform: scale(.995); background: rgba(0,0,0,.06); } /* отклик на нажатии */
.wg__head:focus-visible { outline: 2px solid #17150f; outline-offset: 2px; }

.wg__num {
  flex: 0 0 auto; min-width: 2.4ch;
  color: var(--wg-muted); font-variant-numeric: tabular-nums;
  font-size: .95rem; letter-spacing: .02em;
}
.wg__name {
  flex: 1 1 auto;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 500; letter-spacing: -.01em; line-height: 1.3;
}
.wg__chev {
  flex: 0 0 auto; width: 11px; height: 11px; margin-right: 4px;
  border-right: 2px solid var(--wg-muted); border-bottom: 2px solid var(--wg-muted);
  transform: rotate(45deg); transform-origin: center;
  transition: transform .32s cubic-bezier(.32, .72, 0, 1);
}
.wg__head[aria-expanded="true"] .wg__chev { transform: rotate(-135deg); }

/* ---------- Раскрывающаяся часть (плавно, без прыжков) ---------- */
.wg__panel {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .38s cubic-bezier(.32, .72, 0, 1);
}
.wg__lesson.is-open .wg__panel { grid-template-rows: 1fr; }
.wg__panel-in { overflow: hidden; }
.wg__lesson.is-open .wg__panel-in { padding-bottom: clamp(26px, 4vw, 44px); }

/* ---------- Видео ---------- */
.wg__video {
  position: relative; margin: 0 0 clamp(20px, 3vw, 32px);
  border-radius: var(--wg-radius); overflow: hidden;
  background: #000; aspect-ratio: 16 / 9;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .14);
}
.wg__player { width: 100%; height: 100%; display: block; background: #000; }
.wg__mark {
  position: absolute; top: 8%; left: 6%; right: auto; bottom: auto;
  padding: 4px 9px; border-radius: 6px;
  background: rgba(0, 0, 0, .32);
  color: rgba(255, 255, 255, .6);
  font-size: 11px; letter-spacing: .03em;
  pointer-events: none; user-select: none;
  /* «Бродячая» вотермарка: e-mail покупателя перемещается по кадру,
     чтобы её нельзя было обрезать одним кропом угла. */
  animation: wgMarkRoam 44s ease-in-out infinite;
}
@keyframes wgMarkRoam {
  0%   { top: 8%;  left: 6%; }
  20%  { top: 8%;  left: 60%; }
  40%  { top: 76%; left: 58%; }
  60%  { top: 78%; left: 7%; }
  80%  { top: 45%; left: 36%; }
  100% { top: 8%;  left: 6%; }
}
@media (prefers-reduced-motion: reduce) {
  .wg__mark { animation: none; top: auto; bottom: 46px; left: auto; right: 10px; }
}

/* ---------- Конспект ---------- */
.wg__notes {
  max-width: 68ch;               /* комфортная длина строки */
  font-size: clamp(1rem, 1.9vw, 1.09rem);
  line-height: 1.62;             /* свободное межстрочное на тексте */
  letter-spacing: 0;
  color: #3a352c;
}
.wg__notes > *:first-child { margin-top: 0; }
.wg__notes p { margin: 0 0 1.05em; }
.wg__notes h2 { font-size: 1.5em; letter-spacing: -.015em; line-height: 1.2; margin: 1.8em 0 .5em; }
.wg__notes h3 { font-size: 1.2em; letter-spacing: -.01em; line-height: 1.3; margin: 1.5em 0 .4em; }
.wg__notes img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.2em 0; }
.wg__notes ul, .wg__notes ol { padding-left: 1.3em; margin: 0 0 1.05em; }
.wg__notes li { margin: .3em 0; }
.wg__notes a { color: #17150f; text-decoration: none; border-bottom: 1px solid rgba(23,21,15,.28); }
.wg__notes blockquote {
  margin: 1.4em 0; padding: .2em 0 .2em 1.1em;
  border-left: 3px solid var(--wg-line); color: var(--wg-muted);
}

/* ---------- Защита от случайного копирования ---------- */
.wg__list, .wg__notes, .wg__video { -webkit-user-select: none; user-select: none; }
.wg__player::-webkit-media-controls-enclosure { overflow: hidden; }

/* ---------- Закрытый раздел ---------- */
.wg--locked .wg__hero { padding-block: clamp(80px, 16vh, 180px); }
.wg__btn {
  display: inline-block; margin-top: 22px; padding: 13px 30px;
  border-radius: 980px; background: #17150f; color: #fff;
  text-decoration: none; font-size: .98rem; font-weight: 500;
  transition: background-color .2s ease, transform .12s ease;
}
.wg__btn:hover { background: #2b2721; }
.wg__btn:active { transform: scale(.97); }

.wg__empty { padding: 40px 0; color: var(--wg-muted); text-align: center; }

/* ---------- Мобильные ---------- */
@media (max-width: 640px) {
  .wg__head { gap: 12px; padding: 16px 4px; }
  .wg__video { border-radius: 14px; margin-bottom: 18px; }
  .wg__mark { font-size: 10px; }
  .wg__bar-inner { font-size: .78rem; gap: 10px; }
  .wg__back span { display: none; }
}

/* Тёмная тема убрана — курс всегда светлый, как весь сайт. */

/* ---------- Доступность: меньше движения / прозрачности / выше контраст ---------- */
@media (prefers-reduced-motion: reduce) {
  .wg__panel { transition: none; }
  .wg__chev, .wg__head, .wg__btn { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .wg__bar { background: var(--wg-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .wg { --wg-line: rgba(0,0,0,.4); --wg-muted: #3a3a3c; }
  .wg__bar { background: var(--wg-bg); }
}

/* ---------- Вступление, карандашики, админ-инструменты ---------- */
.wg__intro {
  position: relative;
  max-width: var(--wg-wrap); margin: 0 auto clamp(28px, 5vw, 56px);
  padding-inline: clamp(16px, 4vw, 28px);
}
.wg__intro-in {
  max-width: 68ch; margin-inline: auto;
  font-size: clamp(1.02rem, 2vw, 1.15rem); line-height: 1.62; color: #3a352c;
}
.wg__intro-in h2 { font-size: 1.5em; letter-spacing: -.015em; line-height: 1.2; margin: 1.6em 0 .5em; }
.wg__intro-in p { margin: 0 0 1.05em; }
.wg__intro-in img { max-width: 100%; height: auto; border-radius: 12px; }

.wg__editable { position: relative; }
.wg__pencil {
  position: absolute; top: 10px; right: 8px; z-index: 5;
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.06); color: var(--wg-muted);
  opacity: 0; transition: opacity .2s ease, background-color .2s ease, color .2s ease;
}
.wg__editable:hover .wg__pencil, .wg__pencil:focus-visible { opacity: 1; }
.wg__pencil:hover { background: #17150f; color: #fff; }
.wg__pencil--lesson { top: 50%; right: 40px; transform: translateY(-50%); }

.wg__tools {
  max-width: var(--wg-wrap); margin: 0 auto 8px;
  padding-inline: clamp(16px, 4vw, 28px);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.wg__tool {
  font-size: .8rem; padding: 7px 13px; border-radius: 980px;
  background: rgba(0,0,0,.05); color: var(--wg-muted); text-decoration: none;
  transition: background-color .2s, color .2s;
}
.wg__tool:hover { background: #17150f; color: #fff; }

.wg__hint { color: var(--wg-muted); font-size: .92rem; margin: 0 0 14px; }
.wg__hint a { color: #17150f; text-decoration: none; }

/* ---------- Шапка: кабинет ---------- */
.wg__bar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.wg__cabinet {
  color: var(--wg-ink); text-decoration: none; font-weight: 500;
  padding: 5px 12px; border-radius: 980px; background: rgba(0,0,0,.06);
  transition: background-color .2s;
}
.wg__cabinet:hover { background: rgba(0,0,0,.11); }

/* ---------- Кнопки ---------- */
.wg__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.wg__btn--ghost { background: rgba(0,0,0,.06); color: var(--wg-ink); }
.wg__btn--ghost:hover { background: rgba(0,0,0,.11); }
.wg__btn--sm { padding: 9px 20px; font-size: .9rem; margin-top: 14px; }

/* ---------- Карточка курса в личном кабинете ---------- */
.wg-card {
  max-width: 560px; margin: 0 0 28px; padding: 22px 24px;
  border: 1px solid rgba(0,0,0,.10); border-radius: 16px;
  background: #fff;
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.wg-card.is-active { border-color: rgba(23,21,15,.28); box-shadow: 0 6px 24px rgba(0,113,227,.08); }
.wg-card__label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #8b8578; }
.wg-card__title { margin: 4px 0 10px; font-size: 1.4rem; letter-spacing: -.02em; font-weight: 600; }
.wg-card__status { margin: 0 0 16px; color: #17150f; font-size: .98rem; }
.wg-card__status--off { color: #8b8578; }
.wg-card__days { color: #8b8578; }
.wg-card__btn {
  display: inline-block; padding: 11px 24px; border-radius: 980px;
  background: #17150f; color: #fff; text-decoration: none; font-size: .95rem; font-weight: 500;
  transition: background-color .2s, transform .12s;
}
.wg-card__btn:hover { background: #2b2721; }
.wg-card__btn:active { transform: scale(.97); }
.wg-card__btn--ghost { background: rgba(0,0,0,.07); color: #17150f; }
.wg-card__btn--ghost:hover { background: rgba(0,0,0,.12); }

@media (max-width: 640px) {
  .wg__pencil { opacity: 1; }                 /* на тачскрине ховера нет */
  .wg__pencil--lesson { right: 34px; }
  .wg__bar-right { gap: 8px; }
}

/* =========================================================
   Страница оплаты курса — стиль Apple, всё по центру
   ========================================================= */

/* Заголовок страницы («Оплата курса») — по центру, воздушно */
.page-course-pay .ef-page-head,
.page-course-pay .ef-node__header,
.page-course-pay h1 { text-align: center; }
.page-course-pay h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.06; letter-spacing: -.025em; font-weight: 700;
  margin: clamp(36px, 6vw, 72px) auto clamp(8px, 2vw, 20px);
  max-width: 20ch;
}
.page-course-pay .ef-main { padding-bottom: clamp(60px, 10vh, 120px); }

/* Карточка оплаты */
.wg-pay__form {
  max-width: 480px; margin: 0 auto; padding: clamp(26px, 4vw, 40px);
  border: 1px solid rgba(0, 0, 0, .09); border-radius: 22px;
  background: #fff; box-shadow: 0 14px 50px rgba(0, 0, 0, .07);
  text-align: center;
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Arial, sans-serif;
}

.wg-pay__head { margin-bottom: 28px; }
.wg-pay__label {
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: #86868b; margin-bottom: 8px;
}
.wg-pay__course {
  font-size: clamp(1.15rem, 3vw, 1.45rem); font-weight: 600;
  letter-spacing: -.02em; line-height: 1.25; color: #17150f;
}
.wg-pay__price {
  margin-top: 18px; font-size: clamp(2.6rem, 8vw, 3.6rem);
  font-weight: 700; letter-spacing: -.03em; line-height: 1; color: #17150f;
  font-variant-numeric: tabular-nums;
}
.wg-pay__price span { font-size: .48em; font-weight: 500; margin-left: 4px; color: #86868b; }
.wg-pay__note { margin-top: 10px; font-size: .92rem; color: #86868b; }

/* Разделитель перед формой */
.wg-pay__form .form-item-mail { margin-top: 0; padding-top: 26px; border-top: 1px solid rgba(0,0,0,.08); }

/* Поля */
.wg-pay__form .form-item { margin: 0 0 18px; text-align: left; }
.wg-pay__form label {
  display: block; font-size: .82rem; font-weight: 500; color: #17150f;
  margin-bottom: 7px; letter-spacing: -.005em;
}
.wg-pay__form label .form-required { color: #d73a49; }
.wg-pay__mail,
.wg-pay__form input[type="email"] {
  width: 100%; box-sizing: border-box;
  padding: 13px 15px; font-size: 1rem;
  border: 1px solid rgba(0, 0, 0, .16); border-radius: 12px;
  background: #fbfbfd; color: #17150f;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.wg-pay__form input[type="email"]:focus {
  outline: none; border-color: #17150f; background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .14);
}
.wg-pay__form input[type="email"]:disabled { color: #86868b; background: #f5f5f7; }
.wg-pay__form .description {
  margin-top: 6px; font-size: .78rem; color: #86868b; line-height: 1.4;
}

/* Согласие */
.wg-pay__form .form-item-consent {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 16px; margin: 4px 0 22px;
  background: #f5f5f7; border-radius: 12px;
}
.wg-pay__form .form-item-consent input[type="checkbox"] {
  flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0;
  accent-color: #17150f; cursor: pointer;
}
.wg-pay__form .form-item-consent label {
  margin: 0; font-size: .84rem; font-weight: 400; line-height: 1.45; color: #4b4b50;
}
.wg-pay__form .form-item-consent a { color: #17150f; text-decoration: none; }
.wg-pay__form .form-item-consent a:hover { text-decoration: underline; }

/* Кнопка */
.wg-pay__form .form-actions { margin: 0; }
.wg-pay__submit,
.wg-pay__form input[type="submit"] {
  width: 100%; padding: 15px 24px; border: 0; border-radius: 980px;
  background: #17150f; color: #fff; font-size: 1.02rem; font-weight: 500;
  letter-spacing: -.01em; cursor: pointer;
  transition: background-color .2s ease, transform .12s ease;
  -webkit-appearance: none; appearance: none;
}
.wg-pay__form input[type="submit"]:hover { background: #2b2721; }
.wg-pay__form input[type="submit"]:active { transform: scale(.98); }

/* Ошибки валидации */
.wg-pay__form .form-item--error-message,
.page-course-pay .messages--error {
  max-width: 480px; margin-inline: auto; text-align: left;
  font-size: .85rem; border-radius: 12px;
}

/* Мобильные */
@media (max-width: 560px) {
  .wg-pay__form { border: 0; box-shadow: none; padding: 20px 16px; max-width: 100%; }
  .wg-pay__form .form-item-consent { padding: 14px; }
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
  .wg-pay__form { background: #1c1c1e; border-color: rgba(255,255,255,.12); box-shadow: none; }
  .wg-pay__course, .wg-pay__price, .wg-pay__form label { color: #f5f5f7; }
  .wg-pay__form input[type="email"] { background: #2c2c2e; border-color: rgba(255,255,255,.16); color: #f5f5f7; }
  .wg-pay__form input[type="email"]:focus { background: #1c1c1e; }
  .wg-pay__form .form-item-consent { background: rgba(255,255,255,.06); }
  .wg-pay__form .form-item-consent label { color: #c7c7cc; }
}

/* Админка курса: сводка по заказам */
.course-stats {
  margin: 0 0 20px; padding: 14px 18px;
  background: #f5f5f7; border-radius: 12px;
  font-size: .95rem; color: #17150f;
}
.course-stats strong { font-size: 1.1rem; }

/* Предзаказ и скидка на странице оплаты */
.wg-pay__presale {
  margin-top: 14px; padding: 12px 16px; border-radius: 12px;
  background: rgba(255,159,10,.12); color: #a56200;
  font-size: .9rem; line-height: 1.45;
}
.wg-pay__price s { color: #86868b; font-size: .5em; font-weight: 500; margin-right: 8px; }
.wg-pay__badge {
  display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: 980px;
  background: rgba(48,209,88,.14); color: #1da844;
  font-size: .82rem; font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .wg-pay__presale { background: rgba(255,159,10,.16); color: #ffb340; }
}

/* ---------- Переключатель курсов в админке ---------- */
.course-switch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 18px; padding: 10px 14px;
  background: #f2f4f7; border-radius: 10px;
  font-size: 14px;
}
.course-switch__label { color: #8b8578; margin-right: 4px; }
.course-switch__item {
  display: inline-block; padding: 6px 14px; border-radius: 980px;
  text-decoration: none; color: #0a84ff; background: #fff;
  border: 1px solid rgba(0,0,0,.09); transition: background .2s, color .2s;
}
.course-switch__item:hover { background: #e9f2ff; text-decoration: none; }
.course-switch__item.is-active {
  background: #0a84ff; color: #fff; border-color: #0a84ff; font-weight: 600;
}

/* ---------- Превью картинки лендинга в админке ---------- */
.landing-img {
  margin: 0 0 10px; padding: 12px 14px;
  background: #f2f4f7; border-radius: 10px;
  max-width: 420px;
}
.landing-img__label {
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: #8b8578; margin-bottom: 8px;
}
.landing-img img {
  display: block; width: 100%; height: auto; max-height: 190px;
  object-fit: cover; border-radius: 8px; background: #fff;
}
.landing-img__note { margin-top: 8px; font-size: 12.5px; color: #8b8578; line-height: 1.4; }

/* ——— Редактор FAQ (tabledrag) ——— */
.efist-faq-table td { vertical-align: top; padding: 10px 8px; }
.efist-faq-table .efist-faq-cell { width: 100%; }
.efist-faq-table .efist-faq-q { width: 100%; font-weight: 600; margin-bottom: 8px; }
.efist-faq-table .efist-faq-a { width: 100%; }
.efist-faq-table .efist-faq-q input,
.efist-faq-table textarea.efist-faq-a { width: 100%; box-sizing: border-box; }
.efist-faq-add { margin-top: 8px; }

/* Кнопка «Скачать конспект» */
.wg__konspekt { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; }
.wg__konspekt svg { flex: 0 0 auto; }
