body:not(.allow-copy) {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

:root {
    --primary: #1a3a6b;
    --primary-light: #2563eb;
    --bg: #ffffff;
    --bg-alt: #f5f7fa;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --text: #1f2937;
    --muted: #6b7280;
    --green: #16a34a;
    --red: #dc2626;
    --radius: 10px;
    --shadow: 0 1px 4px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Резервируем место под скроллбар — предотвращает прыжок при открытии модала */
html { scrollbar-gutter: stable; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ── Header styles live in base.html <style> block ── */

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .2s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(26,58,107,.25);
}
.btn-primary:hover { background: #142d56; box-shadow: 0 4px 12px rgba(26,58,107,.35); }
.btn-outline {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all .2s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: .9rem;
    padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text); }

/* Hero */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    background: linear-gradient(160deg, #f0f4ff 0%, #ffffff 60%);
    border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 2rem; font-weight: 800; line-height: 1.3; margin-bottom: 16px; color: var(--primary); }
.hero-sub { color: var(--muted); font-size: 1.05rem; margin-bottom: 36px; max-width: 600px; margin-left: auto; margin-right: auto; margin-bottom: 36px; }
.auth-block p { color: var(--muted); margin-bottom: 16px; font-size: .95rem; }

/* Features */
.features { padding: 64px 0; background: var(--bg-alt); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.feature {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: box-shadow .2s;
}
.feature:hover { box-shadow: var(--shadow-md); }
.feature-icon { font-size: 1.8rem; }
.feature h3 { margin: 12px 0 8px; font-size: 1rem; font-weight: 600; color: var(--primary); }
.feature p { color: var(--muted); font-size: .88rem; }

/* Course page */
.course-layout { padding: 40px 0; }
.course-layout h1 { margin-bottom: 24px; font-size: 1.6rem; color: var(--primary); }
.access-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 28px;
    font-size: .95rem;
    color: #1e40af;
}
.access-banner a { color: var(--primary); text-decoration: none; font-weight: 600; }
.section-block { margin-bottom: 32px; }
.section-title {
    font-size: .8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.lesson-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: background .15s;
    margin-bottom: 2px;
    border: 1px solid transparent;
}
.lesson-row:hover { background: var(--bg-alt); border-color: var(--border); }
.lesson-row.locked { opacity: .45; pointer-events: none; }
.lesson-row.done .lesson-name { color: var(--muted); }
.lesson-row.done { background: #f0fdf4; }
.lesson-num {
    min-width: 28px;
    font-size: .8rem;
    color: var(--muted);
    text-align: right;
}
.lesson-name { flex: 1; font-size: .93rem; }
.lesson-badges { display: flex; gap: 6px; }
.badge {
    font-size: .72rem;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f3f4f6;
    color: var(--muted);
    font-weight: 500;
}
.badge.video { background: #ede9fe; color: #6d28d9; }
.badge.doc { background: #dcfce7; color: #15803d; }
.badge.test { background: #fff7ed; color: #c2410c; }

/* Lesson page */
.lesson-layout { padding: 32px 0 60px; }
.lesson-nav {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    font-size: .88rem;
}
.lesson-nav a { color: var(--muted); text-decoration: none; transition: color .15s; }
.lesson-nav a:hover { color: var(--primary); }
.nav-course { margin: 0 auto; font-weight: 500; }
.lesson-title { font-size: 1.5rem; margin-bottom: 28px; color: var(--primary); font-weight: 700; }

/* Video */
.video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}
.video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}
/* Защита видео — полный оверлей */
.video-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
    pointer-events: all;
    cursor: default;
}
.video-fs-btn {
    position: absolute;
    bottom: 10px; right: 10px;
    z-index: 11;
    background: rgba(0,0,0,.65);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 15px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s;
}
.video-wrap:hover .video-fs-btn { opacity: 1; }
.video-wrap:fullscreen {
    width: 100vw; height: 100vh; padding-bottom: 0; border-radius: 0;
}
.video-wrap:-webkit-full-screen {
    width: 100vw; height: 100vh; padding-bottom: 0; border-radius: 0;
}

/* Conspect */
.conspect-block { margin-bottom: 28px; }
.conspect-content {
    margin-top: 20px;
    padding: 28px 32px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    line-height: 1.75;
}
.conspect-content h2 { font-size: 1.25rem; margin: 28px 0 10px; color: var(--primary); }
.conspect-content h3 { font-size: 1.05rem; margin: 20px 0 8px; }
.conspect-content p { margin-bottom: 12px; }
.conspect-content ul { padding-left: 20px; margin-bottom: 12px; }
.conspect-content li { margin-bottom: 6px; }
.conspect-content blockquote {
    border-left: 3px solid var(--primary);
    padding: 8px 16px;
    margin: 16px 0;
    color: var(--text-muted, #666);
    font-style: italic;
}

/* Test */
.test-block {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-top: 32px;
}
.test-block h2 { font-size: 1.05rem; margin-bottom: 24px; font-weight: 600; color: var(--primary); }
.question { margin-bottom: 20px; padding: 12px; border-radius: var(--radius); border: 1px solid transparent; transition: border-color .2s, background .2s; }
.question.wrong { border-color: rgba(220,38,38,.3); background: #fef2f2; }
.question.right { border-color: rgba(22,163,74,.25); background: #f0fdf4; }
.q-text { margin-bottom: 10px; font-size: .93rem; font-weight: 500; }
.answer-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 6px;
    cursor: pointer;
    font-size: .9rem;
    background: #fff;
    transition: border-color .15s, background .15s;
}
.answer-option:hover { border-color: var(--primary-light); background: #eff6ff; }
.answer-option input { margin-top: 2px; accent-color: var(--primary); }
.answer-option.correct { border-color: var(--green); background: #f0fdf4; }
.answer-option.wrong { border-color: var(--red); background: #fef2f2; }
.test-result {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
}
.test-result.pass { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.test-result.fail { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.complete-btn { margin-top: 32px; }
.btn-next-big { margin-top: 24px; width: 100%; justify-content: center; font-size: 1.1rem; padding: 16px 32px; }

/* Buy page */
.buy-layout { padding: 60px 0; text-align: center; }
.buy-layout h1 { font-size: 1.8rem; margin-bottom: 8px; color: var(--primary); }
.buy-layout .buy-sub { color: var(--muted); margin-bottom: 24px; }
.price-tag { font-size: 3rem; font-weight: 800; color: var(--primary); margin: 24px 0; }
.buy-features { text-align: left; max-width: 400px; margin: 0 auto 36px; }
.buy-features li { padding: 10px 0; color: var(--text); border-bottom: 1px solid var(--border); list-style: none; font-size: .95rem; }
.buy-features li::before { content: "✓ "; color: var(--green); font-weight: 700; }

@media (max-width: 600px) {
    .hero h1 { font-size: 1.4rem; }
    .lesson-name { font-size: .85rem; }
    .price-tag { font-size: 2.2rem; }
}
