/* =========================================================================
   Haji School – Design System (theme.css)
   Tokens are overridden at runtime by core.js from the admin settings.
   ========================================================================= */

/* Default palette (overridden at runtime from the admin settings by core.js) */
:root {
    --primary: #e8a33d;
    --primary-2: #d4902b;
    --primary-rgb: 232, 163, 61;
    --on-primary: #14162e;
    --accent: #e8654f;
    --accent-rgb: 232, 101, 79;
    --success: #2fbf9f;
    --danger: #e8654f;
    --warning: #e8a33d;
    --info: #4b8bf0;
    --violet: #8b7ffb;

    --bg: #faf7ef;
    --bg-2: #f1ecdd;
    --surface: #ffffff;
    --surface-rgb: 255, 255, 255;
    --surface-2: #f3f0e6;
    --text: #181a2b;
    --muted: #4d5170;
    --border: #e7e3d3;
    --link: #161a45;

    --light-bg: #faf7ef; --light-surface: #ffffff; --light-text: #181a2b; --light-muted: #4d5170; --light-border: #e7e3d3;
    --dark-bg: #0f1130; --dark-bg-rgb: 15, 17, 48; --dark-surface: #161a45; --dark-text: #f1ecdd; --dark-muted: #a7abcf; --dark-border: #2c3277;

    --radius: 18px;
    --radius-sm: 11px;
    --radius-lg: 28px;

    --shadow-sm: 0 1px 2px rgba(20, 22, 50, .05), 0 2px 6px rgba(20, 22, 50, .06);
    --shadow: 0 14px 34px -14px rgba(20, 22, 50, .22);
    --shadow-lg: 0 26px 50px -20px rgba(20, 22, 50, .35);
    --glow: 0 10px 30px -8px rgba(var(--primary-rgb), .6);

    --font-fa: 'Vazirmatn', Tahoma, sans-serif;
    --font-en: 'Inter Variable', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Lalezar', 'Vazirmatn', Tahoma, sans-serif;
    --font-display-weight: 400;

    --ease: cubic-bezier(.4, 0, .2, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --header-h: 74px;
    --container: 1200px;
}

[data-theme="dark"] {
    --bg: #0f1130;
    --bg-2: #0b0d26;
    --surface: #161a45;
    --surface-rgb: 22, 26, 69;
    --surface-2: #1d2254;
    --text: #f1ecdd;
    --muted: #a7abcf;
    --border: #2c3277;
    --link: #f4c877;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .3);
    --shadow: 0 14px 34px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 26px 50px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-en);
    font-size: 15px;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color .35s var(--ease), color .35s var(--ease);
}
html[lang="fa"] body { font-family: var(--font-fa); }
html[dir="rtl"] { direction: rtl; }
main { flex: 1; }
a { color: var(--link); text-decoration: none; }
.display, .display h1, .display h2 { font-family: var(--font-display); font-weight: var(--font-display-weight); letter-spacing: .01em; }
html[lang="en"] .display, html[lang="en"] .display h1, html[lang="en"] .display h2 { font-family: var(--font-en); font-weight: 900; letter-spacing: -.02em; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; font-weight: 800; }
p { margin: 0 0 1em; }
::selection { background: rgba(var(--primary-rgb), .25); }

body.page-enter { animation: pageIn .5s var(--ease) both; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: 40px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; margin: 0; }
.section-head p { margin: 0; color: var(--muted); }

/* ------------------------------------------------------------- header */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(var(--dark-bg-rgb), .88);
    color: var(--dark-text);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    transition: box-shadow .3s;
}
.site-header.scrolled { box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .6); }
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 18px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: 24px; color: inherit; letter-spacing: .02em; line-height: 1; }
html[lang="en"] .logo { font-family: var(--font-en); font-weight: 900; font-size: 20px; letter-spacing: -.02em; }
.logo em { font-style: normal; color: var(--primary); }
.logo-mark {
    width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--on-primary);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: var(--glow); transition: transform .4s var(--spring), border-radius .4s var(--ease);
}
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); border-radius: 50%; }
.logo-mark svg { width: 20px; height: 20px; }
.logo-mark .logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.logo-mark:has(.logo-img) { background: transparent; box-shadow: none; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; color: var(--dark-text); opacity: .82; font-weight: 600; font-size: 14.5px; transition: opacity .2s, background .25s, color .2s; }
.nav-links a:hover, .nav-links a.active { opacity: 1; color: #f4c877; background: rgba(255, 255, 255, .06); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-login { color: var(--dark-text); font-weight: 700; font-size: 14.5px; padding: 8px 12px; opacity: .9; }
.nav-login:hover { color: #f4c877; opacity: 1; }

.icon-btn {
    width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
    transition: transform .3s var(--spring), border-radius .3s, border-color .2s, background .25s, color .2s;
}
.icon-btn:hover { border-radius: 50%; border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.icon-btn svg { width: 20px; height: 20px; }
.site-header .icon-btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: var(--dark-text); }
.site-header .icon-btn:hover { border-color: var(--primary); color: #f4c877; }
.lang-btn { width: auto; padding: 0 12px; font-weight: 800; font-size: 13px; letter-spacing: .04em; }

.theme-toggle svg { position: absolute; transition: transform .5s var(--spring), opacity .3s; }
.theme-toggle .moon { opacity: 0; transform: rotate(-90deg) scale(.4); }
[data-theme="dark"] .theme-toggle .sun { opacity: 0; transform: rotate(90deg) scale(.4); }
[data-theme="dark"] .theme-toggle .moon { opacity: 1; transform: rotate(0) scale(1); }

.user-menu { position: relative; }
.avatar-btn { width: 42px; height: 42px; border-radius: 50%; padding: 2px; border: 2px solid transparent; background: linear-gradient(var(--dark-surface), var(--dark-surface)) padding-box, linear-gradient(135deg, var(--primary), var(--accent)) border-box; overflow: hidden; transition: transform .3s var(--spring); }
.avatar-btn:hover { transform: scale(1.08); }
.avatar-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.dropdown {
    position: absolute; top: calc(100% + 10px); inset-inline-end: 0; min-width: 220px; padding: 8px; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.97); transform-origin: top; transition: all .25s var(--ease); z-index: 50;
}
.dropdown.open { opacity: 1; visibility: visible; transform: none; }
.dropdown .dd-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown .dd-head b { display: block; font-size: 14px; }
.dropdown .dd-head span { font-size: 12px; color: var(--muted); }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 600; text-align: start; transition: background .2s, color .2s; }
.dropdown a:hover, .dropdown button:hover { background: rgba(var(--primary-rgb), .12); color: var(--text); }
.dropdown .danger:hover { background: rgba(232, 101, 79, .12); color: var(--danger); }
.dropdown svg { width: 18px; height: 18px; }

.burger { display: none; flex-direction: column; gap: 5px; }
.burger span { width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.drawer {
    position: fixed; top: var(--header-h); left: 0; right: 0; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
    background: var(--dark-bg); color: var(--dark-text); z-index: 99; padding: 20px 20px 40px;
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .3s var(--ease); display: flex; flex-direction: column; gap: 6px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
body:has(.drawer.open) { overflow: hidden; }
.drawer.open { transform: none; opacity: 1; visibility: visible; }
.drawer a, .drawer button { padding: 14px 16px; border-radius: 12px; font-weight: 700; color: var(--dark-text); border: 0; background: rgba(255, 255, 255, .06); text-align: start; display: flex; gap: 10px; align-items: center; }
.drawer a:hover { color: #f4c877; }
.drawer svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------ buttons */
.btn {
    position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 14.5px;
    line-height: 1.2; white-space: nowrap; user-select: none; text-decoration: none; cursor: pointer;
    transition: transform .3s var(--spring), border-radius .35s var(--ease), box-shadow .3s, background-color .25s, color .25s, border-color .25s, background-position .5s;
}
.btn:hover { border-radius: var(--radius-sm); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary {
    color: var(--on-primary); background-image: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%); background-size: 160% 160%;
    box-shadow: var(--glow);
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 16px 34px -10px rgba(var(--primary-rgb), .7); }
.btn-primary::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    transform: translateX(-130%); transition: transform .7s var(--ease);
}
.btn-primary:hover::after { transform: translateX(130%); }
html[dir="rtl"] .btn-primary::after { transform: translateX(130%); }
html[dir="rtl"] .btn-primary:hover::after { transform: translateX(-130%); }
.btn-accent { color: #fff; background-image: linear-gradient(135deg, var(--accent), #c9503c); box-shadow: 0 10px 26px -8px rgba(var(--accent-rgb), .6); }
.btn-soft { color: var(--text); background: rgba(var(--primary-rgb), .16); }
.btn-soft:hover { background: rgba(var(--primary-rgb), .18); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: rgba(var(--primary-rgb), .06); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-danger:hover { box-shadow: 0 10px 24px -8px rgba(232, 101, 79, .6); }
.btn-success { color: #fff; background: var(--success); }
.btn-dark { color: var(--dark-text); background: var(--dark-bg); border-color: var(--dark-bg); }
.btn-dark:hover { box-shadow: 0 14px 28px -10px rgba(var(--dark-bg-rgb), .6); }
.btn-outline-light { background: transparent; color: var(--dark-text); border-color: rgba(255, 255, 255, .25); }
.btn-outline-light:hover { border-color: var(--primary); color: #f4c877; }
.btn-icon { border-radius: 12px; }
.btn-icon:hover { border-radius: 50%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.btn.is-loading::before { content: ""; width: 16px; height: 16px; border: 2px solid rgba(128, 128, 128, .35); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
.ripple-ink { position: absolute; border-radius: 50%; transform: scale(0); animation: ripple .6s linear; background: rgba(255, 255, 255, .4); pointer-events: none; }
.btn-ghost .ripple-ink, .btn-soft .ripple-ink { background: rgba(var(--primary-rgb), .25); }

/* --------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.course-card {
    display: flex; flex-direction: column; overflow: hidden; color: inherit; position: relative;
    transition: transform .4s var(--spring), box-shadow .4s, border-color .3s;
}
.course-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(var(--primary-rgb), .4); }
.course-card .cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, rgba(var(--primary-rgb), .25), rgba(var(--accent-rgb), .25)); }
.course-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.course-card:hover .cover img { transform: scale(1.07); }
.course-card .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent 55%); opacity: 0; transition: opacity .35s; }
.course-card:hover .cover::after { opacity: 1; }
.course-card .badges { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; z-index: 1; }
.course-card .play-hint { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; opacity: 0; transform: scale(.7); transition: all .35s var(--spring); }
.course-card:hover .play-hint { opacity: 1; transform: none; }
.course-card .play-hint span { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; box-shadow: var(--shadow); }
.course-card .play-hint svg { width: 22px; height: 22px; margin-inline-start: 3px; }
.course-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-card .cat { font-size: 12px; color: var(--muted); font-weight: 700; }
.course-card .title { font-size: 15px; font-weight: 800; line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 46px; }
.course-card .thumb-tag { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1; background: rgba(15, 17, 48, .72); backdrop-filter: blur(6px); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.course-card .instructor { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.course-card .instructor .av { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; }
.course-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.course-card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-card .meta svg { width: 14px; height: 14px; }
.course-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--border); }
.price { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.price small { font-size: 11px; font-weight: 600; color: var(--muted); }
.price .old { text-decoration: line-through; color: var(--muted); font-size: 12px; font-weight: 500; }
.price .free { color: #1f9f84; }
[data-theme="dark"] .price .free { color: var(--success); }
.progress { height: 6px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .6s var(--ease); }

/* -------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.6; background: var(--surface-2); color: var(--text); }
.badge-primary { background: rgba(var(--primary-rgb), .18); color: var(--text); }
.badge-accent { background: var(--accent); color: #fff; }
.badge-success { background: rgba(16, 185, 129, .15); color: #059669; }
.badge-danger { background: rgba(239, 68, 68, .14); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, .16); color: #b45309; }
.badge-info { background: rgba(59, 130, 246, .14); color: #2563eb; }
[data-theme="dark"] .badge-success { color: #34d399; }
[data-theme="dark"] .badge-warning { color: #fbbf24; }
[data-theme="dark"] .badge-info { color: #60a5fa; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--muted);
    transition: all .3s var(--spring); display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.chip.active { background: var(--dark-bg); color: var(--dark-text); border-color: transparent; box-shadow: var(--shadow); }
[data-theme="dark"] .chip.active { background: var(--primary); color: var(--on-primary); }
.chip .count { font-size: 11px; opacity: .8; }

/* --------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 700; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select, .select {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
    font-size: 14px; outline: none; transition: border-color .2s, box-shadow .3s, transform .2s;
}
.input:focus, .field input:focus, .field textarea:focus, .field select:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), .15); }
.field textarea { min-height: 110px; resize: vertical; }
.field input[dir="ltr"] { text-align: start; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { flex: 1; min-width: 0; border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group .btn { border-start-start-radius: 0; border-end-start-radius: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
html[dir="rtl"] .input-group .btn { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn:hover { transform: none; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px !important; padding-left: 14px !important; }
.pw-wrap .pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; }
.pw-wrap .pw-eye:hover { color: var(--primary); }
.pw-wrap .pw-eye svg { width: 18px; height: 18px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 44px; height: 24px; border-radius: 999px; background: var(--border); position: relative; transition: background .3s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .3s var(--spring); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(20px); }
html[dir="rtl"] .switch input:checked + i::after { transform: translateX(-20px); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-msg { font-size: 13px; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; display: none; }
.form-msg.show { display: block; animation: fadeUp .3s var(--ease); }
.form-msg.error { background: rgba(239, 68, 68, .1); color: var(--danger); }
.form-msg.success { background: rgba(16, 185, 129, .12); color: #059669; }
[data-theme="dark"] .form-msg.success { color: #34d399; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 12px 18px; border: 0; background: none; font-weight: 700; color: var(--muted); white-space: nowrap; transition: color .2s; display: inline-flex; align-items: center; gap: 8px; }
.tab svg { width: 17px; height: 17px; }
.tab::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -2px; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transform: scaleX(0); transition: transform .35s var(--spring); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--link); }
.tab.active::after { transform: scaleX(1); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .4s var(--ease); }
.tabs.pill { border: 0; background: var(--surface-2); padding: 5px; border-radius: 999px; gap: 0; }
.tabs.pill .tab { border-radius: 999px; padding: 10px 18px; }
.tabs.pill .tab::after { display: none; }
.tabs.pill .tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 800; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(var(--primary-rgb), .04); }

/* ------------------------------------------------------- modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: all .25s; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-lg); transform: translateY(20px) scale(.96); transition: transform .35s var(--spring); }
.modal-backdrop.open .modal { transform: none; }
.modal h3 { margin-bottom: 8px; font-size: 18px; }
.modal p { color: var(--muted); font-size: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; animation: toastIn .4s var(--spring); border-inline-start: 4px solid var(--info); }
.toast.success { border-inline-start-color: var(--success); }
.toast.error { border-inline-start-color: var(--danger); }
.toast.warning { border-inline-start-color: var(--warning); }
.toast.hide { animation: toastOut .3s var(--ease) forwards; }
.toast svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.warning svg { color: var(--warning); }
.toast.info svg { color: var(--info); }

/* ------------------------------------------------------------ skeleton */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(var(--surface-rgb), .6), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
.sk-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.sk-card .sk-cover { aspect-ratio: 16 / 9; border-radius: 0; }
.sk-card .sk-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sk-line { height: 12px; }

/* ------------------------------------------------------------ helpers */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 64px; height: 64px; opacity: .35; margin: 0 auto 12px; display: block; }
.empty h3 { color: var(--text); font-size: 18px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.ltr { direction: ltr; unicode-bidi: embed; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.icon { width: 18px; height: 18px; }
.gradient-text { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* -------------------------------------------------------------- footer */
.site-footer { margin-top: 70px; background: var(--dark-bg); color: var(--dark-muted); padding: 66px 0 26px; }
.site-footer .logo { color: var(--dark-text); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 46px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.footer-brand p { font-size: 14px; color: var(--dark-muted); max-width: 300px; margin: 18px 0 22px; line-height: 1.8; }
.foot-social { display: flex; gap: 10px; }
.foot-social a { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14); display: inline-flex; align-items: center; justify-content: center; color: var(--dark-text); transition: all .3s var(--spring); }
.foot-social a:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); transform: translateY(-3px) rotate(-6deg); }
.foot-social svg { width: 17px; height: 17px; }
.foot-col h5 { color: var(--dark-text); font-size: 14.5px; margin: 0 0 18px; font-weight: 800; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.foot-col a { color: var(--dark-muted); transition: color .2s; }
.foot-col a:hover { color: #f4c877; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 24px; font-size: 13px; color: #7f83ac; }
#footerSeal:empty { display: none; }
#footerSeal img { height: 64px; }

/* ---------------------------------------------------------- animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(30px, -40px) scale(1.08); } 66% { transform: translate(-20px, 20px) scale(.95); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), .5); } 70% { box-shadow: 0 0 0 16px rgba(var(--primary-rgb), 0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------------------------------------------------------- responsive */
@media (max-width: 980px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    :root { --header-h: 64px; }
    .nav-links { display: none; }
    .burger { display: inline-flex; }
    .nav-actions .btn, .nav-login { display: none; }
    .course-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
    .form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 22px; padding-top: 32px; }
    .section-head h2 { font-size: 20px; }
    .toasts { inset-inline: 16px; bottom: 16px; max-width: none; }
}
@media (max-width: 480px) {
    .course-grid { grid-template-columns: 1fr; }
    .container { padding-inline: 14px; }
}
