:root {
    --primary: #4338ca;
    --primary-600: #3730a3;
    --secondary: #7c3aed;
    --accent: #ea580c;
    --accent-2: #db2777;
    --cyan: #0e7490;
    --success: #047857;
    --danger: #be123c;
    --warning: #b45309;
    --dark: #1e1b4b;
    --light: #f4f7fb;
    --text: #172033;
    --muted: #526077;
    --card: #ffffff;
    --bg: #f3f6fb;
    --border: #e2e8f0;
    --shadow: 0 18px 50px rgba(30, 27, 75, 0.08);
    --radius: 22px;
    --font: "Outfit", system-ui, sans-serif;
    --display: "Fraunces", Georgia, serif;
    --gradient: linear-gradient(135deg, #312e81 0%, #4338ca 48%, #0e7490 100%);
    --header-h: 78px;
    --focus: 0 0 0 3px rgba(67, 56, 202, 0.35);
}

[data-theme="dark"] {
    color-scheme: dark;
    --text: #e7ecf5;
    --muted: #b7c0d4;
    --card: #17182b;
    --bg: #0e1020;
    --border: #2c3150;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    --light: #1c2038;
    --dark: #e7ecf5;
    --bs-body-color: #e7ecf5;
    --bs-body-bg: #0e1020;
    --bs-emphasis-color: #f8fafc;
    --bs-heading-color: #f8fafc;
    --bs-secondary-color: #b7c0d4;
    --bs-tertiary-color: #b7c0d4;
    --bs-link-color: #c7d2fe;
    --bs-link-hover-color: #eef2ff;
    --bs-border-color: #2c3150;
    --bs-secondary-bg: #17182b;
    --bs-tertiary-bg: #121426;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(900px 400px at 100% -10%, rgba(124, 58, 237, 0.16), transparent 50%),
        radial-gradient(700px 320px at -10% 20%, rgba(14, 116, 144, 0.12), transparent 45%),
        var(--bg);
    line-height: 1.6;
    overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.skip-link {
    position: absolute; left: 12px; top: -40px; background: var(--primary); color: #fff;
    padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; }
.wrap { width: min(1160px, calc(100% - 32px)); margin-inline: auto; }
h1, h2, h3, .display { font-family: var(--display); letter-spacing: -0.03em; line-height: 1.15; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.site-header {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.header-bar { min-height: var(--header-h); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand strong { display: block; font-size: 1.05rem; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: 0.75rem; }
.site-nav { display: flex; gap: 16px; }
.site-nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--text); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-search { position: relative; }
.nav-search input, .field input, .field select, .field textarea, .auth-card input, .auth-card select, .auth-card textarea {
    width: 100%; border: 1px solid var(--border); background: var(--card); border-radius: 12px; padding: 10px 12px;
}
.nav-search input { width: 180px; padding: 8px 12px; }
.search-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; }
.search-pop a { display: block; text-decoration: none; padding: 8px; border-radius: 10px; }
.search-pop a:hover { background: var(--light); }
.icon-btn, .cart-link {
    width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--card);
    display: grid; place-items: center; text-decoration: none; position: relative; cursor: pointer;
}
.cart-count {
    position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 99px;
    background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center;
}
.account-menu { position: relative; }
.account-menu summary {
    list-style: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
    background: var(--gradient); color: #fff; cursor: pointer; font-weight: 700;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu div {
    position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; min-width: 190px; box-shadow: var(--shadow); padding: 8px; display: grid;
}
.account-menu a, .account-menu button {
    text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 10px; text-decoration: none; cursor: pointer;
}
.account-menu a:hover, .account-menu button:hover { background: var(--light); }
.nav-toggle { display: none; margin-left: auto; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px;
    padding: 12px 18px; text-decoration: none; border: 0; cursor: pointer; font-weight: 640;
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 10px 24px rgba(67, 56, 202, 0.25); }
.btn-primary:hover { filter: brightness(1.05); color: #fff; }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 8px 12px; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.hero { position: relative; padding: 54px 0 28px; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: 0.7; animation: float 8s ease-in-out infinite; }
.blob-a { width: 180px; height: 180px; background: #c4b5fd; top: 20px; right: 8%; }
.blob-b { width: 120px; height: 120px; background: #67e8f9; bottom: 40px; left: 4%; animation-delay: -2s; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 42px; align-items: center; position: relative; }
.eyebrow {
    display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px;
    background: color-mix(in srgb, var(--card) 80%, #c7d2fe); color: var(--primary-600); font-weight: 640; font-size: 0.92rem;
}
.hero h1 { font-size: clamp(2.5rem, 5vw, 4.6rem); margin: 14px 0; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.hero-actions, .trust-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.trust-row span { color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.hero-art { position: relative; min-height: 420px; }
.float-card {
    position: absolute; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 16px;
    border: 1px solid var(--border); width: min(280px, 80%);
}
.float-card.one { top: 24px; left: 10px; animation: float 7s ease-in-out infinite; }
.float-card.two { right: 0; bottom: 36px; animation: float 9s ease-in-out infinite reverse; }
.meter { height: 8px; background: #e0e7ff; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter span { display: block; height: 100%; width: 72%; background: var(--gradient); }
.section { padding: 64px 0; }
.section-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 24px; }
.section-head p, .muted { color: var(--muted); }
.course-grid, .feature-grid, .testimonial-grid, .category-grid { display: grid; gap: 18px; }
.course-grid { grid-template-columns: repeat(3, 1fr); }
.feature-grid { grid-template-columns: repeat(3, 1fr); }
.testimonial-grid, .category-grid { grid-template-columns: repeat(3, 1fr); }
.course-card, .feature-card, .testimonial-card, .panel, .buy-card, .summary-card, .auth-card, .stat-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.course-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease; }
.course-card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(30, 27, 75, 0.14); }
.course-thumb { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-badges { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.pill, .status { display: inline-flex; border-radius: 999px; padding: 3px 8px; font-size: 0.78rem; font-weight: 700; }
.pill-hot { background: #ffedd5; color: #9a3412; }
.pill-sale { background: #dcfce7; color: #166534; }
.pill-offer { background: #fae8ff; color: #86198f; }
.course-body, .feature-card, .testimonial-card { padding: 16px 16px 18px; }
.course-topline, .course-foot, .course-meta, .price-wrap { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.course-cat { margin: 0; color: var(--primary); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: .04em; }
.course-card h2, .course-card h3 { font-size: 1.25rem; margin: 8px 0; }
.course-card h2 a, .course-card h3 a { text-decoration: none; color: inherit; }
.blog-article { max-width: 760px; }
.blog-cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 18px; margin: 8px 0 20px; }
.blog-meta { color: var(--muted); }
.course-desc { color: var(--muted); min-height: 3.2em; }
.course-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.price-wrap strong { font-size: 1.15rem; }
.price-wrap s { color: var(--muted); }
.stars { color: #d97706; display: inline-flex; gap: 2px; align-items: center; }
.stars span, .stars-new { color: var(--muted); margin-left: 4px; font-size: 0.85rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
    padding: 22px; border-radius: 20px; color: #fff; background: var(--gradient); text-align: center;
}
.stat strong { display: block; font-family: var(--display); font-size: 2rem; }
.feature-card i { font-size: 1.4rem; color: var(--primary); }
.quote { font-size: 1.05rem; }
.sample-flag { font-size: 0.75rem; color: var(--warning); font-weight: 700; }
.person { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.avatar {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--gradient); font-weight: 700;
}
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 0 16px; margin-bottom: 10px; }
.faq-item summary { cursor: pointer; padding: 14px 0; font-weight: 680; }
.faq-item p { color: var(--muted); margin-top: 0; }
.cta-band {
    border-radius: 32px; padding: 48px 32px; color: #fff; background:
        radial-gradient(400px 180px at 90% 20%, rgba(255,255,255,.2), transparent), var(--gradient);
    display: flex; justify-content: space-between; gap: 18px; align-items: center;
}
.cta-band .btn { background: #fff; color: #1e1b4b; }
.cta-band p { color: #eef2ff; }

.page-hero { padding: 36px 0 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; }
.filters select, .filters input { border: 1px solid var(--border); background: var(--card); border-radius: 12px; padding: 10px 12px; }
.detail-grid, .cart-layout, .checkout-layout, .contact-grid, .dash { display: grid; gap: 22px; }
.detail-grid { grid-template-columns: 1.4fr .7fr; align-items: start; }
.cart-layout, .checkout-layout, .contact-grid { grid-template-columns: 1.3fr .7fr; }
.dash { grid-template-columns: 230px 1fr; align-items: start; }
.buy-card, .summary-card { padding: 18px; position: sticky; top: 96px; }
.curriculum details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.lesson-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--muted); }
.banner-img { border-radius: 28px; width: 100%; max-height: 420px; object-fit: cover; }
.learn-list { margin: 0; padding-left: 18px; }
.prose { font-size: 1.05rem; }
.prose p { color: var(--muted); }
.pathfinder { display: grid; gap: 14px; background: var(--card); border-radius: 28px; padding: 22px; border: 1px solid var(--border); }
.path-options { display: flex; flex-wrap: wrap; gap: 8px; }
.path-options button { border: 1px solid var(--border); background: var(--light); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.path-options button.is-on { background: var(--dark); color: #fff; border-color: transparent; }
[data-theme="dark"] .path-options button.is-on { background: #e7ecf5; color: #111827; }
[data-theme="dark"] .eyebrow { background: rgba(199, 210, 254, 0.18); color: #eef2ff; }
[data-theme="dark"] .course-cat,
[data-theme="dark"] .feature-card i,
[data-theme="dark"] .category-card i,
[data-theme="dark"] .empty-mark { color: #c4b5fd; }
[data-theme="dark"] .sample-flag { color: #fcd34d; }
[data-theme="dark"] .field-error { color: #fda4af; }
[data-theme="dark"] ::placeholder { color: #9aa6c3; opacity: 1; }
[data-theme="dark"] .legal-content h1,
[data-theme="dark"] .legal-content h2,
[data-theme="dark"] .prose h2,
[data-theme="dark"] .faq-item summary,
[data-theme="dark"] .course-card h2,
[data-theme="dark"] .course-card h3,
[data-theme="dark"] .feature-card h3,
[data-theme="dark"] .category-card h3 { color: var(--text); }
[data-theme="dark"] .table,
[data-theme="dark"] .table > :not(caption) > * > * {
    color: var(--text);
    background-color: transparent;
    border-color: var(--border);
}

.auth-shell { min-height: calc(100vh - 180px); display: grid; place-items: center; padding: 32px 0 64px; }
.auth-card { width: min(480px, 100%); padding: 28px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field-error { color: var(--danger); margin: 0; font-size: 0.9rem; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.dash-side, .admin-side { display: grid; gap: 4px; }
.dash-side a, .dash-side button {
    display: flex; gap: 8px; align-items: center; text-decoration: none; padding: 10px 12px; border-radius: 12px;
    background: transparent; border: 0; text-align: left; cursor: pointer;
}
.dash-side a[aria-current="page"], .dash-side a:hover { background: var(--card); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { padding: 16px; }
.stat-card span { color: var(--muted); display: block; }
.stat-card strong { font-size: 1.5rem; }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: 18px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.status-paid, .status-completed, .status-active, .status-published { background: #dcfce7; color: #166534; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-failed, .status-inactive { background: #ffe4e6; color: #9f1239; }
.status-cancelled, .status-archived { background: #e2e8f0; color: #334155; }
.status-refunded { background: #e0e7ff; color: #3730a3; }
.pager ul { display: flex; gap: 6px; list-style: none; padding: 0; }
.pager a { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: 10px; text-decoration: none; border: 1px solid var(--border); }
.pager a.is-current { background: var(--primary); color: #fff; }
.empty { text-align: center; padding: 40px 16px; }
.empty-mark { font-size: 2rem; color: var(--primary); }
.toast-stack { width: min(1160px, calc(100% - 32px)); margin: 12px auto 0; display: grid; gap: 8px; }
.toast { padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.toast-success { border-color: #86efac; }
.toast-error, .toast-danger { border-color: #fda4af; }
.toast-warning { border-color: #fcd34d; }
.site-footer { margin-top: 40px; background: #1e1b4b; color: #e0e7ff; padding: 42px 0 18px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr .7fr .9fr 1fr; gap: 22px; }
.site-footer a { display: block; color: #c7d2fe; text-decoration: none; margin: 6px 0; }
.footer-base { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255,255,255,.12); margin-top: 22px; padding-top: 14px; color: #a5b4fc; }
.socials { display: flex; gap: 8px; }
.socials a { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; }
.brand-light small, .brand-light strong { color: #fff; }
.legal-content { background: var(--card); border-radius: 24px; padding: 28px; border: 1px solid var(--border); }
.map-placeholder, .video-frame { border-radius: 18px; overflow: hidden; background: #e0e7ff; min-height: 220px; display: grid; place-items: center; color: var(--muted); }
.video-frame iframe, .video-frame video, .video-frame audio { width: 100%; min-height: 240px; border: 0; }
.private-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.progress { height: 8px; background: #e0e7ff; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gradient); }
.mobile-buybar { display: none; }
.invoice { background: #fff; color: #111; padding: 28px; border-radius: 18px; }
.learn-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.learn-side { background: var(--card); border-radius: 18px; padding: 12px; border: 1px solid var(--border); max-height: 70vh; overflow: auto; }
.category-card { padding: 18px; text-decoration: none; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@media (max-width: 1024px) {
    .course-grid, .feature-grid, .testimonial-grid, .category-grid, .stats, .related-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-grid, .detail-grid, .cart-layout, .checkout-layout, .contact-grid, .dash, .footer-grid, .learn-layout { grid-template-columns: 1fr; }
    .buy-card, .summary-card { position: static; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-art { min-height: 300px; }
}
@media (max-width: 768px) {
    .hero-art { min-height: 0; display: grid; gap: 12px; }
    .hero-art img { display: none; }
    .float-card, .float-card.one, .float-card.two { position: static; width: auto; animation: none; }
    .nav-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); }
    .site-nav { display: none; position: absolute; left: 16px; right: 16px; top: calc(var(--header-h) - 8px); background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); }
    .site-nav.is-open { display: grid; }
    .header-tools .btn, .nav-search { display: none; }
    .header-bar { position: relative; }
    .course-grid, .feature-grid, .testimonial-grid, .category-grid, .stats, .related-grid, .stat-grid { grid-template-columns: 1fr; }
    .cta-band, .footer-base, .section-head { flex-direction: column; align-items: flex-start; }
    .dash-side { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 8px; }
    .dash-side a, .dash-side button { white-space: nowrap; background: var(--card); }
    .mobile-buybar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--card) 94%, transparent); border-top: 1px solid var(--border); z-index: 30;
    }
    body.course-page { padding-bottom: 84px; }
}
@media (max-width: 375px) {
    .wrap { width: min(1160px, calc(100% - 20px)); }
    .hero h1 { font-size: 2.15rem; }
    .float-card { display: none; }
    .hero-art { min-height: auto; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
    .site-header, .site-footer, .no-print { display: none !important; }
    body { background: #fff; }
}
