/* =========================================
   Base & Variables
   ========================================= */
:root {
    --oxford: #0B1F3A;
    --secondary: #1E4F8A;
    --accent: #F4B400;
    --soft: #F5F7FA;
    
    --level-a1: #8baade;
    --level-a2: #4a7ac9;
    --level-b1: #1E4F8A;
    --level-b2: #0B1F3A;

    --bg-primary: #f3f6ff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    --transition-fast: 150ms ease;
    --transition-medium: 300ms ease;
    --transition-slow: 500ms ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.eva-body {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at top left, #ffffff 0%, var(--bg-primary) 35%, #edf2ff 100%);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.eva-particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* =========================================
   Typography & Utilities
   ========================================= */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--secondary); }
.text-oxford { color: var(--oxford); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.w-full { width: 100%; }

/* =========================================
   Buttons & Inputs
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(145deg, var(--oxford), var(--secondary));
    box-shadow: 0 4px 14px rgba(30, 79, 138, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 79, 138, 0.4);
}

.btn-accent {
    color: #1e293b;
    background: var(--accent);
}

.icon-btn {
    border-radius: 10px;
    border: 1px solid #dbe5f4;
    color: var(--text-muted);
    padding: 0.5rem;
    background: #fff;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    background: #fff;
}

.form-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(30, 79, 138, 0.1);
}

.form-icon {
    position: absolute;
    left: 0.8rem;
    bottom: 0.8rem;
    color: var(--text-muted);
    pointer-events: none;
}

.form-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.alert-success {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-weight: bold;
    padding: 0 0.5rem;
}

/* =========================================
   Layout: App Shell & Sidebar
   ========================================= */
.app-shell,
.guest-main {
    position: relative;
    z-index: 5;
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 84px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(14px);
    border-right: 1px solid rgba(11, 31, 58, 0.1);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width 360ms ease, box-shadow 360ms ease;
    z-index: 50;
    overflow-x: hidden;
    white-space: nowrap;
    will-change: width;
}

@media (min-width: 901px) {
    .app-sidebar:hover {
        width: 270px;
        box-shadow: 8px 0 24px rgba(11, 31, 58, 0.08);
    }
}

.brand-block {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(11, 31, 58, 0.98), rgba(30, 79, 138, 0.95));
    color: #fff;
    margin: 0 0.5rem;
    overflow: hidden;
}

.brand-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    flex-shrink: 0;
}

.brand-icon-wrap svg {
    width: 1.2rem;
    height: 1.2rem;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: #bfdbfe;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0 0.5rem;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 12px;
    padding: 0.75rem;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
    position: relative;
}

.side-link:hover {
    background: #eef4ff;
    color: var(--secondary);
    transform: translateX(2px);
}

.side-link.active {
    background: linear-gradient(90deg, rgba(30, 79, 138, 0.15), rgba(30, 79, 138, 0.04));
    color: var(--secondary);
    border-left: 3px solid var(--secondary);
}

.side-icon {
    display: inline-flex;
    color: #64748b;
    flex-shrink: 0;
}

.side-icon svg {
    width: 1.4rem;
    height: 1.4rem;
}

.side-link.active .side-icon,
.side-link:hover .side-icon {
    color: var(--secondary);
}

.sidebar-card {
    margin-top: auto;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    padding: 0.9rem;
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.app-sidebar:hover .sidebar-card {
    opacity: 1;
}

.app-sidebar.open {
    width: 270px;
    left: 0;
}

.app-sidebar.open .sidebar-card {
    opacity: 1;
}

.side-label,
.brand-block > div,
.sidebar-card {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.app-sidebar:hover .side-label,
.app-sidebar:hover .brand-block > div,
.app-sidebar:hover .sidebar-card,
.app-sidebar.open .side-label,
.app-sidebar.open .brand-block > div,
.app-sidebar.open .sidebar-card {
    opacity: 1;
    transform: translateX(0);
}

@media (min-width: 901px) {
    .app-sidebar:not(:hover) .side-link[data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        background: rgba(11, 31, 58, 0.95);
        color: #fff;
        padding: 0.28rem 0.55rem;
        border-radius: 7px;
        font-size: 0.72rem;
        box-shadow: 0 6px 18px rgba(11, 31, 58, 0.25);
        pointer-events: none;
    }
}

/* Base Topbar */
.app-content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar-title h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--oxford);
    line-height: 1.2;
}

.topbar-title p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: box-shadow var(--transition-fast);
}

.user-chip:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.user-avatar-initials {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--oxford));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.app-main {
    padding: 1.5rem;
    flex: 1;
}

.guest-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================================
   Authentication Module (Auth View)
   ========================================= */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-bg-shapes {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    animation: float 20s infinite alternate;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: rgba(30, 79, 138, 0.4);
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: rgba(11, 31, 58, 0.3);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: rgba(244, 180, 0, 0.15);
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.auth-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(11, 31, 58, 0.25);
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.5);
}

.auth-brand-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--oxford), var(--secondary));
    padding: 3rem;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-brand-content {
    position: relative;
    z-index: 2;
}

.auth-logo {
    height: 60px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}

.auth-brand-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
}

.auth-forms-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Slider mechanism */
.auth-slider {
    display: flex;
    width: 200%;
    height: 100%;
    transition: transform var(--transition-slow);
}

.auth-pane {
    width: 50%;
    height: 100%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: opacity var(--transition-medium);
}

.auth-slider.slide-register {
    transform: translateX(-50%);
}

.auth-slider.slide-register #pane-login {
    opacity: 0;
    pointer-events: none;
}

.auth-slider:not(.slide-register) #pane-register {
    opacity: 0;
    pointer-events: none;
}

.auth-pane-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--oxford);
    margin-bottom: 0.5rem;
}

.auth-pane-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-switch-link {
    color: var(--secondary);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    font-size: inherit;
    padding: 0;
    margin-left: 0.25rem;
}

.auth-switch-link:hover {
    text-decoration: underline;
}

/* =========================================
   Dashboard Elements
   ========================================= */
.dash-header {
    margin-bottom: 2rem;
    animation: fadeUp 400ms ease forwards;
}

.dash-header h2 {
    font-size: 1.8rem;
    color: var(--oxford);
    margin-bottom: 0.25rem;
}

.dash-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    border-radius: 16px;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    animation: fadeUp 500ms ease forwards;
}

.metric-card:nth-child(1) { animation-delay: 50ms; background: linear-gradient(135deg, var(--secondary), #2a69b7); }
.metric-card:nth-child(2) { animation-delay: 150ms; background: linear-gradient(135deg, #10b981, #059669); }
.metric-card:nth-child(3) { animation-delay: 250ms; background: linear-gradient(135deg, var(--accent), #d97706); }
.metric-card:nth-child(4) { animation-delay: 350ms; background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.metric-card-bg {
    position: absolute;
    right: -20px;
    bottom: -20px;
    opacity: 0.15;
    fill: currentColor;
    width: 100px;
    height: 100px;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
}

.section-title {
    font-size: 1.4rem;
    color: var(--oxford);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

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

.course-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    animation: fadeUp 500ms ease forwards;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(11, 31, 58, 0.08);
}

.course-img {
    height: 140px;
    width: 100%;
    object-fit: cover;
    background: #e2e8f0;
}

.course-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-level {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    width: max-content;
}

.level-A1 { background-color: var(--level-a1); }
.level-A2 { background-color: var(--level-a2); }
.level-B1 { background-color: var(--level-b1); }
.level-B2 { background-color: var(--level-b2); }

.course-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--oxford);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.course-progress-wrap {
    margin-top: auto;
    margin-bottom: 1rem;
}

.course-progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.course-progress-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 3px;
    transition: width 1s ease;
}

.course-progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
}

/* =========================================
   Animations
   ========================================= */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-enter {
    animation: fadeUp 400ms ease;
}

/* =========================================
   Responsive
   ========================================= */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: 30;
}

.mobile-menu-btn {
    display: none;
}

@media (max-width: 900px) {
    .auth-card {
        flex-direction: column;
        border-radius: 0;
        min-height: 100vh;
    }
    .auth-brand-panel {
        flex: none;
        padding: 2rem;
    }
    .auth-slider {
        height: auto;
        flex: 1;
    }
    .auth-pane {
        padding: 2rem;
    }
    
    .mobile-menu-btn {
        display: block;
    }

    .app-sidebar {
        position: fixed;
        left: -300px;
        width: 270px;
    }

    .app-sidebar:hover {
        width: 270px;
    }

    .app-sidebar.open {
        left: 0;
    }

    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: all;
    }
}

/* Grid splits for forms */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row > div {
    flex: 1;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* =========================================
   App Utilities (Tailwind-like subset)
   ========================================= */
.card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(11, 31, 58, 0.05);
}

.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(11, 31, 58, 0.1);
}

.max-w-7xl { max-width: 80rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.p-6 { padding: 1.5rem; }
.p-5 { padding: 1.25rem; }
.p-4 { padding: 1rem; }
.p-3 { padding: 0.75rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }

.grid { display: grid; }
.gap-6 { gap: 1.5rem; }
.gap-5 { gap: 1.25rem; }
.gap-4 { gap: 1rem; }
.gap-3 { gap: 0.75rem; }
.gap-2 { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.w-full { width: 100%; }
.h-fit { height: fit-content; }
.text-left { text-align: left; }
.text-xl { font-size: 1.25rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.rounded { border-radius: 0.5rem; }
.rounded-lg { border-radius: 0.75rem; }
.border { border: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-t { border-top: 1px solid var(--border-color); }
.text-white { color: #fff; }
.text-secondary { color: var(--secondary); }
.text-rose-600 { color: #e11d48; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.bg-oxford { background: var(--oxford); }
.bg-slate-50 { background: #f8fafc; }
.bg-emerald-50 { background: #ecfdf5; }
.text-emerald-700 { color: #047857; }
.bg-red-50 { background: #fef2f2; }
.text-red-700 { color: #b91c1c; }
.bg-amber-50 { background: #fffbeb; }
.text-amber-700 { color: #b45309; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.overflow-auto { overflow: auto; }
.hidden { display: none; }

.level-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.level-filter-chip {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: #fff;
}

.level-filter-chip.is-active {
    border-color: var(--secondary);
    color: var(--secondary);
    background: #eef4ff;
}

.question-row {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #f8fafc;
}

.review-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
}

.review-item.ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.review-item.ko {
    background: #fff7ed;
    border-color: #fed7aa;
}

.video-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #0f172a;
}

.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.theme-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.theme-list {
    position: sticky;
    top: 94px;
}

.theme-nav {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.theme-btn {
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    text-align: left;
    color: #1e293b;
    cursor: pointer;
    transition: all 170ms ease;
}

.theme-btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.theme-btn.active {
    border-color: var(--secondary);
    background: #eaf2ff;
    color: var(--secondary);
    box-shadow: inset 3px 0 0 var(--secondary);
}

.theme-panel {
    display: none;
    opacity: 0;
    transform: translateY(8px);
}

.theme-panel.active {
    display: block;
    animation: themePanelIn 340ms ease forwards;
}

@keyframes themePanelIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-section-card {
    margin-bottom: 1rem;
}

.icon-line {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    color: var(--oxford);
}

.icon-line svg {
    width: 1rem;
    height: 1rem;
}

.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    background: #eff6ff;
    color: var(--secondary);
    border: 1px solid #dbeafe;
    font-weight: 600;
    font-size: 0.86rem;
}

.test-question {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.9rem;
    margin-bottom: 0.85rem;
    background: #fff;
    transition: border-color 220ms ease, background-color 220ms ease, transform 220ms ease;
}

.test-question.correct {
    border-color: #86efac;
    background: #f0fdf4;
    transform: translateY(-1px);
}

.test-question.incorrect {
    border-color: #fda4af;
    background: #fff1f2;
    transform: translateY(-1px);
}

.test-options {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.test-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.7rem 0.75rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.test-option:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.test-option.selected {
    border-color: var(--secondary);
    background: #eef4ff;
    transform: translateY(-1px);
}

.test-feedback {
    margin-top: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.test-feedback.ok {
    color: #047857;
}

.test-feedback.ko {
    color: #be123c;
}

.test-match-grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.test-match-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    align-items: center;
}

.test-match-left {
    font-size: 0.88rem;
    color: #334155;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
}

.course-hero {
    position: relative;
}

.hero-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.9;
    z-index: 1;
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:col-span-3 { grid-column: span 3 / span 3; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:col-span-1 { grid-column: span 1 / span 1; }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .theme-layout {
        grid-template-columns: 1fr;
    }
    .theme-list {
        position: static;
    }
    .theme-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }
    .theme-btn {
        min-width: 180px;
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    .test-option {
        padding: 0.8rem;
    }
    .download-item {
        flex-direction: column;
        align-items: flex-start;
    }
}
