/* ==========================================================================
   Медиа уроки — компоненты страниц (дополнение к app.css).
   Здесь только то, что появилось вместе с подпиской, оплатой и плеером:
   шапка-навигация, витрина тарифов, касса, paywall, читалка урока.
   ========================================================================== */

/* ------------------------------------------------------- доступность ---- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    background: var(--ink-900);
    color: #fff;
    padding: .7rem 1.1rem;
    border-radius: 0 0 var(--r-sm) 0;
    font-weight: 700;
}
.skip-link:focus { left: 0; color: #fff; }

.min-w-0 { min-width: 0; }

/* --------------------------------------------------------- шапка сайта -- */

.site-nav-inner {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    min-height: 72px;
}

.site-nav-links {
    display: flex;
    align-items: center;
    gap: .2rem;
    margin-left: .4rem;
    flex-grow: 1;
}
@media (max-width: 991.98px) { .site-nav-links { display: none; } }

.site-nav-auth {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-left: auto;
}
@media (max-width: 767.98px) { .site-nav-auth .btn, .site-nav-auth .nav-user span:not(.avatar) { display: none; } }

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .28rem .6rem .28rem .3rem;
    border-radius: 999px;
    color: var(--ink-700);
    font-weight: 700;
    font-size: .9rem;
    border: 1px solid transparent;
    transition: background-color .18s ease, border-color .18s ease;
}
.nav-user:hover { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }

.nav-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-400);
    font-size: 1.05rem;
    transition: all .18s ease;
}
.nav-icon-btn:hover { color: var(--rose-600); border-color: var(--rose-100); background: var(--rose-100); }

.nav-burger { display: none; margin-left: auto; }
@media (max-width: 767.98px) { .nav-burger { display: inline-grid; } }

.site-nav-mobile {
    border-top: 1px solid var(--line);
    padding: .6rem 0 1rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.site-nav-mobile .nav-link { justify-content: flex-start; width: 100%; }

.site-main { padding: 2rem 0 0; }
.site-main > .container { padding-top: .5rem; }

.avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 1.2rem;
}

.brand-light { color: #fff; }
.brand-light:hover { color: #fff; }

/* ----------------------------------------------------------- заголовок -- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.6rem;
}

/* --------------------------------------------------------------- hero --- */

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin-top: 1.6rem;
}
.btn-hero-ghost {
    background: rgba(255, 255, 255, .1);
    border: 1.5px solid rgba(255, 255, 255, .3);
    color: #fff;
}
.btn-hero-ghost:hover {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .5);
    color: #fff;
}

/* ------------------------------------------------------------- каталог -- */

.catalog { margin-top: 3rem; }

.catalog-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1.6rem;
}
.filters-search { flex: 1 1 320px; }
.filters-search .input-search { width: 100%; }
.filters-select { flex: 0 1 200px; border-radius: 999px; height: 3.15rem; box-shadow: var(--sh-2); }

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
    gap: 1.3rem;
}

.course-card .cover { display: block; }
.course-card h3 a { color: var(--ink-900); }
.course-card h3 a:hover { color: var(--brand-700); }

.subscribe-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    margin-top: 3rem;
    padding: clamp(1.4rem, 3vw, 2.2rem);
    border-radius: var(--r-xl);
    background:
        radial-gradient(600px 240px at 92% 10%, rgba(108, 92, 231, .16), transparent 70%),
        var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--sh-2);
}

/* --------------------------------------------------------- выноски ------ */

.callout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.35rem;
    border-radius: var(--r-md);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--sh-1);
    margin-bottom: 1.4rem;
}
.callout-mint { background: var(--mint-100); border-color: #bfe9d4; }
.callout-icon {
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    background: var(--brand-100);
    color: var(--brand-700);
}
.callout-mint .callout-icon { background: #fff; color: var(--mint-600); }
.callout-note { color: var(--ink-400); font-size: .9rem; margin-top: .15rem; }

/* ------------------------------------------------------ страница курса -- */

.syllabus-row {
    display: flex;
    align-items: center;
    gap: .95rem;
    padding: .95rem 1.35rem;
    border-bottom: 1px solid var(--line);
    transition: background-color .16s ease;
}
.syllabus-row:last-child { border-bottom: 0; }
.syllabus-row:hover { background: var(--brand-50); }

.syllabus-title {
    font-weight: 700;
    color: var(--ink-900);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
}
.syllabus-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    color: var(--ink-400);
    font-weight: 600;
}
.dot-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--ink-300);
    display: inline-block;
}

.state-dot.is-locked { background: var(--amber-100); color: #a86b00; }

.course-aside { overflow: hidden; }
.course-aside .cover { height: 130px; }

.spec-list { margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.spec-list > div { display: flex; justify-content: space-between; gap: 1rem; }
.spec-list dt { font-weight: 600; color: var(--ink-400); font-size: .88rem; }
.spec-list dd { margin: 0; font-weight: 700; color: var(--ink-900); text-align: right; }

.card-premium {
    background:
        radial-gradient(420px 200px at 100% 0%, rgba(245, 159, 0, .14), transparent 70%),
        var(--surface);
    border-color: #f3e3c2;
}

/* ---------------------------------------------------------- читалка ----- */

.reader-side { position: sticky; top: 92px; }
@media (max-width: 991.98px) { .reader-side { position: static; margin-bottom: 1.2rem; } }

.toc-list { display: flex; flex-direction: column; gap: .1rem; max-height: 62vh; overflow-y: auto; }

.lesson-head { margin-bottom: 1.2rem; }
.lesson-card { overflow: hidden; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.6rem; }
.lesson-pager { display: flex; gap: .8rem; justify-content: space-between; padding-top: 1.2rem; border-top: 1px solid var(--line); }

.video-frame video { display: block; width: 100%; height: auto; max-height: 72vh; background: #000; }

/* ---------------------------------------------------------- paywall ----- */

.paywall {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.75rem;
    align-items: start;
}
@media (max-width: 991.98px) { .paywall { grid-template-columns: minmax(0, 1fr); } }

.paywall-main { min-width: 0; }

.paywall-fake {
    position: relative;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: linear-gradient(160deg, #f8f7ff, #eef0fb);
    padding: 1.4rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.paywall-fake-cover {
    height: 190px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, .9);
    background: linear-gradient(140deg, #17123f, var(--brand-700));
    margin-bottom: 1.1rem;
    filter: blur(.2px);
}
.paywall-fake-lines { display: flex; flex-direction: column; gap: .6rem; filter: blur(3px); opacity: .55; }
.paywall-fake-lines span { display: block; height: 11px; border-radius: 6px; background: #c9cee6; }
.paywall-fake-badge {
    position: absolute;
    inset: auto 50% 46% auto;
    transform: translateX(50%);
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.1rem;
    border-radius: 999px;
    background: var(--ink-900);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    box-shadow: var(--sh-3);
    white-space: nowrap;
}

.paywall-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.4rem; }

.paywall-points {
    list-style: none;
    padding: 0;
    margin: 0 0 1.6rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: .5rem .9rem;
}
.paywall-points li { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink-500); }
.paywall-points i { color: var(--mint-600); }

.paywall-free { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.paywall-free-list { display: flex; flex-direction: column; gap: .4rem; }
.paywall-free-list a {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .8rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink-700);
    font-weight: 600;
    transition: all .16s ease;
}
.paywall-free-list a:hover { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-700); }

/* ------------------------------------------------------------- тест ----- */

.quiz-wrap { max-width: 860px; margin: 0 auto; }
.quiz-head-card { overflow: hidden; }
.quiz-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.3rem;
    padding: .8rem 1.4rem;
    background: var(--canvas);
    border-top: 1px solid var(--line);
    font-size: .86rem;
    font-weight: 600;
    color: var(--ink-400);
}
.quiz-facts i { margin-right: .35rem; color: var(--ink-300); }

.result-card .card-body { padding: clamp(1.8rem, 4vw, 2.8rem); }

.review-row {
    display: flex;
    gap: .95rem;
    padding: 1.05rem 1.35rem;
    border-bottom: 1px solid var(--line);
}
.review-row:last-child { border-bottom: 0; }
.review-answers { list-style: none; padding: 0; margin: .55rem 0 0; font-size: .9rem; color: var(--ink-500); }
.review-answers li { display: flex; align-items: center; gap: .45rem; padding: .18rem 0; }
.review-answers li.is-right { color: #0a8a4f; font-weight: 700; }
.review-answers li.is-wrong { color: var(--rose-600); font-weight: 700; }

/* ------------------------------------------------------ формы и ошибки -- */

.form-alert {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .8rem 1rem;
    border-radius: var(--r-sm);
    background: var(--rose-100);
    color: #b3282c;
    font-weight: 600;
    font-size: .92rem;
    margin-bottom: 1rem;
}

.error-page { text-align: center; padding: clamp(3rem, 9vw, 6rem) 1rem; }
.error-code {
    font-family: var(--ff-display);
    font-size: clamp(4rem, 14vw, 8rem);
    font-weight: 700;
    line-height: .9;
    letter-spacing: -.05em;
    background: linear-gradient(140deg, var(--brand-500), #a78bfa 60%, var(--sky-600));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: .6rem;
}

/* ------------------------------------------------------------ тарифы ---- */

.pricing-hero { text-align: center; max-width: 760px; margin: 0 auto 2.4rem; }
.pricing-hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin-bottom: .7rem; }
.pricing-hero p { color: var(--ink-400); font-size: 1.04rem; margin: 0 auto; max-width: 56ch; }
.pricing-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: var(--brand-100);
    color: var(--brand-700);
    border-radius: 999px;
    padding: .32rem .85rem;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
    align-items: stretch;
}

.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 1.6rem 1.5rem;
    box-shadow: var(--sh-1);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: var(--brand-100); }
.plan-card-featured {
    border-color: transparent;
    background:
        radial-gradient(500px 220px at 100% 0%, rgba(108, 92, 231, .16), transparent 70%),
        linear-gradient(180deg, #fbfaff, #fff);
    box-shadow: var(--sh-brand);
}
.plan-badge {
    position: absolute;
    top: -.7rem;
    right: 1.2rem;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #fff;
    border-radius: 999px;
    padding: .3rem .8rem;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .04em;
    box-shadow: var(--sh-brand);
}

.plan-title { font-size: 1.25rem; margin-bottom: .3rem; }
.plan-subtitle { color: var(--ink-400); font-size: .9rem; min-height: 2.6em; margin-bottom: 1rem; }

.plan-price { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.plan-amount {
    font-family: var(--ff-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--ink-900);
    letter-spacing: -.03em;
}
.plan-period { color: var(--ink-400); font-size: .88rem; font-weight: 600; }
.plan-monthly { color: var(--brand-700); font-size: .84rem; font-weight: 700; margin-bottom: 1.1rem; }
.plan-price + .plan-features { margin-top: 1.1rem; }

.plan-features { list-style: none; padding: 0; margin: 0 0 1.4rem; display: flex; flex-direction: column; gap: .55rem; }
.plan-features li { display: flex; gap: .55rem; font-size: .92rem; color: var(--ink-500); font-weight: 600; }
.plan-features i { color: var(--mint-600); font-size: 1rem; margin-top: .12rem; }

.pricing-notes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 2.4rem 0;
}
.pricing-note {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: 1.1rem 1.2rem;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--surface);
}
.pricing-note strong { display: block; margin-bottom: .15rem; font-size: .95rem; }

.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 1rem 1.25rem;
    margin-bottom: .6rem;
}
.faq summary {
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--ink-900);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.2rem; color: var(--brand-600); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: .75rem 0 0; color: var(--ink-400); font-size: .94rem; }

/* ------------------------------------------------------------ касса ----- */

.checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 991.98px) { .checkout { grid-template-columns: minmax(0, 1fr); } }

.order-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.order-title { font-weight: 700; color: var(--ink-900); font-size: 1.02rem; }
.order-amount {
    font-family: var(--ff-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink-900);
    white-space: nowrap;
}
.checkout-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }

.pay-sim { max-width: 520px; margin: 0 auto; }
.pay-sim-card { overflow: hidden; box-shadow: var(--sh-3); }
.pay-sim-head {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.15rem 1.35rem;
    background: var(--ink-900);
    color: #fff;
}
.pay-sim-head .text-muted { color: rgba(255, 255, 255, .6) !important; }

.pay-card-mock {
    position: relative;
    border-radius: var(--r-md);
    padding: 1.3rem;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, #232a4d, #4a3fd0 70%, #6c5ce7);
    color: #fff;
    box-shadow: var(--sh-3);
}
.pay-card-chip {
    width: 38px;
    height: 28px;
    border-radius: 7px;
    background: linear-gradient(135deg, #ffe08a, #d9a400);
    margin-bottom: 1.6rem;
}
.pay-card-number {
    font-family: var(--ff-display);
    letter-spacing: .12em;
    font-size: 1.05rem;
    margin-bottom: .8rem;
}
.pay-card-foot { display: flex; justify-content: space-between; font-size: .76rem; letter-spacing: .1em; opacity: .8; }

/* --------------------------------------------------------- результат ---- */

.result-wrap { max-width: 640px; margin: 0 auto; }

.result-mark {
    width: 82px;
    height: 82px;
    border-radius: 26px;
    display: grid;
    place-items: center;
    font-size: 2.1rem;
    margin: 0 auto;
}
.result-mark-ok { background: var(--mint-100); color: var(--mint-600); }
.result-mark-fail { background: var(--rose-100); color: var(--rose-600); }
.result-mark-wait { background: var(--amber-100); color: #a86b00; }

.subscription-facts { display: flex; gap: 1.8rem; }
.subscription-facts b {
    display: block;
    font-family: var(--ff-display);
    font-size: 1.15rem;
    color: var(--ink-900);
}
.subscription-facts span { font-size: .8rem; color: var(--ink-400); font-weight: 600; }

/* --------------------------------------------------------- таблицы ------ */

.data-table { font-size: .92rem; }
.data-table th {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-300);
    font-weight: 800;
    border-bottom: 1px solid var(--line);
    padding: .8rem 1.1rem;
    background: var(--canvas);
}
.data-table td { padding: .8rem 1.1rem; border-color: var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--brand-50); }

/* --------------------------------------------------------- мелочи ------- */

.text-muted.small, .small.text-muted { font-weight: 600; }

@media (max-width: 575.98px) {
    .hero-stats { gap: 1.4rem; }
    .course-grid { grid-template-columns: minmax(0, 1fr); }
    .lesson-pager { flex-direction: column; }
    .lesson-nav-card.is-next { text-align: left; }
}
