/* ============================================================
   LEDJANA TRAINING — Core CSS Framework
   Dark, premium fitness SaaS. Animations use transform/opacity
   only (GPU-accelerated) to hold 60fps on mobile.
   ============================================================ */

/* ---------- 1. Design Tokens ---------- */
:root {
    /* surface palette (dark dominant) */
    --bg-0: #07080c;
    --bg-1: #0d0f16;
    --bg-2: #141826;
    --bg-3: #1c2233;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.09);

    /* energetic accents */
    --accent: #c6ff3a;          /* neon lime */
    --accent-2: #ff6b2c;        /* electric orange */
    --accent-glow: rgba(198, 255, 58, 0.35);
    --danger: #ff4d4d;

    /* text */
    --text: #f3f5f8;
    --muted: #8a93a6;

    /* type */
    --font: 'Outfit', system-ui, -apple-system, "Segoe UI", sans-serif;

    /* spacing / radius */
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-pill: 999px;
    --container: 1200px;

    /* motion */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast: 0.18s;
    --t-med: 0.35s;
    --t-slow: 0.6s;

    --shadow-card: 0 18px 50px -20px rgba(0, 0, 0, 0.8);
}

/* ---------- 2. Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: radial-gradient(1200px 700px at 70% -10%, #16203a 0%, var(--bg-0) 55%) fixed;
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; }

.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }
.muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.eyebrow {
    text-transform: uppercase; letter-spacing: 0.18em;
    font-size: 0.72rem; font-weight: 700; color: var(--accent);
}

/* ---------- 3. Buttons (+ magnetic micro-interaction) ---------- */
.btn {
    --pad: 0.7rem 1.3rem;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: var(--pad);
    border: 1px solid transparent; border-radius: var(--r-pill);
    font-weight: 700; font-size: 0.95rem;
    transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast);
    will-change: transform;
}
.btn:active { transform: scale(0.96); }
.btn-sm { --pad: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-lg { --pad: 0.95rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-accent {
    background: var(--accent); color: #0a0d05;
    box-shadow: 0 8px 24px -8px var(--accent-glow);
}
.btn-accent:hover { box-shadow: 0 12px 34px -8px var(--accent-glow); transform: translateY(-2px); }

.btn-outline { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }

/* magnetic buttons get a subtle transform driven by JS via --mx/--my */
.btn-magnetic { transform: translate(var(--mx, 0), var(--my, 0)); }

/* ---------- 4. Header / Nav ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(7, 8, 12, 0.6);
    border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 0; }
.brand { font-weight: 900; letter-spacing: -0.03em; font-size: 1.15rem; }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.inline-form { display: inline; }

/* animated underline reveal on nav links */
.nav-link { position: relative; color: var(--muted); font-weight: 600; transition: color var(--t-fast); }
.nav-link::after {
    content: ''; position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform var(--t-med) var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); }

/* ---------- 5. Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 7rem) 0; }
.hero-glow {
    position: absolute; inset: -20% 30% auto -10%; height: 520px;
    background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
    filter: blur(20px); opacity: 0.5; pointer-events: none;
    animation: float 9s var(--ease) infinite alternate;
}
.hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.hero-title { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 900; margin: 1rem 0; }
.hero-sub { color: var(--muted); font-size: 1.15rem; max-width: 46ch; margin-bottom: 1.8rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2.2rem; margin-top: 2.6rem; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.6rem; color: var(--accent); }
.hero-stats span { color: var(--muted); font-size: 0.85rem; }

.hero-visual { display: grid; place-items: center; }
.hero-card {
    width: 100%; max-width: 360px; padding: 1.6rem;
    background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
    border: 1px solid var(--border); border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
}
.hero-card-bar { height: 10px; border-radius: var(--r-pill); background: var(--bg-3); overflow: hidden; }
.hero-card-bar span { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; }
.hero-card-label { color: var(--muted); margin: 0.9rem 0 0.3rem; font-size: 0.85rem; }
.hero-card h3 { font-size: 1.5rem; }

/* ---------- 6. Sections / Program grid ---------- */
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section-head { text-align: center; margin-bottom: 2.6rem; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.section-head p { color: var(--muted); margin-top: 0.6rem; }

.program-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.6rem; }

.program-card, .enroll-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); overflow: hidden;
    transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med);
    will-change: transform;
}
.program-card:hover, .enroll-card:hover {
    transform: translateY(-8px); border-color: var(--accent);
    box-shadow: var(--shadow-card);
}
.program-cover, .enroll-cover {
    aspect-ratio: 16 / 10; background: var(--bg-3) center/cover no-repeat;
    position: relative;
}
.badge {
    position: absolute; top: 12px; left: 12px;
    background: rgba(0,0,0,0.6); color: var(--accent);
    padding: 0.3rem 0.7rem; border-radius: var(--r-pill);
    font-size: 0.72rem; font-weight: 700; backdrop-filter: blur(6px);
}
.program-body, .enroll-body { padding: 1.3rem; }
.program-title { font-size: 1.25rem; }
.program-desc { color: var(--muted); font-size: 0.92rem; margin: 0.5rem 0 1.1rem; }
.program-foot { display: flex; align-items: center; justify-content: space-between; }
.price { font-size: 1.4rem; font-weight: 800; color: var(--accent); }

/* ---------- 7. Progress bars (animate on load) ---------- */
.progress { height: 8px; background: var(--bg-3); border-radius: var(--r-pill); overflow: hidden; }
.progress-fill {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: inherit;
    transition: width 1.1s var(--ease-out);
}

/* ---------- 8. Dashboard ---------- */
.dash { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; padding: 2.4rem 0 4rem; }
.dash-sidebar {
    align-self: start; position: sticky; top: 90px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 1.3rem;
}
.dash-user { display: flex; gap: 0.8rem; align-items: center; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.avatar {
    width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0a0d05; font-weight: 800;
}
.dash-user span { display: block; color: var(--muted); font-size: 0.8rem; }
.dash-nav { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.dash-nav-link {
    display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.7rem;
    border-radius: var(--r-sm); color: var(--muted); font-weight: 600;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.dash-nav-link:hover { background: var(--surface-2); color: var(--text); transform: translateX(3px); }
.dash-nav-link.is-active { background: var(--surface-2); color: var(--accent); }
.dash-nav-link .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.dash-head h1 { font-size: 2rem; }
.dash-head p { color: var(--muted); }
.dash-section-title { margin: 2rem 0 1.1rem; font-size: 1.3rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

.continue-card {
    display: flex; align-items: center; gap: 1.2rem; margin-top: 1.6rem;
    padding: 1.2rem 1.4rem; border-radius: var(--r-lg);
    background: linear-gradient(120deg, rgba(198,255,58,0.12), rgba(255,107,44,0.08));
    border: 1px solid var(--border);
    transition: transform var(--t-med) var(--ease), border-color var(--t-med);
}
.continue-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.continue-icon {
    width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent); color: #0a0d05; font-size: 1.2rem;
}
.continue-meta { flex: 1; }
.continue-meta h3 { font-size: 1.2rem; margin: 0.15rem 0; }
.continue-go { color: var(--accent); font-weight: 700; }

.enroll-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 0.9rem; gap: 0.6rem; }
.enroll-body h3 { margin-bottom: 0.8rem; font-size: 1.15rem; }

/* ---------- 9. LMS Video Viewer (split screen) ---------- */
.lms-body { background: var(--bg-0); }
.lms-topbar {
    display: flex; align-items: center; gap: 1.2rem; padding: 0.8rem 1.4rem;
    border-bottom: 1px solid var(--border); background: var(--bg-1); position: sticky; top: 0; z-index: 30;
}
.lms-topbar .lms-title { color: var(--muted); font-weight: 600; }

.lms-grid {
    display: grid; grid-template-columns: 1fr 380px; gap: 0;
    min-height: calc(100vh - 57px);
}
.lms-stage { padding: 1.6rem; overflow-y: auto; }
.player-wrap { border-radius: var(--r-md); overflow: hidden; background: #000; box-shadow: var(--shadow-card); }
.player-embed { position: relative; aspect-ratio: 16 / 9; }
.player-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-empty { aspect-ratio: 16/9; display: grid; place-items: center; color: var(--muted); }

/* custom HTML5 player */
.player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player video { width: 100%; height: 100%; object-fit: contain; }
.player-controls {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    opacity: 0; transform: translateY(8px);
    transition: opacity var(--t-med), transform var(--t-med);
}
.player:hover .player-controls, .player.is-paused .player-controls { opacity: 1; transform: none; }
.pc-btn { background: none; border: 0; color: #fff; font-size: 1.1rem; padding: 0.2rem; }
.pc-time { color: #fff; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.pc-seek { flex: 1; display: flex; align-items: center; }
.pc-seek input { width: 100%; accent-color: var(--accent); }
.player-loader { position: absolute; inset: 0; display: none; place-items: center; background: rgba(0,0,0,0.4); }
.player-loader.is-active { display: grid; }
.spinner {
    width: 42px; height: 42px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.2); border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

.lesson-detail { margin-top: 1.4rem; }
.lesson-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.lesson-detail-head h1 { font-size: 1.6rem; }
.lesson-duration { margin: 0.4rem 0 0.9rem; font-size: 0.9rem; }
.lesson-desc { max-width: 70ch; color: #cfd5e0; }
.btn-complete[data-done="1"] { background: var(--bg-3); color: var(--accent); border: 1px solid var(--accent); }

/* sidebar / accordion */
.lms-sidebar { border-left: 1px solid var(--border); background: var(--bg-1); overflow-y: auto; }
.lms-sidebar-head { padding: 1.3rem; border-bottom: 1px solid var(--border); }
.lms-sidebar-head h2 { font-size: 1.15rem; margin-bottom: 0.8rem; }
.sidebar-progress { margin-bottom: 0.5rem; }

.acc-item { border-bottom: 1px solid var(--border); }
.acc-trigger {
    width: 100%; display: flex; align-items: center; gap: 0.6rem;
    background: none; border: 0; color: var(--text); text-align: left;
    padding: 1rem 1.3rem; font-weight: 700;
    transition: background var(--t-fast);
}
.acc-trigger:hover { background: var(--surface); }
.acc-title { flex: 1; }
.acc-meta { color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.acc-chevron { transition: transform var(--t-med) var(--ease); color: var(--muted); }
.acc-item.is-open .acc-chevron { transform: rotate(180deg); }

/* fluid accordion using max-height + opacity */
.acc-panel { max-height: 0; opacity: 0; overflow: hidden; transition: max-height var(--t-med) var(--ease), opacity var(--t-med); }
.acc-item.is-open .acc-panel { max-height: 1000px; opacity: 1; }

.acc-list { list-style: none; padding: 0 0.6rem 0.6rem; }
.acc-lesson a {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.65rem 0.7rem;
    border-radius: var(--r-sm); color: var(--muted); font-size: 0.92rem;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.acc-lesson a:hover { background: var(--surface); color: var(--text); transform: translateX(3px); }
.acc-lesson.is-active a { background: var(--surface-2); color: var(--accent); }
.acc-lesson-title { flex: 1; }
.acc-lesson-dur { font-size: 0.76rem; opacity: 0.7; font-variant-numeric: tabular-nums; }
.check {
    width: 20px; height: 20px; flex: none; border-radius: 50%;
    border: 2px solid var(--border); display: grid; place-items: center;
    font-size: 0.7rem; transition: all var(--t-fast);
}
.check.is-done { background: var(--accent); border-color: var(--accent); color: #0a0d05; }

/* ---------- 10. Auth ---------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; position: relative; overflow: hidden; }
.auth-aurora {
    position: absolute; inset: -30%; pointer-events: none;
    background: radial-gradient(600px 400px at 30% 20%, var(--accent-glow), transparent 60%),
                radial-gradient(500px 400px at 75% 80%, rgba(255,107,44,0.22), transparent 60%);
    animation: float 12s var(--ease) infinite alternate;
}
.auth-wrap { width: min(100% - 40px, 420px); position: relative; z-index: 2; }
.auth-card {
    background: rgba(13,15,22,0.85); backdrop-filter: blur(18px);
    border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: 2.2rem; box-shadow: var(--shadow-card);
}
.auth-brand { display: inline-block; margin-bottom: 1.4rem; }
.auth-title { font-size: 1.8rem; }
.auth-sub { color: var(--muted); margin: 0.3rem 0 1.4rem; }
.auth-hint { margin-top: 1rem; font-size: 0.8rem; color: var(--muted); }
.auth-hint code { color: var(--accent); }

/* ---------- 11. Forms ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field > span { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input, textarea, select {
    width: 100%; padding: 0.75rem 0.9rem;
    background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm);
    color: var(--text); font-family: inherit; font-size: 0.95rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.alert { padding: 0.8rem 1rem; border-radius: var(--r-sm); font-size: 0.9rem; }
.alert-error { background: rgba(255,77,77,0.12); border: 1px solid rgba(255,77,77,0.4); color: #ffb4b4; }

/* ---------- 12. Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar {
    background: var(--bg-1); border-right: 1px solid var(--border);
    padding: 1.4rem; display: flex; flex-direction: column;
}
.admin-nav { margin-top: 1.6rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.admin-nav-link {
    padding: 0.65rem 0.8rem; border-radius: var(--r-sm); color: var(--muted); font-weight: 600;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.admin-nav-link:hover { background: var(--surface); color: var(--text); transform: translateX(3px); }
.admin-main { padding: 2rem; overflow-y: auto; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.6rem; }
.admin-subtitle { margin-bottom: 1rem; font-size: 1.15rem; }
.admin-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.6rem; align-items: start; }
.admin-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.4rem; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.4rem; }
.stat-num { display: block; font-size: 2.2rem; font-weight: 900; color: var(--accent); }
.stat-label { color: var(--muted); }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 0.75rem 0.6rem; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.admin-table th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.08em; }
.link { color: var(--accent); font-weight: 600; }
.pill { padding: 0.25rem 0.6rem; border-radius: var(--r-pill); font-size: 0.75rem; font-weight: 700; }
.pill-published { background: rgba(198,255,58,0.15); color: var(--accent); }
.pill-draft { background: rgba(138,147,166,0.18); color: var(--muted); }
.pill-archived { background: rgba(255,77,77,0.15); color: #ffb4b4; }

/* curriculum drag/drop */
.cur-section { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 1rem; overflow: hidden; }
.cur-section-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem; background: var(--surface-2); cursor: grab; }
.cur-lessons { list-style: none; padding: 0.5rem; }
.cur-lesson { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.7rem; border-radius: var(--r-sm); cursor: grab; transition: background var(--t-fast); }
.cur-lesson:hover { background: var(--surface); }
.cur-lesson .muted { margin-left: auto; font-size: 0.78rem; }
.drag-handle { color: var(--muted); cursor: grab; }
.dragging { opacity: 0.4; }
.form-inline-add { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; padding: 0.7rem 1rem 1rem; align-items: center; }
.form-inline-add input, .form-inline-add select { width: auto; flex: 1; min-width: 120px; }
.admin-logout { margin-top: auto; }

/* ---------- 13. Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); margin-top: 3rem; }

/* ---------- 13b. Admin: actions, flash, lesson add ---------- */
.alert-ok { background: rgba(198,255,58,0.12); border: 1px solid rgba(198,255,58,0.4); color: var(--accent); margin-bottom: 1.2rem; }
.alert { margin-bottom: 1.2rem; }
.row-actions { display: inline-flex; align-items: center; gap: 0.9rem; }
.link-danger { background: none; border: 0; color: var(--danger); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.link-danger:hover { text-decoration: underline; }
.cur-lesson-name { flex: 1; }
.field-check { display: flex; align-items: center; gap: 0.6rem; }
.field-check input { width: auto; }

.lesson-add { gap: 0.6rem; padding: 0.8rem 1rem 1rem; background: var(--bg-1); border-top: 1px solid var(--border); }
.lesson-add-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.lesson-add-row input, .lesson-add-row select { width: auto; }
.lesson-add-row input[name="title"] { flex: 1; min-width: 160px; }
.video-hint { font-size: 0.78rem; margin: 0; }

/* ---------- 13c. Homepage gallery (orientation-aware masonry) ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 210px;
    grid-auto-flow: dense;          /* fill gaps left by mixed spans */
    gap: 1.1rem;
}
.gallery-item {
    position: relative; margin: 0; overflow: hidden;
    border-radius: var(--r-lg); border: 1px solid var(--border);
    background: var(--bg-2);
    grid-column: span 1; grid-row: span 1;   /* square default / no-JS fallback */
    transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med);
    will-change: transform;
}
/* spans set by JS after reading each image's natural orientation */
.gallery-item.is-landscape { grid-column: span 2; grid-row: span 1; }
.gallery-item.is-portrait  { grid-column: span 1; grid-row: span 2; }
.gallery-item.is-wide      { grid-column: span 2; grid-row: span 2; }

.gallery-item:hover { border-color: var(--accent); box-shadow: var(--shadow-card); z-index: 2; }
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform var(--t-slow) var(--ease);
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 1.4rem 1rem 0.9rem; color: #fff; font-weight: 700; font-size: 0.95rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    transform: translateY(8px); opacity: 0;
    transition: transform var(--t-med) var(--ease), opacity var(--t-med);
}
.gallery-item:hover figcaption { transform: none; opacity: 1; }

@media (max-width: 900px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
}
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 240px; }
    .gallery-item.is-landscape, .gallery-item.is-wide { grid-column: span 1; }
    .gallery-item.is-portrait, .gallery-item.is-wide { grid-row: span 1; }
}

/* admin gallery manager */
.gal-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.gal-admin-item { margin: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); }
.gal-admin-item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.gal-admin-item figcaption { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.6rem; font-size: 0.8rem; }

/* ---------- 13d. Checkout + payment settings ---------- */
.checkout-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: start; }
.checkout-summary, .checkout-pay {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 1.6rem;
}
.checkout-cover { aspect-ratio: 16/9; border-radius: var(--r-md); background: var(--bg-3) center/cover; margin-bottom: 1.2rem; }
.checkout-summary h1 { font-size: 1.7rem; margin: 0.3rem 0 0.6rem; }
.checkout-price { display: flex; align-items: baseline; gap: 0.4rem; margin-top: 1.2rem; }
.checkout-price span { color: var(--muted); font-weight: 700; }
.checkout-price strong { font-size: 2.4rem; color: var(--accent); }
.checkout-pay h2 { font-size: 1.3rem; margin-bottom: 1.2rem; }
.pay-method { margin-bottom: 0.8rem; }
.btn-pay { padding: 0.95rem 1.3rem; font-size: 1rem; color: #0a0d05; }
.btn-pay-paypal { background: #ffc439; }
.btn-pay-pokpay { background: var(--accent); }
.btn-pay:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.checkout-secure { font-size: 0.8rem; margin: 1rem 0; }

.pay-card .pay-head { display: flex; align-items: center; justify-content: space-between; }
.switch { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.switch input { width: auto; }
.pill-paid { background: rgba(198,255,58,0.15); color: var(--accent); }
.pill-pending { background: rgba(255,179,0,0.18); color: #ffd86b; }
.pill-failed, .pill-cancelled, .pill-refunded { background: rgba(255,77,77,0.15); color: #ffb4b4; }

@media (max-width: 820px) { .checkout-grid { grid-template-columns: 1fr; } }

/* ---------- 14. Animation utilities ---------- */
/* scroll reveal — JS toggles .is-visible */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* card tilt — JS sets --rx/--ry */
.tilt { transform: perspective(800px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); transform-style: preserve-3d; }

/* skeleton loaders for grids */
[data-skeleton].is-loading .program-card { position: relative; }
.skeleton {
    background: linear-gradient(100deg, var(--bg-2) 30%, var(--bg-3) 50%, var(--bg-2) 70%);
    background-size: 200% 100%; animation: shimmer 1.3s infinite;
    border-radius: var(--r-md);
}

/* page transition */
.page-leave { animation: fadeOut var(--t-med) var(--ease) forwards; }
.page-enter { animation: fadeIn var(--t-med) var(--ease); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes float { to { transform: translate3d(20px, -18px, 0) scale(1.05); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 15. Responsive ---------- */
@media (max-width: 980px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-visual { order: -1; }
    .dash { grid-template-columns: 1fr; }
    .dash-sidebar { position: static; }
    .lms-grid { grid-template-columns: 1fr; }
    .lms-sidebar { border-left: 0; border-top: 1px solid var(--border); max-height: 60vh; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { flex-direction: row; align-items: center; gap: 1rem; }
    .admin-nav { flex-direction: row; margin: 0; }
    .admin-cols { grid-template-columns: 1fr; }
}

/* respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}
