/* Стили страниц группы «learn» — дополнение к modern.css */

/* ---------- общие метки ---------- */
.pill-danger { color: #b91c1c; background: #fee2e2; }
.pill-warning { color: #b45309; background: #fef3c7; }
.nowrap { white-space: nowrap; }

/* ---------- страница курса (плеер) ---------- */
.learn-head { align-items: flex-end; }
.learn-head h1 { overflow-wrap: anywhere; }
.learn-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.learn-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; max-width: 420px; color: var(--a-muted); font-size: .88rem; font-weight: 600; }
.learn-progress .progress { flex: 1; min-width: 120px; }
.learn-progress span { white-space: nowrap; }

.learn-guest .card-body { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.learn-guest-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; color: #fff; background: var(--a-grad);
  box-shadow: 0 8px 20px rgba(79,70,229,.3); flex-shrink: 0; }

.learn-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.learn-main { min-width: 0; display: grid; gap: 20px; }
.learn-player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--a-radius); overflow: hidden; background: var(--a-ink);
  box-shadow: var(--a-shadow-lg); scroll-margin-top: calc(var(--nav-h) + 16px); }
.learn-player video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--a-ink); }
.learn-richtext { overflow-wrap: anywhere; color: #1e293b; }
.learn-richtext:empty::before { content: "Выберите урок в списке материалов курса."; color: var(--a-muted); }
.learn-richtext img, .learn-richtext video, .learn-richtext iframe { max-width: 100%; height: auto; border-radius: var(--a-radius-sm); }
.learn-richtext table { display: block; max-width: 100%; overflow-x: auto; }
.learn-richtext pre { white-space: pre-wrap; }
.learn-richtext h1, .learn-richtext h2, .learn-richtext h3 { font-size: 1.2rem; margin: 1rem 0 .5rem; }
.learn-richtext > :last-child { margin-bottom: 0; }

.learn-side { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 32px); display: flex; flex-direction: column; min-width: 0; }
.learn-program { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.learn-program .card-body { overflow-y: auto; padding: 14px; }

.learn-intro { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: var(--a-radius-sm);
  border: 1px dashed #c7d2fe; background: var(--a-primary-50); color: var(--a-primary); font-weight: 600; text-align: left; transition: background .15s, color .15s; }
.learn-intro:hover, .learn-intro.active { background: var(--a-primary); color: #fff; border-color: var(--a-primary); }

.learn-module { border: 1px solid var(--a-border); border-radius: 14px; margin-bottom: 10px; background: #fff; }
.learn-module .module-title { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px; border: 0; background: transparent; text-align: left;
  font-weight: 700; color: var(--a-text); border-radius: 14px; line-height: 1.3; }
.learn-module .module-title:hover { background: #f8fafc; }
.learn-module .module-num { width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; font-size: .85rem;
  background: var(--a-primary-50); color: var(--a-primary); }
.learn-module .module-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .93rem; }
.learn-module .module-name small { display: block; font-weight: 500; color: var(--a-muted); font-size: .78rem; margin-top: 2px; }
.learn-module .chev { color: var(--a-muted); transition: transform .2s; }
.learn-module:has(.lessons-list:not(.hidden)) .chev { transform: rotate(180deg); }

.lessons-list { list-style: none; margin: 0; padding: 0 8px 8px; }
.lessons-list.hidden { display: none; }
.lesson-item { margin: 2px 0; }
.lesson-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--a-text); font-size: .9rem; line-height: 1.35; }
a.lesson-row:hover { background: #f1f5f9; color: var(--a-text); }
.lesson-row.active { background: var(--a-primary-50); }
.lesson-row.active strong { color: var(--a-primary); }
.lesson-ico { font-size: 1.05rem; color: var(--a-primary); margin-top: 1px; flex-shrink: 0; }
.lesson-row.watched .lesson-ico { color: var(--a-success); }
.lesson-row.is-locked .lesson-ico { color: #94a3b8; }
.lesson-text { min-width: 0; overflow-wrap: anywhere; }
.lesson-text strong { font-weight: 600; display: block; }
.lesson-text small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--a-muted); font-size: .78rem; margin-top: 2px; }
.watched-mark { color: #047857; font-weight: 600; }
.lesson-download { margin: 2px 0 6px 38px; }

.hw-box { margin: 0 8px 10px; padding: 12px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--a-border); font-size: .88rem; }
.hw-box .form-label { margin-bottom: 6px; }
.hw-comment { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; }

.chat-container .card-header { padding: 14px 18px; }
.chat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--a-grad-wide); flex-shrink: 0; }
.chat-sub { font-weight: 500; font-size: .8rem; color: var(--a-muted); }
.chat-messages { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; margin-bottom: 12px; }
.chat-messages:empty { display: none; }
.chat-messages > div { max-width: 85%; padding: 9px 13px; border-radius: 14px; font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-messages .user-message { align-self: flex-end; background: var(--a-primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-messages .assistant-message { align-self: flex-start; background: #f1f5f9; color: var(--a-text); border-bottom-left-radius: 4px; }
.chat-messages .error-message { align-self: flex-start; background: #fee2e2; color: #b91c1c; }
.chat-input-container { display: flex; gap: 10px; align-items: flex-end; }
.chat-input-container textarea { resize: none; min-height: 46px; max-height: 220px; }
.chat-input-container .btn { white-space: nowrap; }

@media (max-width: 991.98px) {
  .learn-layout { grid-template-columns: 1fr; gap: 20px; }
  .learn-main { display: contents; }
  .learn-player { order: 1; } .chat-container { order: 2; } .learn-side { order: 3; } .learn-description { order: 4; } .lesson-comments { order: 5; }
  .learn-side { position: static; max-height: none; }
  .learn-program .card-body { overflow: visible; }
}
@media (max-width: 575.98px) {
  .learn-head-actions, .learn-head-actions .btn { width: 100%; }
  .learn-player { border-radius: 14px; margin: 0 -4px; }
  .chat-input-container { flex-direction: column; align-items: stretch; }
  .lesson-download { margin-left: 8px; }
}

/* ---------- сообщения: подписка, ошибка, переход к оплате ---------- */
.notice-card { max-width: 620px; margin: 24px auto 0; text-align: center; padding: 40px 32px; }
.notice-card .empty-icon { margin-bottom: 18px; }
.notice-card.is-danger .empty-icon { color: var(--a-danger); background: linear-gradient(135deg, #fee2e2, #ffe4e6); }
.notice-card h1 { font-size: 1.7rem; margin-bottom: 10px; overflow-wrap: anywhere; }
.notice-card .lead-text { color: var(--a-muted); margin-bottom: 20px; }
.notice-price { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 8px; padding: 12px 20px; border-radius: 14px; background: var(--a-primary-50); margin-bottom: 22px; }
.notice-price b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; color: var(--a-text); }
.notice-price span { color: var(--a-muted); }
.notice-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.notice-list { list-style: none; padding: 0; margin: 0 auto 22px; max-width: 360px; text-align: left; display: grid; gap: 8px; }
.notice-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--a-border); }
.notice-list li span { color: var(--a-muted); }
.notice-list li b { text-align: right; }
.spin { display: inline-block; animation: learn-spin 1s linear infinite; }
@keyframes learn-spin { to { transform: rotate(360deg); } }
@media (max-width: 575.98px) {
  .notice-card { padding: 28px 18px; margin-top: 8px; }
  .notice-actions .btn { width: 100%; }
}

/* ---------- кабинет ученика ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-tile { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 18px; }
.stat-tile .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0;
  color: var(--a-primary); background: var(--a-primary-50); }
.stat-tile .ico.is-success { color: #047857; background: #d1fae5; }
.stat-tile .ico.is-warning { color: #b45309; background: #fef3c7; }
.stat-tile .ico.is-cyan { color: #0e7490; background: #cffafe; }
.stat-tile .num { font-size: 1.6rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat-tile .cap { color: var(--a-muted); font-size: .84rem; line-height: 1.3; }

.dash-section { margin-top: 36px; }
.dash-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.dash-section-head h2 { font-size: 1.35rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.dash-section-head h2 i { color: var(--a-primary); }
.dash-section .empty { padding: 32px 16px; }
.dash-section .empty .empty-icon { width: 56px; height: 56px; font-size: 1.5rem; }

.dash-course .cover { aspect-ratio: 16 / 8; }
.dash-course .progress-line { display: flex; justify-content: space-between; font-size: .84rem; color: var(--a-muted); margin-bottom: 6px; }
.dash-course .progress-line b { color: var(--a-text); }
.dash-course .actions .btn { flex: 1; }

.booking-list, .hw-list { display: grid; gap: 12px; }
.booking-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.booking-date { flex-shrink: 0; width: 64px; text-align: center; border-radius: 14px; padding: 8px 4px; background: var(--a-primary-50); color: var(--a-primary); line-height: 1.1; }
.booking-date b { display: block; font-size: 1.4rem; font-weight: 800; }
.booking-date small { font-size: .74rem; font-weight: 700; text-transform: uppercase; }
.booking-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.booking-main h3 { font-size: 1rem; margin: 0 0 4px; }
.booking-main .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--a-muted); font-size: .86rem; }

.hw-card { padding: 18px 20px; overflow-wrap: anywhere; }
.hw-card-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.hw-card h3 { font-size: 1rem; margin: 0 0 2px; }
.hw-card .course-name { color: var(--a-muted); font-size: .86rem; }
.hw-card .hw-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hw-card .hw-comment { font-size: .9rem; }
.hw-resubmit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--a-border); }
.hw-resubmit input[type=file] { flex: 1 1 220px; min-width: 0; }

@media (max-width: 991.98px) {
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .stat-tiles { gap: 10px; }
  .stat-tile { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .stat-tile .ico { width: 40px; height: 40px; font-size: 1.1rem; }
  .booking-card { padding: 14px 16px; gap: 12px; }
  .hw-resubmit .btn { width: 100%; }
}

/* ---------- редактор курса (модули) ---------- */
.editor-module { margin-bottom: 20px; }
.editor-module .card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.editor-module .card-header h2 { font-size: 1.15rem; margin: 0; display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.editor-module .module-num { width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; font-size: .9rem;
  background: var(--a-grad); color: #fff; }
.editor-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.editor-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.editor-lesson { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--a-border); background: #fbfcfe; }
.editor-lesson .lesson-text { flex: 1 1 260px; }
.editor-lesson .lesson-text p { margin: 2px 0 0; color: var(--a-muted); font-size: .86rem; }

/* ---------- тарифы ---------- */
.tariff-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 20px 24px; border-radius: var(--a-radius); margin-bottom: 20px; }
.tariff-alert .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.tariff-alert h3 { margin: 0 0 4px; font-size: 1.1rem; }
.tariff-alert p { margin: 0; }
.tariff-alert .body { flex: 1 1 280px; min-width: 0; }
.tariff-alert.is-sale { background: linear-gradient(120deg, #fff1f2, #fef3c7); border: 1px solid #fecdd3; }
.tariff-alert.is-sale .ico { background: #ef4444; color: #fff; }
.tariff-alert.is-trial { background: linear-gradient(120deg, #eef2ff, #ecfeff); border: 1px solid #c7d2fe; }
.tariff-alert.is-trial .ico { background: var(--a-grad); color: #fff; }

.tariff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: stretch; margin-top: 8px; }
.tariff-card { position: relative; display: flex; flex-direction: column; padding: 26px 24px; height: 100%; transition: transform .2s, box-shadow .2s; }
.tariff-card:hover { transform: translateY(-3px); box-shadow: var(--a-shadow-lg); }
.tariff-card.is-featured { border: 2px solid transparent; background: linear-gradient(#fff, #fff) padding-box, var(--a-grad-wide) border-box; box-shadow: 0 20px 50px rgba(79,70,229,.18); }
.tariff-flag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: #fff; background: var(--a-grad); padding: 4px 14px;
  border-radius: 999px; font-size: .76rem; font-weight: 700; box-shadow: 0 6px 16px rgba(79,70,229,.35); }
.tariff-card h3 { font-size: 1.2rem; margin: 0 0 4px; }
.tariff-card .tariff-term { color: var(--a-muted); font-size: .9rem; }
.tariff-price { margin: 18px 0 4px; }
.tariff-price .main { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; white-space: nowrap; }
.tariff-price .old { color: var(--a-muted); text-decoration: line-through; white-space: nowrap; font-size: .95rem; }
.tariff-price .per { color: var(--a-primary); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.tariff-features { list-style: none; padding: 0; margin: 16px 0 22px; display: grid; gap: 10px; font-size: .92rem; }
.tariff-features li { display: flex; align-items: flex-start; gap: 10px; }
.tariff-features i { color: var(--a-success); font-size: 1.05rem; line-height: 1.4; }
.tariff-features li.is-off { color: var(--a-muted); }
.tariff-features li.is-off i { color: #94a3b8; }
.tariff-card .btn { margin-top: auto; width: 100%; }

.tariff-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.tariff-extra .card-body { display: flex; gap: 14px; align-items: flex-start; }
.tariff-extra .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--a-primary-50); color: var(--a-primary); font-size: 1.15rem; }
.tariff-extra h3 { font-size: 1rem; margin: 0 0 6px; }
.tariff-extra ul { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 4px; }
.tariff-extra ul i { color: var(--a-success); margin-right: 6px; }
.tariff-contacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

@media (max-width: 575.98px) {
  .tariff-alert { padding: 18px; }
  .tariff-alert .btn { width: 100%; }
  .tariff-contacts .btn { flex: 1 1 100%; }
  .tariff-grid { gap: 26px; }
}

/* ---------- пробный доступ (форма) ---------- */
.trial-wrap { max-width: 560px; margin: 8px auto 0; }
.trial-card { padding: 36px 32px; }
.trial-card .form-check-input { margin-top: .3em; }
@media (max-width: 575.98px) { .trial-card { padding: 26px 18px; } }

/* ---------- политика (текст документа) ---------- */
.doc-card { max-width: 860px; padding: 36px 40px; }
.doc-card h2 { font-size: 1.15rem; margin: 28px 0 10px; }
.doc-card h2:first-child { margin-top: 0; }
.doc-card p, .doc-card li { color: #334155; }
.doc-card ul { padding-left: 1.2rem; display: grid; gap: 4px; }
.doc-card a { overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .doc-card { padding: 24px 18px; } }
.tariff-grid > .empty { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .editor-lesson > .lesson-ico { display: none; } }
