/**
 * TechMaster Academy — Modern Design System v2
 * Premium LMS UI · 2025
 */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Brand */
    --brand-50: #eff6ff;
    --brand-100: #dbeafe;
    --brand-200: #bfdbfe;
    --brand-400: #60a5fa;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    --brand-800: #1e40af;

    --accent-violet: #7c3aed;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    /* Semantic */
    --primary: var(--brand-600);
    --primary-hover: var(--brand-700);
    --primary-soft: var(--brand-50);
    --primary-glow: rgba(37, 99, 235, 0.35);

    --success: #059669;
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --error: #dc2626;

    /* Surfaces */
    --surface-0: #ffffff;
    --surface-1: #f8fafc;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;
    --surface-sidebar: #0c1222;
    --surface-sidebar-hover: rgba(255, 255, 255, 0.06);
    --surface-sidebar-active: var(--brand-600);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #ffffff;

    /* Borders & radius */
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
    --shadow-brand: 0 8px 24px var(--primary-glow);

    /* Layout */
    --sidebar-w: 252px;
    --topbar-h: 68px;
    --content-max: 1320px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration: 0.22s;

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #1e40af 0%, #2563eb 45%, #3b82f6 100%);
    --gradient-hero: linear-gradient(160deg, #0f172a 0%, #1e3a8a 40%, #2563eb 100%);
    --gradient-mesh: radial-gradient(at 20% 0%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
                     radial-gradient(at 80% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 45%),
                     radial-gradient(at 50% 100%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);

    /* Legacy aliases */
    --bg: var(--surface-1);
    --bg-page: var(--surface-1);
    --bg-card: var(--surface-0);
    --bg-elevated: var(--surface-0);
    --bg-subtle: var(--surface-2);
    --text: var(--text-primary);
    --text-muted: var(--text-tertiary);
    --sidebar-width: var(--sidebar-w);
    --sidebar-bg: var(--surface-sidebar);
    --sidebar-text: var(--text-sidebar);
    --sidebar-active: var(--surface-sidebar-active);
    --sidebar-hover: var(--surface-sidebar-hover);
    --topbar-height: var(--topbar-h);
    --radius: var(--radius-md);
    --radius-lg: var(--radius-lg);
    --shadow: var(--shadow-sm);
    --shadow-md: var(--shadow-md);
    --shadow-lg: var(--shadow-lg);
    --hero-gradient: var(--gradient-brand);
    --primary-light: var(--brand-100);
    --primary-dark: var(--brand-800);
    --success-bg: var(--success-soft);
    --border-light: var(--border-subtle);
}

[data-theme="dark"] {
    --surface-0: #1e293b;
    --surface-1: #0f172a;
    --surface-2: #1a2332;
    --surface-3: #334155;
    --surface-sidebar: #070b14;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border: #334155;
    --border-subtle: #1e293b;
    --primary-soft: rgba(37, 99, 235, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --gradient-mesh: radial-gradient(at 20% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
                     radial-gradient(at 80% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 45%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--surface-1);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--gradient-mesh);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--duration) var(--ease-out);
}
a:hover { color: var(--primary-hover); }

h1, h2, h3, h4 {
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.25;
    font-weight: 700;
}

/* ═══ APP SHELL ═══ */
.app-body {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 400;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.35s var(--ease-out);
}

.sidebar-header {
    padding: 1.35rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-inverse);
    text-decoration: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--gradient-brand);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

.logo-text {
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.logo-text small {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-sidebar);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 0.85rem 0.65rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.72rem 0.9rem;
    margin-bottom: 0.2rem;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--duration) var(--ease-out);
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--surface-sidebar-hover);
    color: #e2e8f0;
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--surface-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.nav-icon {
    display: flex;
    width: 20px;
    opacity: 0.9;
}

.sidebar-footer {
    padding: 0.75rem 0.65rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-item.logout:hover {
    background: rgba(244, 63, 94, 0.12);
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.2);
}

.sidebar-toggle { display: none; }

/* ═══ TOPBAR ═══ */
.topbar {
    height: var(--topbar-h);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 300;
}

[data-theme="dark"] .topbar {
    background: rgba(15, 23, 42, 0.88);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.topbar-menu {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-0);
    color: var(--text-secondary);
    cursor: pointer;
    place-items: center;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    max-width: 400px;
    width: 100%;
    padding: 0.55rem 1rem;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    transition: all var(--duration) var(--ease-out);
}

.topbar-search:focus-within {
    background: var(--surface-0);
    border-color: var(--brand-200);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.topbar-search svg { color: var(--text-tertiary); flex-shrink: 0; }

.topbar-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font: inherit;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.topbar-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-0);
    color: var(--text-secondary);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all var(--duration) var(--ease-out);
}

.topbar-icon-btn:hover {
    border-color: var(--brand-200);
    color: var(--primary);
    background: var(--primary-soft);
}

[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.3rem 0.85rem 0.3rem 0.3rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface-0);
    transition: all var(--duration) var(--ease-out);
}

.topbar-user:hover {
    border-color: var(--brand-200);
    box-shadow: var(--shadow-xs);
}

.topbar-avatar,
.topbar-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.topbar-avatar-placeholder {
    background: var(--gradient-brand);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.topbar-user-info { line-height: 1.2; }
.topbar-user-info strong { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); display: block; }
.topbar-user-info small { font-size: 0.7rem; color: var(--text-tertiary); }

/* ═══ MAIN ═══ */
.main-content {
    flex: 1;
    padding: 1.75rem;
    max-width: var(--content-max);
    width: 100%;
    animation: pageIn 0.45s var(--ease-out) both;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══ CARDS ═══ */
.card {
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.65rem;
    box-shadow: var(--shadow-xs);
    margin-bottom: 1.25rem;
    transition: box-shadow var(--duration) var(--ease-out);
}

.card:hover { box-shadow: var(--shadow-sm); }

.card h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.15rem;
}

/* ═══ BUTTONS ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px var(--primary-glow);
    color: white;
}

.btn-secondary {
    background: var(--surface-0);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    border-color: var(--brand-200);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-sm { padding: 0.45rem 0.95rem; font-size: 0.75rem; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }
.link-more { font-size: 0.8125rem; font-weight: 600; color: var(--primary); }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 1.2rem; }

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-0);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.875rem;
    transition: border-color var(--duration), box-shadow var(--duration);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ═══ AUTH ═══ */
.auth-container {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.auth-container::before,
.auth-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
}

.auth-container::before {
    width: 400px; height: 400px;
    background: #3b82f6;
    top: -100px; right: -80px;
}

.auth-container::after {
    width: 300px; height: 300px;
    background: #7c3aed;
    bottom: -80px; left: -60px;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 2.75rem 2.5rem;
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
    animation: scaleUp 0.5s var(--ease-spring) both;
}

[data-theme="dark"] .auth-card {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header .logo-icon { margin: 0 auto 1.1rem; width: 52px; height: 52px; }
.auth-header h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.4rem; }
.auth-header p { color: var(--text-tertiary); font-size: 0.9rem; }
.auth-footer { text-align: center; margin-top: 1.35rem; font-size: 0.8125rem; color: var(--text-tertiary); }
.auth-form .btn { margin-top: 0.65rem; width: 100%; }

/* ═══ ALERTS ═══ */
.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid;
}

.alert-error { background: #fef2f2; color: var(--error); border-color: #fecaca; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #a7f3d0; }
.alert-info { background: var(--primary-soft); color: var(--brand-800); border-color: var(--brand-200); }

.flash {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    padding: 0.9rem 1.35rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s var(--ease-spring);
}

.flash-success { background: var(--success); color: white; }
.flash-error { background: var(--error); color: white; }

.flash-close {
    background: rgba(255,255,255,0.25);
    border: none;
    color: inherit;
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 0.35rem;
}

@keyframes toastIn {
    from { transform: translateX(110%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

/* ═══ PROGRESS ═══ */
.progress-bar {
    height: 7px;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar.large { height: 9px; }

.progress-fill {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: var(--radius-full);
    transition: width 0.7s var(--ease-out);
    position: relative;
}

.progress-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-top: 0.4rem;
    display: inline-block;
}

/* ═══ PAGE HEADER ═══ */
.page-header { margin-bottom: 1.65rem; }
.page-header h1 { font-size: 1.65rem; font-weight: 800; margin-bottom: 0.3rem; }
.text-muted { color: var(--text-tertiary); font-size: 0.9rem; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.65rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.back-link:hover { color: var(--primary); }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
}

.section-header h2 { font-size: 1.05rem; font-weight: 700; }
.section-block { margin-bottom: 1.65rem; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.65rem 0; }

.badge {
    display: inline-flex;
    padding: 0.28rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--primary-soft);
    color: var(--brand-700);
}

/* ═══ LANDING ═══ */
.landing { min-height: 100vh; background: var(--surface-1); }

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.25rem;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

[data-theme="dark"] .landing-nav { background: rgba(15,23,42,0.92); }

.landing-nav .logo { color: var(--text-primary); }
.landing-nav .logo-text { color: var(--text-primary); }
.landing-nav .logo-text small { color: var(--text-tertiary); }

.nav-links { display: flex; gap: 0.65rem; align-items: center; }

.landing-nav .theme-toggle {
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-0);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.hero {
    text-align: center;
    padding: 5.5rem 2rem 4.5rem;
    background: var(--gradient-hero);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4z'/%3E%3C/g%3E%3C/svg%3E");
}

.hero > * { position: relative; z-index: 1; }

.hero-badge {
    display: inline-flex;
    padding: 0.45rem 1.1rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 1.35rem;
    backdrop-filter: blur(8px);
}

.hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.5rem);
    font-weight: 800;
    color: white;
    line-height: 1.08;
    margin-bottom: 1.15rem;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.hero h1 span {
    background: linear-gradient(90deg, #93c5fd, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.82);
    max-width: 580px;
    margin: 0 auto 2.25rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-buttons .btn-primary {
    background: white;
    color: var(--brand-800);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 0.85rem 2rem;
    font-size: 0.9rem;
}

.hero-buttons .btn-primary:hover {
    background: #f0f9ff;
    color: var(--brand-800);
    transform: translateY(-2px);
}

.hero-buttons .btn-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    border-color: rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
}

.hero-buttons .btn-secondary:hover {
    background: rgba(255,255,255,0.18);
    color: white;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3.5rem;
    margin-top: 3.75rem;
    flex-wrap: wrap;
}

.hero-stat strong {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: white;
}

.hero-stat span {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.65);
    font-weight: 500;
}

.features {
    padding: 5rem 2rem;
    max-width: 1180px;
    margin: 0 auto;
}

.features h2, .courses-preview h2 {
    text-align: center;
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-tertiary);
    margin-bottom: 2.75rem;
    font-size: 1rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.feature-card {
    padding: 1.85rem;
    transition: transform var(--duration) var(--ease-out), box-shadow var(--duration);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    margin-bottom: 1.15rem;
}

.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.feature-card p { color: var(--text-tertiary); font-size: 0.875rem; line-height: 1.65; }

.courses-preview {
    padding: 5rem 2rem;
    background: var(--surface-2);
    border-block: 1px solid var(--border);
}

.landing-footer {
    text-align: center;
    padding: 2.25rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

/* ═══ LESSON ═══ */
.lesson-page .content-block {
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 0.925rem;
}

.notes-block {
    background: var(--surface-2);
    padding: 1.2rem 1.35rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
}

.code-block {
    background: #0c1222;
    color: #e2e8f0;
    padding: 1.25rem 1.4rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    border: 1px solid rgba(255,255,255,0.06);
}

.lesson-progress-tracker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.65rem;
}

.tracker-item {
    padding: 0.8rem;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-align: center;
    transition: all var(--duration);
}

.tracker-item.done {
    background: var(--success-soft);
    border-color: #6ee7b7;
    color: var(--success);
}

.completed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    background: var(--success-soft);
    color: var(--success);
    font-weight: 600;
    font-size: 0.8125rem;
    border-radius: var(--radius-full);
}

.day-complete-banner {
    background: var(--gradient-brand);
    color: white;
    padding: 1.4rem;
    border-radius: var(--radius-lg);
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    margin-top: 1.65rem;
    box-shadow: var(--shadow-brand);
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1.1rem;
    margin: 0.4rem 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--duration);
}

.quiz-option:hover {
    border-color: var(--brand-200);
    background: var(--primary-soft);
}

.quiz-question {
    margin-bottom: 1.35rem;
    padding-bottom: 1.35rem;
    border-bottom: 1px solid var(--border-subtle);
}

.practice-item {
    padding: 1.1rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    margin-bottom: 0.9rem;
    border: 1px solid var(--border);
}

.instructions {
    background: var(--primary-soft);
    border: 1px solid var(--brand-200);
    padding: 0.95rem 1.15rem;
    border-radius: var(--radius-sm);
    margin: 0.9rem 0;
    font-size: 0.875rem;
}

/* ═══ CERTIFICATE ═══ */
.certificate-view { padding: 2rem; text-align: center; }
.certificate-document { max-width: 820px; margin: 0 auto 1.65rem; }

.cert-border {
    border: 2px solid #d4af37;
    padding: 3.25rem;
    border-radius: var(--radius-xl);
    background: white;
    box-shadow: var(--shadow-lg);
}

.cert-content h1 { font-size: 2.1rem; color: var(--primary); }
.cert-name { font-size: 2.1rem; font-weight: 800; font-style: italic; margin: 1.15rem 0; }
.cert-course { font-size: 1.2rem; color: var(--accent-violet); font-weight: 600; }

.empty-state { text-align: center; padding: 3.5rem 2rem; }
.empty-icon { font-size: 3.25rem; margin-bottom: 1.15rem; display: block; }
.empty-text { font-size: 0.875rem; color: var(--text-tertiary); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--radius-full); }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-toggle, .topbar-menu { display: grid; }
    .app-body { margin-left: 0; }
    .main-content { padding: 1.15rem; }
    .topbar-search { max-width: 180px; }
    .topbar-user-info { display: none; }
    .hero { padding: 4rem 1.25rem 3rem; }
}

@media print {
    .sidebar, .topbar, .btn, .flash, body::before { display: none !important; }
    .app-body, .main-content { margin-left: 0; }
}
