/* Maximal Academy — стили сайта (без сборки, обычный CSS) */
:root {
    --bg: #f7f7fb;
    --surface: #ffffff;
    --surface-2: #f1f0f7;
    --text: #17152b;
    --muted: #615e7a;
    --border: #e3e1ee;
    --primary: #6d28d9;
    --primary-600: #5b21b6;
    --primary-50: #f3edff;
    --accent: #06b6d4;
    --success: #059669;
    --success-50: #ecfdf5;
    --warning: #b45309;
    --warning-50: #fffbeb;
    --danger: #dc2626;
    --danger-50: #fef2f2;
    --dark: #0f0d1f;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(23, 21, 43, .04), 0 8px 24px rgba(23, 21, 43, .06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); }
img, video, iframe { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
code, pre { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 2px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Шапка --- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; color: var(--text); }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: .9rem; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 1.2rem; cursor: pointer; }
.bell { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--text); }
.bell:hover { background: var(--surface-2); text-decoration: none; }
.bell .count { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--primary-50); color: var(--primary); font-weight: 700; font-size: .85rem; }

.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px; display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }

@media (max-width: 860px) {
    .menu-toggle { display: block; }
    .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 20px; }
    .nav.open { display: flex; }
    .site-header .container { gap: 12px; }
    .header-actions { margin-left: auto; }
    .header-actions .btn-ghost-hide { display: none; }
}

/* --- Кнопки и формы --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-light { background: #fff; color: var(--dark); }
.btn-light:hover { background: #f1f1f1; color: var(--dark); }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: .875rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn-google:hover { background: #f8f9fa; color: #1f1f1f; }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field { margin-bottom: 16px; }
.input, input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
textarea { min-height: 120px; resize: vertical; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.checkbox input { margin-top: 5px; width: 16px; height: 16px; flex: none; }
.error-text { color: var(--danger); font-size: .875rem; margin-top: 4px; }
.honeypot { position: absolute; left: -9999px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .875rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* --- Блоки --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card-tight { padding: 16px; }
.card h3:first-child { margin-top: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.alert { padding: 14px 18px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 16px; }
.alert-success { background: var(--success-50); border-color: #a7f3d0; color: #065f46; }
.alert-warning { background: var(--warning-50); border-color: #fde68a; color: #92400e; }
.alert-danger { background: var(--danger-50); border-color: #fecaca; color: #991b1b; }
.alert ul { margin: 0; padding-left: 20px; }
.flash-wrap { padding-top: 16px; }

.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-title h2 { margin: 0; }

.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; }

table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

/* --- Hero --- */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(6, 182, 212, .35), transparent), radial-gradient(900px 500px at 0% 0%, rgba(109, 40, 217, .55), transparent), var(--dark); color: #fff; padding: 88px 0 96px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 760px; }
.hero p.lead { font-size: 1.2rem; color: #cfcbe6; max-width: 640px; }
.hero .badge { background: rgba(255, 255, 255, .1); color: #e9e5ff; }
.hero-stats { display: flex; gap: 40px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.6rem; }
.hero-stats span { color: #bdb7dc; font-size: .9rem; }

.feature { padding: 22px; }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 1.3rem; margin-bottom: 12px; }

/* --- Карточка курса --- */
.course-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; transition: transform .15s, box-shadow .15s; }
.course-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(23, 21, 43, .1); }
.course-card .cover { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--primary), var(--accent)); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.4rem; overflow: hidden; }
.course-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.course-card .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.course-card h3 { margin: 8px 0; font-size: 1.15rem; }
.course-card h3 a { color: var(--text); }
.course-card .meta { color: var(--muted); font-size: .875rem; }
.course-card .footer { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 800; font-size: 1.25rem; }
.price-old { color: var(--muted); text-decoration: line-through; font-weight: 500; font-size: .95rem; margin-left: 6px; }

/* --- Страница курса --- */
.course-hero { background: var(--dark); color: #fff; padding: 56px 0; }
.course-hero .muted { color: #bdb7dc; }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.sticky-card { position: sticky; top: 88px; }
@media (max-width: 960px) { .course-layout { grid-template-columns: 1fr; } .sticky-card { position: static; } }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { padding-left: 28px; position: relative; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--success); font-weight: 800; }
.module { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface); }
.module summary { padding: 14px 18px; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; list-style: none; }
.module summary::-webkit-details-marker { display: none; }
.module summary::after { content: "+"; color: var(--muted); }
.module[open] summary::after { content: "−"; }
.module .lessons { border-top: 1px solid var(--border); padding: 6px 18px 12px; }
.lesson-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.lesson-row:last-child { border-bottom: 0; }
.tariff { border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--surface); }
.tariff.featured { border-color: var(--primary); }
.tariff + .tariff { margin-top: 14px; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.stars { color: #f59e0b; letter-spacing: 2px; }

/* --- Урок --- */
.lesson-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; padding: 24px 0 64px; }
.lesson-sidebar { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.lesson-sidebar .module-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; font-weight: 700; }
.lesson-link { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: .93rem; }
.lesson-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.lesson-link.current { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.lesson-link .state { flex: none; width: 18px; text-align: center; color: var(--muted); }
.lesson-link.done .state { color: var(--success); }
.lesson-link.locked { color: var(--muted); }
@media (max-width: 960px) { .lesson-layout { grid-template-columns: 1fr; } .lesson-sidebar { position: static; max-height: none; order: 2; } }

.player { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watermark { position: absolute; z-index: 5; pointer-events: none; color: rgba(255, 255, 255, .35); font-size: 13px; font-family: var(--mono); text-shadow: 0 0 2px rgba(0, 0, 0, .6); transition: top 1.5s ease, left 1.5s ease; user-select: none; white-space: nowrap; }
.content { font-size: 1.04rem; }
.content img { border-radius: var(--radius-sm); }
.content pre { background: #1e1b32; color: #ece9ff; padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; }
.content blockquote { border-left: 4px solid var(--primary); margin: 0 0 1em; padding: 6px 16px; background: var(--primary-50); border-radius: 0 8px 8px 0; }
.content table { border-collapse: collapse; width: 100%; }
.content th, .content td { border: 1px solid var(--border); padding: 8px; }

/* Защита от копирования: выделение и печать запрещены, разрешено только внутри .allow-copy */
.protected { -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-touch-callout: none; position: relative; }
.protected .allow-copy, .allow-copy { -webkit-user-select: text; -moz-user-select: text; user-select: text; -webkit-touch-callout: default; }
.protected-watermark { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; background-repeat: repeat; opacity: .07; }
@media print { .protected, .player { display: none !important; } body::after { content: "Друк матеріалів курсу заборонено."; display: block; padding: 40px; font-size: 20px; } }

.task-box { border: 1px solid #c7d2fe; background: #f5f7ff; border-radius: var(--radius); padding: 20px; }
.snippet { position: relative; margin: 12px 0; }
.snippet pre { margin: 0; background: #1e1b32; color: #ece9ff; padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; }
.snippet .copy-btn { position: absolute; top: 8px; right: 8px; }
.snippet-title { font-size: .85rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.quiz-question { padding: 16px 0; border-bottom: 1px solid var(--border); }
.quiz-option { display: flex; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; font-weight: 400; cursor: pointer; }
.quiz-option.correct { border-color: var(--success); background: var(--success-50); }
.quiz-option.wrong { border-color: var(--danger); background: var(--danger-50); }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin: 32px 0; flex-wrap: wrap; }

.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment .replies { margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--border); }
.comment .comment { border-bottom: 0; padding: 8px 0; }
.comment-body { white-space: pre-line; }
.rating-input { display: flex; gap: 6px; flex-direction: row-reverse; justify-content: flex-end; }
.rating-input input { display: none; }
.rating-input label { font-size: 1.6rem; color: #d4d4d8; cursor: pointer; margin: 0; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: #f59e0b; }

/* --- Кабинет --- */
.cabinet { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; padding: 32px 0 64px; }
.cabinet-nav a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--text); font-weight: 500; }
.cabinet-nav a:hover { background: var(--surface-2); text-decoration: none; }
.cabinet-nav a.active { background: var(--primary-50); color: var(--primary); }
@media (max-width: 860px) { .cabinet { grid-template-columns: 1fr; } .cabinet-nav { display: flex; overflow-x: auto; gap: 4px; } .cabinet-nav a { white-space: nowrap; } }
.notification { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.notification.unread { font-weight: 600; }
.notification .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 9px; flex: none; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: var(--mono); background: var(--surface-2); padding: 16px; border-radius: var(--radius-sm); }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; }

/* --- Авторизация --- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; }

/* --- Блог --- */
.post-card .cover { aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); margin-bottom: 12px; }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.article { font-size: 1.07rem; }
.article img { border-radius: var(--radius-sm); }

/* --- Подвал --- */
.site-footer { background: var(--dark); color: #bdb7dc; padding: 56px 0 28px; margin-top: 40px; }
.site-footer a { color: #e2deff; }
.site-footer h4 { color: #fff; font-size: 1rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 2fr; gap: 32px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 40px; padding-top: 20px; font-size: .875rem; }
.subscribe-form { display: flex; gap: 8px; }
.subscribe-form input[type=email] { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .15); color: #fff; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } .subscribe-form { flex-direction: column; } }

/* --- Cookie-баннер --- */
.cookie-banner { position: fixed; z-index: 100; left: 16px; right: 16px; bottom: 16px; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0, 0, 0, .18); padding: 18px 20px; }
.cookie-banner p { margin-bottom: 12px; font-size: .93rem; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; margin: 24px 0 0; }
.pagination a, .pagination span { display: inline-block; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.pagination .active span { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled span { color: var(--muted); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.error-page { text-align: center; padding: 96px 20px; }
.error-page .code { font-size: 5rem; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
