/* ==========================================================================
   Smart Acumen — Portal layer (LMS + Admin), loaded AFTER style.css.
   Reuses the site design tokens (:root in style.css).
   01. Shared portal primitives     05. Course & lesson components
   02. Auth screens                 06. Custom video player skin
   03. Student (learn) shell        07. Modal & brochure gate
   04. Admin shell                  08. Responsive
   ========================================================================== */

/* ---------- 01. SHARED PRIMITIVES ---------- */
.portal-main {
    min-height: 100svh;
    padding: 7.5rem 0 4rem;
}

.flash {
    display: flex; align-items: flex-start; gap: 0.8rem;
    padding: 1rem 1.3rem;
    margin-bottom: 1.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 500;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: riseIn 0.5s var(--ease-out);
}
.flash svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 0.1rem; }
.flash--success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.35); color: #86efac; }
.flash--error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.35); color: #fca5a5; }
.flash--info { background: rgba(227, 183, 77, 0.08); border: 1px solid var(--gold-line); color: var(--gold-soft); }

/* Forms */
.field { margin-bottom: 1.2rem; }
.label {
    display: block;
    font-size: 0.82rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 0.5rem;
}
.input, .select, .textarea {
    width: 100%;
    min-height: 50px;
    padding: 0.8rem 1.1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    color: var(--ink);
    font: inherit; font-size: 0.98rem;
    transition: border-color var(--speed), background var(--speed), box-shadow var(--speed);
}
.textarea { min-height: 110px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--gold-line);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(227, 183, 77, 0.15);
}
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238492ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 2.6rem;
}
.select option { background: #0c1526; color: var(--ink); }
.field-error { margin-top: 0.45rem; font-size: 0.84rem; color: #fca5a5; }
.field-hint { margin-top: 0.45rem; font-size: 0.82rem; color: var(--ink-3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* OTP boxes */
.otp-input {
    letter-spacing: 0.9em;
    text-align: center;
    font-size: 1.5rem; font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding-left: 1.6rem;
}

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    white-space: nowrap;
}
.badge--gold { background: rgba(227, 183, 77, 0.15); color: var(--gold-soft); border: 1px solid var(--gold-line); }
.badge--green { background: rgba(34, 197, 94, 0.12); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge--red { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge--blue { background: rgba(96, 165, 250, 0.12); color: #93c5fd; border: 1px solid rgba(96, 165, 250, 0.3); }
.badge--muted { background: rgba(255, 255, 255, 0.06); color: var(--ink-3); border: 1px solid var(--line); }

/* Data tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
    min-width: 640px;
}
.data-table th {
    text-align: left;
    padding: 0.9rem 1.1rem;
    font-size: 0.74rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--gold);
    border-bottom: 1px solid var(--line-2);
    white-space: nowrap;
}
.data-table td {
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink-2);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--speed); }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.data-table .t-strong { color: var(--ink); font-weight: 600; }
.data-table .t-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .t-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* Small buttons for table rows */
.btn-xs {
    min-height: 34px; padding: 0.3rem 0.9rem;
    font-size: 0.82rem; border-radius: 9px;
}

/* Stat cards */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}
.stat-box { padding: 1.5rem 1.6rem; }
.stat-box .s-label {
    font-size: 0.74rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-3);
}
.stat-box .s-value {
    margin-top: 0.4rem;
    font-size: 1.9rem; font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--gold-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-box .s-sub { margin-top: 0.2rem; font-size: 0.8rem; color: var(--ink-3); }

/* Panels */
.panel { padding: 1.8rem; margin-bottom: 1.8rem; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.4rem;
}
.panel-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.panel-sub { font-size: 0.88rem; color: var(--ink-3); margin-top: 0.2rem; }

/* Pagination */
.pager { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.6rem; }
.pager a, .pager span {
    min-width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 0.7rem;
    border-radius: 10px;
    background: var(--glass);
    border: 1px solid var(--line);
    font-size: 0.9rem; color: var(--ink-2);
    transition: border-color var(--speed), color var(--speed);
}
.pager a:hover { border-color: var(--gold-line); color: var(--gold-soft); }
.pager .is-current { background: var(--gold-grad); color: #1a1303; font-weight: 700; border-color: transparent; }

/* Progress bar */
.progress-track {
    height: 7px; border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 6px;
    background: var(--gold-grad);
    transition: width 0.6s var(--ease-out);
}

/* ---------- 02. AUTH SCREENS ---------- */
.auth-wrap {
    min-height: 100svh;
    display: flex; align-items: center; justify-content: center;
    padding: 6rem 1.25rem 3rem;
}
.auth-card {
    width: min(440px, 100%);
    padding: 2.6rem 2.4rem;
    text-align: center;
}
.auth-card .auth-logo { height: 56px; width: auto; margin: 0 auto 1.4rem; filter: drop-shadow(0 4px 14px rgba(227,183,77,.3)); }
.auth-title { font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; }
.auth-sub { margin: 0.6rem 0 1.8rem; font-size: 0.93rem; color: var(--ink-3); }
.auth-card form { text-align: left; }
.auth-card .btn { width: 100%; }
.auth-alt { margin-top: 1.4rem; font-size: 0.88rem; color: var(--ink-3); }
.auth-alt a, .auth-alt button { color: var(--gold-soft); font-weight: 600; cursor: pointer; }
.auth-alt a:hover, .auth-alt button:hover { color: var(--gold); }

.auth-divider {
    display: flex; align-items: center; gap: 1rem;
    margin: 1.4rem 0;
    color: var(--ink-3); font-size: 0.78rem;
    letter-spacing: 0.14em; text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after {
    content: ""; flex: 1; height: 1px; background: var(--line);
}

.btn-google {
    background: #ffffff;
    color: #1f2937;
    font-weight: 600;
    gap: 0.7rem;
}
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,255,255,0.12); }
.btn-google svg { width: 20px; height: 20px; }

.debug-otp {
    margin-top: 1.2rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px dashed rgba(96, 165, 250, 0.4);
    font-size: 0.85rem; color: #93c5fd;
}
.debug-otp strong { font-size: 1.2rem; letter-spacing: 0.3em; color: #bfdbfe; }

/* ---------- 03. STUDENT SHELL ---------- */
.portal-topbar {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: var(--z-header);
    padding-block: 0.7rem;
    background: var(--glass-nav);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--line);
}
.portal-topbar .bar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.portal-topbar .brand-logo { height: 44px; }
.portal-nav { display: flex; align-items: center; gap: 0.4rem; }
.portal-nav a, .portal-nav .portal-user {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.95rem;
    border-radius: 10px;
    font-size: 0.92rem; font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
    transition: color var(--speed), background var(--speed);
}
.portal-nav a:hover { color: var(--ink); background: rgba(255,255,255,0.05); }
.portal-nav a.is-active { color: var(--gold-soft); background: rgba(227, 183, 77, 0.1); }
.portal-nav svg { width: 17px; height: 17px; }
.portal-user { color: var(--gold-soft); font-weight: 600; }
.portal-logout button {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.5rem 0.95rem;
    border-radius: 10px;
    font-size: 0.9rem; color: var(--ink-3);
    transition: color var(--speed), background var(--speed);
}
.portal-logout button:hover { color: #fca5a5; background: rgba(239, 68, 68, 0.08); }
.portal-logout svg { width: 16px; height: 16px; }

.page-head { margin-bottom: 2rem; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 700; }
.page-head p { margin-top: 0.4rem; color: var(--ink-3); }

/* ---------- 04. ADMIN SHELL ---------- */
.admin-shell { display: flex; min-height: 100svh; }

.admin-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    z-index: var(--z-header);
    width: 250px;
    display: flex; flex-direction: column;
    padding: 1.6rem 1rem;
    background: rgba(6, 11, 22, 0.85);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.admin-sidebar .brand-logo { height: 58px; width: auto; margin: 0 auto 2rem; }
.admin-nav { display: grid; gap: 0.25rem; flex: 1; align-content: start; }
.admin-nav a {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.94rem; font-weight: 500;
    color: var(--ink-2);
    transition: color var(--speed), background var(--speed);
}
.admin-nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.admin-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.admin-nav a.is-active {
    color: var(--gold-soft);
    background: rgba(227, 183, 77, 0.12);
    border: 1px solid var(--gold-line);
}
.admin-sidebar .portal-logout { border-top: 1px solid var(--line); padding-top: 1rem; }
.admin-sidebar .portal-logout button { width: 100%; justify-content: flex-start; }

.admin-content {
    flex: 1;
    margin-left: 250px;
    padding: 2.2rem clamp(1.25rem, 3vw, 2.5rem) 4rem;
    min-width: 0;
}
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin-bottom: 2rem;
}
.admin-topbar h1 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.admin-topbar .who { font-size: 0.88rem; color: var(--ink-3); }
.admin-topbar .who strong { color: var(--gold-soft); }

.admin-menu-toggle { display: none; }

/* Filter bar */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end;
    margin-bottom: 1.4rem;
}
.filter-bar .field { margin-bottom: 0; flex: 1; min-width: 160px; }
.filter-bar .input, .filter-bar .select { min-height: 44px; }
.filter-bar .btn { min-height: 44px; }

/* ---------- 04b. STUDENT APP SHELL (sidebar desktop / tab bar mobile) ---------- */
.app-shell { display: flex; min-height: 100svh; }

.app-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    z-index: var(--z-header);
    width: 250px;
    display: flex; flex-direction: column;
    padding: 1.6rem 1rem;
    background: rgba(6, 11, 22, 0.85);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.app-sidebar .brand-logo { height: 58px; width: auto; margin: 0 auto 2rem; }
.app-nav { display: grid; gap: 0.25rem; flex: 1; align-content: start; }
.app-nav a {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.94rem; font-weight: 500;
    color: var(--ink-2);
    transition: color var(--speed), background var(--speed);
}
.app-nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.app-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.app-nav a.is-active {
    color: var(--gold-soft);
    background: rgba(227, 183, 77, 0.12);
    border: 1px solid var(--gold-line);
}
.app-sidebar .side-user {
    border-top: 1px solid var(--line);
    padding-top: 1rem;
    display: grid; gap: 0.6rem;
}
.app-sidebar .side-user .who {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.88rem; color: var(--ink-2);
    min-width: 0;
}
.app-sidebar .side-user .who .avatar {
    width: 34px; height: 34px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--gold-grad); color: #1a1303;
    font-weight: 700; font-size: 0.95rem;
}
.app-sidebar .side-user .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-content {
    flex: 1;
    margin-left: 250px;
    min-width: 0;
    display: flex; flex-direction: column;
}
.app-topbar {
    display: none; /* desktop: sidebar carries everything */
}
.app-main { flex: 1; padding: 2.2rem clamp(1.25rem, 3vw, 2.5rem) 4rem; }
.app-main > .container { width: 100%; max-width: 1200px; margin-inline: auto; }

/* Bottom tab bar (mobile + tablet) */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: var(--z-header);
    display: none;
    background: rgba(6, 11, 22, 0.92);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar .tabs { display: flex; }
.tabbar a, .tabbar button {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
    padding: 0.6rem 0.3rem 0.55rem;
    font-size: 0.66rem; font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink-3);
    transition: color var(--speed);
    position: relative;
}
.tabbar svg { width: 21px; height: 21px; }
.tabbar a.is-active { color: var(--gold-soft); }
.tabbar a.is-active::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 32px; height: 3px; border-radius: 0 0 4px 4px;
    background: var(--gold-grad);
}
.tabbar a:active { transform: scale(0.94); }

@media (max-width: 1080px) {
    .app-sidebar { display: none; }
    .app-content { margin-left: 0; }
    .app-topbar {
        display: flex; align-items: center; justify-content: space-between;
        position: sticky; top: 0; z-index: var(--z-header);
        padding: 0.65rem clamp(1rem, 3vw, 1.5rem);
        padding-top: calc(0.65rem + env(safe-area-inset-top, 0));
        background: rgba(6, 11, 22, 0.88);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(20px) saturate(1.4);
        -webkit-backdrop-filter: blur(20px) saturate(1.4);
    }
    .app-topbar .brand-logo { height: 44px; width: auto; }
    .app-topbar .top-user {
        width: 34px; height: 34px;
        display: flex; align-items: center; justify-content: center;
        border-radius: 50%;
        background: var(--gold-grad); color: #1a1303;
        font-weight: 700; font-size: 0.9rem;
    }
    .app-main { padding: 1.4rem 1rem calc(5.4rem + env(safe-area-inset-bottom, 0)); }
    .tabbar { display: block; }
}

/* ---------- 05. COURSE & LESSON COMPONENTS ---------- */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.course-card { display: flex; flex-direction: column; overflow: hidden; transition: transform 0.35s var(--ease-out), border-color 0.35s; }
.course-card:hover { transform: translateY(-5px); border-color: var(--gold-line); }
.course-card .cc-thumb {
    aspect-ratio: 16 / 9;
    background:
        radial-gradient(ellipse 80% 80% at 50% 100%, rgba(227, 183, 77, 0.2), transparent 60%),
        linear-gradient(160deg, #0d1830, #091124);
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.course-card .cc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-card .cc-thumb .cc-initial {
    font-family: var(--font-display);
    font-size: 3rem; font-weight: 700;
    background: var(--gold-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.course-card .cc-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.course-card h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.course-card .cc-sub { font-size: 0.88rem; color: var(--ink-3); flex: 1; }
.course-card .cc-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; font-size: 0.85rem; color: var(--ink-3); }
.course-card .cc-progress { display: flex; align-items: center; gap: 0.8rem; font-size: 0.8rem; color: var(--ink-3); }
.course-card .cc-progress .progress-track { flex: 1; }

/* Syllabus / lesson list */
.lesson-group { margin-bottom: 1.6rem; }
.lesson-group-title {
    font-size: 0.8rem; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.8rem;
    display: flex; align-items: center; gap: 0.7rem;
}
.lesson-group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lesson-item {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.95rem 1.2rem;
    border-radius: var(--radius-sm);
    background: var(--glass);
    border: 1px solid var(--line);
    margin-bottom: 0.6rem;
    color: var(--ink-2);
    transition: border-color var(--speed), background var(--speed), transform var(--speed) var(--ease-out);
}
a.lesson-item:hover { border-color: var(--gold-line); background: rgba(255,255,255,0.06); transform: translateX(4px); }
.lesson-item.is-current { border-color: var(--gold-line); background: rgba(227, 183, 77, 0.08); }
.lesson-item .li-icon {
    width: 38px; height: 38px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(227, 183, 77, 0.12);
    border: 1px solid var(--gold-line);
    color: var(--gold-soft);
}
.lesson-item .li-icon svg { width: 16px; height: 16px; }
.lesson-item.is-locked .li-icon { background: rgba(255,255,255,0.05); border-color: var(--line); color: var(--ink-3); }
.lesson-item .li-main { flex: 1; min-width: 0; }
.lesson-item .li-title { font-weight: 600; color: var(--ink); font-size: 0.97rem; }
.lesson-item .li-sub { font-size: 0.8rem; color: var(--ink-3); margin-top: 0.15rem; }
.lesson-item .li-check { color: #4ade80; }
.lesson-item .li-check svg { width: 18px; height: 18px; }

/* Lesson page layout */
.lesson-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.8rem;
    align-items: start;
}
.lesson-rail { position: sticky; top: 6.5rem; max-height: calc(100svh - 8rem); overflow-y: auto; padding: 1.2rem; }
.lesson-rail::-webkit-scrollbar { width: 6px; }
.lesson-rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* ---------- 05b. ENROLLMENT SUCCESS ---------- */
.enrolled-wrap {
    min-height: calc(100svh - 12rem);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem 0 2rem;
}
.enrolled-card {
    position: relative;
    width: min(620px, 100%);
    padding: clamp(2rem, 5vw, 3.2rem) clamp(1.4rem, 5vw, 3rem) clamp(2rem, 4vw, 2.8rem);
    text-align: center;
    overflow: hidden;
    animation: riseInScale 0.7s var(--ease-out) both;
}
.enrolled-glow {
    position: absolute; top: -45%; left: 50%; transform: translateX(-50%);
    width: 120%; height: 90%;
    background: radial-gradient(ellipse at center, rgba(34, 197, 94, 0.18), transparent 62%);
    pointer-events: none;
}
.enrolled-check {
    position: relative;
    width: clamp(120px, 30vw, 168px);
    height: clamp(120px, 30vw, 168px);
    margin: 0 auto 0.4rem;
}
.check-lottie { width: 100%; height: 100%; }
.check-lottie svg { display: block; }

/* Zero-dependency animated fallback check */
.check-svg { width: 100%; height: 100%; overflow: visible; }
.check-svg .cs-ring {
    fill: rgba(34, 197, 94, 0.1);
    stroke: #22c55e; stroke-width: 5;
    stroke-dasharray: 327; stroke-dashoffset: 327;
    animation: csRing 0.7s var(--ease-out) 0.1s forwards;
}
.check-svg .cs-tick {
    fill: none; stroke: #4ade80;
    stroke-width: 8; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 70; stroke-dashoffset: 70;
    animation: csTick 0.45s var(--ease-out) 0.6s forwards;
}
@keyframes csRing { to { stroke-dashoffset: 0; } }
@keyframes csTick { to { stroke-dashoffset: 0; } }

.enrolled-kicker {
    font-size: 0.76rem; font-weight: 700;
    letter-spacing: 0.24em; text-transform: uppercase;
    color: #4ade80;
    margin-bottom: 0.7rem;
}
.enrolled-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4.2vw, 2.1rem);
    font-weight: 700; line-height: 1.25;
    letter-spacing: -0.015em;
}
.enrolled-sub {
    margin: 1rem auto 0;
    max-width: 46ch;
    color: var(--ink-3);
    font-size: 0.96rem;
}
.enrolled-receipt {
    display: grid; gap: 0.55rem;
    margin: 1.7rem auto 0;
    padding: 1.1rem 1.3rem;
    max-width: 420px;
    text-align: left;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    font-size: 0.88rem;
}
.enrolled-receipt div { display: flex; justify-content: space-between; gap: 1rem; }
.enrolled-receipt span { color: var(--ink-3); }
.enrolled-receipt strong { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; word-break: break-all; }
.enrolled-actions {
    display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap;
    margin-top: 2rem;
}

@media (max-width: 640px) {
    .enrolled-wrap { min-height: auto; padding-top: 0; }
    .enrolled-actions { flex-direction: column; }
    .enrolled-actions .btn { width: 100%; }
    .enrolled-receipt { font-size: 0.84rem; }
}

/* ---------- 06. CUSTOM VIDEO PLAYER ---------- */
.player-stage {
    position: relative;
    /* 16:9 via the universal padding hack (works in every browser,
       unlike aspect-ratio) so the video box can never collapse to 0 height */
    height: 0;
    padding-top: 56.25%;
    border-radius: var(--radius);
    overflow: hidden;
    background: #05080f;
    border: 1px solid var(--line-2);
    box-shadow: 0 30px 80px rgba(2, 5, 12, 0.6);
    user-select: none;
    /* Promote to its own composited layer: prevents Chrome's
       rounded-corner + overflow clip from blacking out the video */
    transform: translateZ(0);
}
.player-stage iframe,
.player-stage .yt-holder {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none; /* all interaction goes through our UI */
    border: 0;
}

.player-shield { position: absolute; inset: 0; z-index: 2; cursor: pointer; }

.player-overlay {
    position: absolute; inset: 0; z-index: 3;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
    /* near-opaque: YouTube shows its title/share chrome on pause and its
       related-videos grid at the end — nothing may bleed through */
    background: rgba(4, 8, 16, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.35s var(--ease-out), visibility 0.35s;
    text-align: center; padding: 1.5rem;
    cursor: pointer;
}
.player-overlay.is-visible { opacity: 1; visibility: visible; }
.player-overlay--poster {
    background:
        radial-gradient(ellipse 80% 80% at 50% 100%, rgba(227, 183, 77, 0.18), transparent 60%),
        linear-gradient(160deg, #0d1830 0%, #05080f 100%);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
.player-overlay .po-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--ink); max-width: 30ch; }
.player-overlay .po-sub { font-size: 0.88rem; color: var(--ink-3); }

.player-bigplay {
    width: 84px; height: 84px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--gold-grad);
    color: #1a1303;
    box-shadow: 0 16px 45px rgba(227, 183, 77, 0.45);
    transition: transform 0.3s var(--ease-out);
}
.player-bigplay svg { width: 34px; height: 34px; margin-left: 4px; }
.player-overlay:hover .player-bigplay { transform: scale(1.08); }

.player-spinner {
    position: absolute; inset: 0; z-index: 3;
    display: none; align-items: center; justify-content: center;
    pointer-events: none;
}
.player-spinner.is-visible { display: flex; }
.player-spinner span {
    width: 54px; height: 54px;
    border-radius: 50%;
    border: 3px solid rgba(227, 183, 77, 0.2);
    border-top-color: var(--gold);
    animation: pspin 0.9s linear infinite;
}
@keyframes pspin { to { transform: rotate(1turn); } }

.player-watermark {
    position: absolute; right: 14px; top: 12px; z-index: 4;
    height: 30px; opacity: 0.75; pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

/* Control bar */
.player-controls {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
    padding: 2rem 1.1rem 0.8rem;
    background: linear-gradient(180deg, transparent, rgba(3, 6, 12, 0.9));
    opacity: 0; transform: translateY(8px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.player-stage.controls-visible .player-controls { opacity: 1; transform: translateY(0); }
.player-stage.controls-visible { cursor: default; }
.player-stage:not(.controls-visible) { cursor: none; }

.player-seek {
    position: relative;
    height: 18px;
    display: flex; align-items: center;
    cursor: pointer;
    margin-bottom: 0.4rem;
}
.player-seek .seek-track {
    position: relative;
    width: 100%; height: 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
    transition: height 0.15s;
}
.player-seek:hover .seek-track { height: 7px; }
.player-seek .seek-buffer { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255,255,255,0.25); }
.player-seek .seek-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--gold-grad); }
.player-seek .seek-thumb {
    position: absolute; top: 50%;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--gold-soft);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s;
    pointer-events: none;
}
.player-seek:hover .seek-thumb { transform: translate(-50%, -50%) scale(1); }

.player-buttons { display: flex; align-items: center; gap: 0.4rem; }
.pbtn {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    color: #e8edf7;
    transition: background var(--speed), color var(--speed);
}
.pbtn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.pbtn svg { width: 21px; height: 21px; }
.player-time {
    font-size: 0.82rem; color: var(--ink-2);
    font-variant-numeric: tabular-nums;
    margin: 0 0.5rem;
    white-space: nowrap;
}
.player-spacer { flex: 1; }

.player-volume { display: flex; align-items: center; }
.volume-slider {
    width: 0; opacity: 0; overflow: hidden;
    transition: width 0.25s var(--ease-out), opacity 0.25s;
    display: flex; align-items: center;
}
.player-volume:hover .volume-slider, .volume-slider:focus-within { width: 84px; opacity: 1; }
.volume-slider input[type=range] {
    width: 76px; accent-color: var(--gold);
    cursor: pointer;
}

.speed-menu { position: relative; }
.speed-pop {
    position: absolute; bottom: 110%; right: 0;
    min-width: 110px;
    padding: 0.4rem;
    border-radius: 12px;
    background: rgba(9, 15, 29, 0.96);
    border: 1px solid var(--line-2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
}
.speed-pop.is-open { display: block; }
.speed-pop button {
    display: block; width: 100%;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem; text-align: left;
    color: var(--ink-2);
}
.speed-pop button:hover { background: rgba(255,255,255,0.08); color: #fff; }
.speed-pop button.is-active { color: var(--gold-soft); font-weight: 700; }

/* Native fallback mode (API channel dead): YouTube's own controls take over */
.player-stage.native-fallback { cursor: default !important; }
.player-stage.native-fallback iframe { pointer-events: auto !important; }

/* Fullscreen: keep stage styles */
.player-stage:fullscreen { border-radius: 0; border: none; padding-top: 0; }

/* ---------- 07. MODAL (shared + brochure gate) ---------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 1.25rem;
    background: rgba(2, 5, 12, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s var(--ease-out), visibility 0.3s;
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal {
    width: min(430px, 100%);
    max-height: calc(100svh - 3rem);
    overflow-y: auto;
    padding: 2.2rem 2.1rem;
    transform: translateY(18px) scale(0.97);
    transition: transform 0.35s var(--ease-out);
}
.modal-backdrop.is-open .modal { transform: translateY(0) scale(1); }
.modal-close {
    position: absolute; top: 0.9rem; right: 0.9rem;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--ink-3);
    background: rgba(255,255,255,0.05);
    transition: color var(--speed), background var(--speed);
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,0.12); }
.modal-close svg { width: 17px; height: 17px; }
.modal h3 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; margin-bottom: 0.4rem; }
.modal .m-sub { font-size: 0.9rem; color: var(--ink-3); margin-bottom: 1.5rem; }
.modal .btn { width: 100%; }
.modal-success { text-align: center; padding: 1rem 0; }
.modal-success .ms-icon {
    width: 64px; height: 64px; margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
}
.modal-success .ms-icon svg { width: 28px; height: 28px; }
/* Honeypot — visually hidden, still in the form for bots */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 08. RESPONSIVE ---------- */
@media (max-width: 1080px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.4s var(--ease-out);
        width: min(280px, 84vw);
    }
    .admin-sidebar.is-open { transform: translateX(0); }
    .admin-content { margin-left: 0; }
    .admin-menu-toggle {
        display: inline-flex; align-items: center; gap: 0.5rem;
        padding: 0.55rem 1rem;
        border-radius: 10px;
        background: var(--glass-2);
        border: 1px solid var(--line);
        color: var(--ink);
        font-size: 0.9rem;
    }
    .admin-menu-toggle svg { width: 18px; height: 18px; }
    .lesson-layout { grid-template-columns: 1fr; }
    .lesson-rail { position: static; max-height: none; }
}

@media (max-width: 640px) {
    .portal-main { padding-top: 5.6rem; padding-bottom: 3rem; }
    .portal-topbar { padding-block: 0.55rem; }
    .portal-topbar .brand-logo { height: 34px; }
    .portal-nav { gap: 0.1rem; }
    .portal-nav a, .portal-nav .portal-user, .portal-logout button { padding: 0.5rem 0.6rem; font-size: 0.88rem; }
    .portal-nav a span.hide-sm, .portal-user span.hide-sm, .portal-logout span.hide-sm { display: none; }
    .page-head { margin-bottom: 1.4rem; }
    .page-head h1 { font-size: 1.45rem; }
    .form-row { grid-template-columns: 1fr; }
    .panel { padding: 1.3rem 1.1rem; }
    .panel-head { margin-bottom: 1rem; }
    .panel-title { font-size: 1.12rem; }
    .auth-card { padding: 2rem 1.4rem; }
    .auth-card .auth-logo { height: 46px; }
    .course-grid { grid-template-columns: 1fr; gap: 1.1rem; }
    .course-card .cc-body { padding: 1.1rem 1.2rem 1.3rem; }
    .lesson-item { padding: 0.8rem 0.9rem; gap: 0.75rem; }
    .lesson-item .li-icon { width: 34px; height: 34px; }
    .lesson-item .li-title { font-size: 0.92rem; }
    .lesson-rail { padding: 1rem 0.9rem; }
    .data-table { font-size: 0.86rem; min-width: 560px; }
    .data-table th, .data-table td { padding: 0.7rem 0.8rem; }
    .filter-bar { gap: 0.6rem; }
    .filter-bar .field { min-width: 130px; }
    .player-time { display: none; }
    .pbtn { width: 38px; height: 38px; }
    .player-watermark { height: 22px; }
    .player-bigplay { width: 64px; height: 64px; }
    .player-bigplay svg { width: 26px; height: 26px; }
    .player-overlay .po-title { font-size: 1.05rem; }
    .player-controls { padding: 1.4rem 0.7rem 0.55rem; }
    .stat-row { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
    .stat-box { padding: 1.1rem 1.2rem; }
    .stat-box .s-value { font-size: 1.4rem; }
    .flash { padding: 0.85rem 1rem; font-size: 0.88rem; }
    .btn-lg { min-height: 52px; font-size: 0.98rem; }
    .modal { padding: 1.8rem 1.4rem; }
    .pager a, .pager span { min-width: 34px; height: 34px; font-size: 0.84rem; }
}

@media (max-width: 400px) {
    .portal-topbar .brand-logo { height: 30px; }
    .portal-nav a, .portal-nav .portal-user, .portal-logout button { padding: 0.45rem 0.45rem; }
    .page-head h1 { font-size: 1.3rem; }
    .stat-row { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
    .otp-input { letter-spacing: 0.6em; font-size: 1.3rem; }
}
