/* Student login / signup / forgot password / dashboard — matches the home page (index.php) colours & fonts */
:root {
    --ca-blue: #1c4c88;
    --ca-blue-2: #0066ff;
    --ca-text: #334155;
    --ca-muted: #64748b;
    --ca-bg: #f1f5f9;
    --ca-line: #e2e8f0;
    --ca-green: #16a34a;
}
body.auth-body { font-family: 'Inter', sans-serif; color: var(--ca-text); background: var(--ca-bg); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .auth-title { font-family: 'Plus Jakarta Sans', sans-serif; color: #0f172a; }

.auth-nav { background: var(--ca-blue); padding: 10px 0; position: sticky; top: 0; z-index: 10; }
.auth-logo img { height: 38px; width: auto; max-width: 52vw; object-fit: contain; display: block; }
.auth-logo { color: #fff; font-weight: 700; text-decoration: none; }
.auth-nav-icon, .auth-nav-btn { color: #fff; text-decoration: none; border-radius: 10px; background: rgba(255,255,255,.12); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: .9rem; }
.auth-nav-icon { width: 40px; height: 40px; }
.auth-nav-btn { height: 40px; padding: 0 14px; }
.auth-nav-icon:hover, .auth-nav-btn:hover { background: #fff; color: var(--ca-blue); }

.auth-main { flex: 1; padding: 36px 0 48px; }
.auth-card-wrap { max-width: 460px; margin: 0 auto; }
.auth-wide { max-width: 960px; margin: 0 auto; }
.auth-card { background: #fff; border: 1px solid var(--ca-line); border-radius: 16px; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); padding: 28px 26px; }
.auth-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.auth-sub { color: var(--ca-muted); font-size: .92rem; margin-bottom: 20px; }
.auth-alert { border-radius: 12px; font-size: .92rem; }

.auth-card .form-label { font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.auth-card .form-control { border-radius: 10px; padding: 11px 13px; border-color: #cbd5e1; }
.auth-card .form-control:focus { border-color: var(--ca-blue-2); box-shadow: 0 0 0 .2rem rgba(0, 102, 255, .12); }
.auth-card .input-group > .btn { border-color: #cbd5e1; border-radius: 0 10px 10px 0; }
.auth-card .input-group > .form-control { border-radius: 10px 0 0 10px; }
.auth-card .input-group-text { border-radius: 10px 0 0 10px; background: #f8fafc; border-color: #cbd5e1; font-weight: 600; }
.auth-card .input-group-text + .form-control { border-radius: 0 10px 10px 0; }
.auth-otp { font-size: 1.5rem; letter-spacing: .6em; text-align: center; font-weight: 700; }

.btn-ca { background: var(--ca-blue-2); border: 0; color: #fff; font-weight: 700; border-radius: 10px; padding: 12px; width: 100%; }
.btn-ca:hover, .btn-ca:focus { background: #0052cc; color: #fff; }
.btn-ca:disabled { opacity: .7; }
.btn-ca-outline { border: 1.5px solid var(--ca-line); background: #fff; color: var(--ca-text); font-weight: 600; border-radius: 10px; padding: 11px; width: 100%; }
.btn-ca-outline:hover { border-color: var(--ca-blue-2); color: var(--ca-blue-2); }
.btn-link-ca { background: none; border: 0; padding: 0; color: var(--ca-blue-2); font-weight: 600; text-decoration: none; font-size: .9rem; }
.btn-link-ca:hover { text-decoration: underline; }
.btn-link-ca:disabled { color: var(--ca-muted); text-decoration: none; }

/* Student / Parent tabs */
.auth-role { display: flex; background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-role a, .auth-role span { flex: 1; text-align: center; padding: 9px; border-radius: 9px; font-weight: 600; font-size: .92rem; color: var(--ca-muted); text-decoration: none; }
.auth-role .active { background: #fff; color: var(--ca-blue); box-shadow: 0 2px 6px rgba(15, 23, 42, .08); }
.auth-role .soon { cursor: not-allowed; }
.auth-role .soon small { font-size: .7rem; background: #fef3c7; color: #92400e; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }

/* Password / OTP switch */
.auth-mode { display: flex; gap: 18px; border-bottom: 1px solid var(--ca-line); margin-bottom: 18px; }
.auth-mode a { padding: 8px 0; color: var(--ca-muted); font-weight: 600; font-size: .92rem; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.auth-mode a.active { color: var(--ca-blue-2); border-bottom-color: var(--ca-blue-2); }

.auth-divider { text-align: center; color: var(--ca-muted); font-size: .88rem; margin-top: 18px; }
.auth-divider a { color: var(--ca-blue-2); font-weight: 600; text-decoration: none; }
.auth-sent { background: #eff6ff; border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* account picker */
.auth-account { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--ca-line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.auth-account:has(input:checked) { border-color: var(--ca-blue-2); background: #f5f9ff; }
.auth-account input { accent-color: var(--ca-blue-2); width: 18px; height: 18px; flex: 0 0 auto; }
.auth-account-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.auth-account-name { font-weight: 700; }
.auth-account-meta { color: var(--ca-muted); font-size: .82rem; overflow-wrap: anywhere; }
.auth-account-badge { font-size: .75rem; font-weight: 700; border-radius: 20px; padding: 3px 10px; background: #f1f5f9; color: var(--ca-muted); white-space: nowrap; }
.auth-account-badge.has { background: #dcfce7; color: var(--ca-green); }

/* dashboard */
.dash-hello { background: linear-gradient(120deg, var(--ca-blue), #2563eb); color: #fff; border-radius: 18px; padding: 26px; margin-bottom: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.dash-hello h1 { color: #fff; font-size: 1.6rem; margin: 0 0 4px; }
.dash-hello p { margin: 0; opacity: .85; }
.dash-avatar { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; flex: 0 0 58px; }
.dash-tile { background: #fff; border: 1px solid var(--ca-line); border-radius: 16px; padding: 20px; height: 100%; }
.dash-tile i.dash-ico { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: 12px; }
.dash-tile h3 { font-size: 1.05rem; margin-bottom: 4px; }
.dash-tile p { color: var(--ca-muted); font-size: .88rem; margin: 0; }
.dash-soon { font-size: .7rem; font-weight: 700; background: #fef3c7; color: #92400e; border-radius: 6px; padding: 2px 7px; margin-left: 6px; vertical-align: middle; }
.dash-info dt { font-size: .78rem; color: var(--ca-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.dash-info dd { font-weight: 600; margin-bottom: 12px; word-break: break-all; }

.auth-footer { text-align: center; color: var(--ca-muted); font-size: .85rem; padding: 18px 12px; }
.auth-footer a { color: inherit; }

@media (max-width: 480px) {
    .auth-main { padding: 20px 0 32px; }
    .auth-card { padding: 22px 18px; border-radius: 14px; }
    .dash-hello { padding: 20px; }
    .auth-logo img { height: 30px; }
    .auth-nav-icon, .auth-nav-btn { height: 36px; }
    .auth-nav-icon { width: 36px; }
}

/* My Courses (courses.php) */
.cr-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .88rem; color: var(--ca-muted); margin-bottom: 16px; }
.cr-crumb a { color: var(--ca-blue-2); text-decoration: none; font-weight: 600; }
.cr-crumb .fa-chevron-right { font-size: .65rem; }
.cr-crumb span { color: var(--ca-text); font-weight: 600; }
.cr-section { font-size: 1.05rem; font-weight: 800; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.cr-section span { font-size: .75rem; background: #e2e8f0; color: var(--ca-text); border-radius: 20px; padding: 2px 9px; }
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cr-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ca-line); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ca-text); transition: transform .15s, box-shadow .15s; }
.cr-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, .1); color: var(--ca-text); }
.cr-card-thumb { aspect-ratio: 16 / 9; background: #eef2ff; position: relative; overflow: hidden; }
.cr-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-card-body { padding: 14px 16px 8px; flex: 1; }
.cr-card-body h3 { font-size: 1.02rem; font-weight: 800; margin-bottom: 8px; }
.cr-card-go { padding: 10px 16px 14px; color: var(--ca-blue-2); font-weight: 700; font-size: .88rem; }
.cr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cr-chip { font-size: .74rem; font-weight: 600; background: #f1f5f9; color: var(--ca-text); border-radius: 20px; padding: 3px 9px; }
.cr-valid { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--ca-green); background: #dcfce7; border-radius: 6px; padding: 2px 8px; }
.cr-valid.soon { color: #92400e; background: #fef3c7; }
.cr-valid.off { color: #a3271a; background: #fde3e0; }
.is-off .cr-card-thumb, .is-off .cr-row-thumb { filter: grayscale(1); opacity: .7; }
.cr-head { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--ca-line); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.cr-head-thumb { width: 120px; flex: 0 0 120px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #eef2ff; position: relative; }
.cr-head-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cr-list { display: flex; flex-direction: column; gap: 10px; }
.cr-row { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--ca-line); border-radius: 14px; padding: 12px; }
.cr-row-thumb { width: 96px; flex: 0 0 96px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #eef2ff; position: relative; }
.cr-row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-row-body { flex: 1; min-width: 0; }
.cr-row-body h3 { font-size: .98rem; font-weight: 700; margin: 2px 0 6px; }
.cr-type { font-size: .72rem; font-weight: 700; color: var(--ca-blue-2); text-transform: uppercase; letter-spacing: .03em; }
.cr-row-soon { font-size: .74rem; font-weight: 700; background: #fef3c7; color: #92400e; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
/* no image: show the first letter */
.noimg::after { content: attr(data-initial); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 2rem; color: var(--ca-blue-2); background: linear-gradient(135deg, #e0edff, #f5f9ff); }
.cr-row-thumb.noimg::after { font-size: 1.4rem; }
@media (max-width: 480px) {
    .cr-row { flex-wrap: wrap; }
    .cr-row-soon { margin-left: 110px; }
    .cr-head-thumb { width: 84px; flex-basis: 84px; }
}
.dash-link { display: block; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.dash-link:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, .08); border-color: var(--ca-blue-2); color: inherit; }
.dash-go { font-size: .85rem; color: var(--ca-blue-2); margin-left: 4px; }
/* combos without images: icon + title */
.cr-combo-ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: #e0edff; color: var(--ca-blue-2); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.cr-card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cr-card-title h3 { margin: 0; }
.cr-card-body { padding-top: 18px; }

/* course content (course.php) */
.ct-app { display: flex; align-items: center; gap: 14px; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 14px; padding: 14px 16px; margin-bottom: 8px; font-size: .9rem; }
.ct-app > i { font-size: 1.6rem; color: var(--ca-blue-2); }
.ct-app span { color: var(--ca-muted); }
.ct-app > div { flex: 1; }
.ct-app-btn { width: auto; padding: 9px 16px; white-space: nowrap; }
.ct-list { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid var(--ca-line); border-radius: 14px; overflow: hidden; }
.ct-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #f1f5f9; }
.ct-item:last-child { border-bottom: 0; }
.ct-no { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: #f1f5f9; color: var(--ca-muted); font-size: .8rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ct-body { flex: 1; min-width: 0; }
.ct-name { font-weight: 600; color: #0f172a; }
.ct-meta { font-size: .8rem; color: var(--ca-muted); margin-top: 2px; }
.ct-dot { margin: 0 3px; }
.ct-tag { font-size: .72rem; font-weight: 700; border-radius: 6px; padding: 3px 8px; background: #f1f5f9; color: var(--ca-text); white-space: nowrap; }
.ct-tag.soon { background: #fef3c7; color: #92400e; }
a.cr-row { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.cr-row:hover { border-color: var(--ca-blue-2); box-shadow: 0 6px 18px rgba(15, 23, 42, .06); color: inherit; }
.cr-row-go { color: var(--ca-blue-2); font-size: .95rem; padding: 0 6px; }
@media (max-width: 480px) {
    .ct-app { flex-wrap: wrap; }
    .ct-app-btn { width: 100%; }
}
.ct-watch { display: inline-flex; align-items: center; gap: 6px; background: var(--ca-blue-2); color: #fff; font-size: .8rem; font-weight: 700; border-radius: 8px; padding: 6px 12px; text-decoration: none; white-space: nowrap; }
.ct-watch:hover { background: #0052cc; color: #fff; }

/* own video player (watch.php) */
.vp { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; user-select: none; -webkit-user-select: none; }
.vp:fullscreen { border-radius: 0; aspect-ratio: auto; }
.vp-frame, .vp-frame iframe, .vp-frame > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vp-shield { position: absolute; inset: 0 0 52px 0; z-index: 2; cursor: pointer; background: transparent; }
.vp-wm { position: absolute; z-index: 3; color: rgba(255,255,255,.35); font-size: .85rem; font-weight: 700; pointer-events: none; transition: left 1.5s ease, top 1.5s ease; text-shadow: 0 1px 2px rgba(0,0,0,.4); white-space: nowrap; }
.vp-cover { position: absolute; inset: 0 0 52px 0; z-index: 4; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #0b1220; color: #fff; text-align: center; padding: 16px; }
.vp-cover.on { display: flex; }
.vp-big { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--ca-blue-2); color: #fff; font-size: 1.6rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.vp-big:hover { background: #0052cc; }
.vp-msg { font-size: .9rem; opacity: .85; max-width: 420px; }
.vp-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: #0b1220; color: #fff; }
.vp-btn { background: none; border: 0; color: #fff; width: 34px; height: 34px; border-radius: 8px; font-size: .95rem; cursor: pointer; flex: 0 0 auto; }
.vp-btn:hover { background: rgba(255,255,255,.12); }
.vp-time { font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .9; }
.vp-seek { flex: 1; min-width: 60px; accent-color: var(--ca-blue-2); }
.vp-vol { width: 80px; accent-color: var(--ca-blue-2); }
.vp-speed { background: #1e293b; color: #fff; border: 0; border-radius: 6px; font-size: .78rem; padding: 4px; }
@media (max-width: 576px) {
    .vp { aspect-ratio: auto; height: 260px; }
    .vp-vol, #vpBack, #vpFwd { display: none; }
    .vp-speed { display: none; }
}

/* course page (step 3): tabs + item cards — added 15 Oct 2026 */
.cc-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; }
.cc-tabs { display: flex; gap: 6px; background: #e2e8f0; border-radius: 12px; padding: 4px; margin-bottom: 16px; overflow-x: auto; }
.cc-tab { flex: 1 0 auto; border: 0; background: none; border-radius: 9px; padding: 10px 14px; font-weight: 700; font-size: .9rem; color: var(--ca-muted); white-space: nowrap; }
.cc-tab span { display: inline-block; min-width: 22px; margin-left: 4px; border-radius: 20px; padding: 1px 7px; font-size: .75rem; background: rgba(15,23,42,.08); }
.cc-tab.on { background: #fff; color: var(--ca-blue); box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.cc-tab.on span { background: #e0edff; color: var(--ca-blue-2); }
.cc-pane[hidden] { display: none; }
.cc-item { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--ca-line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; transition: box-shadow .15s, border-color .15s; }
.cc-item:hover { border-color: #bfdbfe; box-shadow: 0 6px 18px rgba(15,23,42,.06); }
.cc-ico { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.cc-ico.vid { background: #fee2e2; color: #dc2626; }
.cc-ico.test { background: #ede9fe; color: #7c3aed; }
.cc-body { flex: 1; min-width: 0; }
.cc-name { font-weight: 700; color: #0f172a; line-height: 1.35; }
.cc-no { color: var(--ca-muted); font-weight: 600; }
.cc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; font-size: .82rem; color: var(--ca-muted); }
.cc-meta i { margin-right: 5px; color: #94a3b8; }
.cc-meta .tag { background: #f1f5f9; color: var(--ca-text); border-radius: 6px; padding: 1px 8px; font-weight: 700; font-size: .72rem; }
.cc-meta .warn { color: #c2410c; } .cc-meta .warn i { color: #ea580c; }
.cc-meta .ok { color: #15803d; } .cc-meta .ok i { color: #16a34a; }
.cc-act { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.cc-btn { width: auto; padding: 8px 16px; font-size: .88rem; white-space: nowrap; }
.cc-score { font-size: .9rem; color: var(--ca-muted); } .cc-score b { color: #0f172a; font-size: 1.05rem; }
.cc-empty { text-align: center; color: var(--ca-muted); background: #fff; border: 1px dashed var(--ca-line); border-radius: 14px; padding: 36px 16px; }
.cc-empty i { display: block; font-size: 1.6rem; margin-bottom: 8px; color: #cbd5e1; }
.cc-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cc-book { display: flex; gap: 14px; background: #fff; border: 1px solid var(--ca-line); border-radius: 14px; padding: 14px; }
.cc-cover { flex: 0 0 auto; width: 58px; height: 76px; border-radius: 8px; background: linear-gradient(135deg, #1c4c88, #0066ff); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: 0 4px 10px rgba(28,76,136,.25); }
@media (max-width: 575.98px) {
    .cc-item { flex-wrap: wrap; }
    .cc-act { width: 100%; justify-content: flex-end; padding-left: 58px; }
}

/* e-book reader */
.rd-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: 1px solid var(--ca-line); border-radius: 12px; padding: 8px 10px; margin-bottom: 10px; }
.rd-bar .rd-title { flex: 1; min-width: 140px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-btn { border: 1px solid var(--ca-line); background: #fff; border-radius: 9px; height: 36px; min-width: 36px; padding: 0 10px; color: var(--ca-text); font-weight: 600; font-size: .85rem; }
.rd-btn:hover { border-color: var(--ca-blue-2); color: var(--ca-blue-2); }
.rd-sel { height: 36px; border: 1px solid var(--ca-line); border-radius: 9px; max-width: 220px; font-size: .85rem; padding: 0 8px; }
.rd-stage { position: relative; background: #fff; border: 1px solid var(--ca-line); border-radius: 12px; height: calc(100vh - 220px); min-height: 420px; overflow: hidden; user-select: none; -webkit-user-select: none; }
.rd-stage.pdf { overflow-y: auto; background: #e2e8f0; padding: 12px 0; }
.rd-stage canvas { display: block; margin: 0 auto 12px; box-shadow: 0 2px 10px rgba(15,23,42,.15); background: #fff; max-width: 100%; }
#rdEpub { height: 100%; }
.rd-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ca-muted); background: #fff; z-index: 3; text-align: center; padding: 20px; }
.rd-msg[hidden] { display: none; }
.rd-wm { position: absolute; z-index: 2; pointer-events: none; color: rgba(15,23,42,.08); font-weight: 800; font-size: 1.1rem; transform: rotate(-20deg); white-space: nowrap; transition: left 2s, top 2s; }
.rd-stage:fullscreen { height: 100vh; border-radius: 0; }
.rd-pos { font-size: .82rem; color: var(--ca-muted); white-space: nowrap; }
.cr-part { display: block; margin-top: 3px; font-size: .78rem; color: var(--ca-muted); }
.cr-part i { margin-right: 4px; color: #94a3b8; }
