:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --accent: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --radius: 10px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar (Authenticated app header — App-Style Icons) */
.navbar {
    background: white;
    padding: 12px 0;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    z-index: 40;
}
.navbar-start {
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1280px;
    padding: 0 28px;
}
.navbar .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.3px;
}
.navbar .brand:hover { text-decoration: none; }
.navbar .brand::before {
    content: '\f19d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    font-size: 17px;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

/* Vertical icon+label nav items (app-style) */
.navbar nav {
    display: flex;
    gap: 4px;
    align-items: center;
}
.navbar nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 72px;
    position: relative;
}
.navbar nav a:hover { text-decoration: none; }
.navbar nav a .nav-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}
.navbar nav a .nav-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #64748b;
    transition: color 0.15s;
}
.navbar nav a:hover .nav-icon-wrap {
    background: #ede9fe;
    color: var(--primary);
    transform: translateY(-2px);
}
.navbar nav a:hover .nav-label {
    color: var(--primary);
}
.navbar nav a.active .nav-icon-wrap,
.navbar nav a[aria-current="page"] .nav-icon-wrap {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    box-shadow: 0 6px 14px rgba(124, 58, 237, 0.4);
}
.navbar nav a.active .nav-label,
.navbar nav a[aria-current="page"] .nav-label {
    color: var(--primary);
    font-weight: 800;
}

/* User menu */
.navbar .user-menu {
    display: flex;
    gap: 10px;
    align-items: center;
}

.navbar-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    border-radius: 999px;
    font-weight: 600;
    color: #0f172a;
    transition: all 0.15s;
}
.navbar-user-chip:hover {
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
}
.navbar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.35);
}
.navbar-user-name-small {
    font-size: 14px;
    font-weight: 700;
    color: #4c1d95;
    line-height: 1.2;
}

.navbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: white;
    color: #94a3b8;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: inset 0 0 0 1px #e2e8f0;
    padding: 0;
    position: relative;
}
.navbar-logout:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}
.navbar-logout::after {
    content: 'خروج';
    position: absolute;
    top: calc(100% + 8px);
    right: 50%;
    transform: translateX(50%);
    background: #0f172a;
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}
.navbar-logout:hover::after { opacity: 1; }

/* Login button (guest) */
.navbar-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
    transition: all 0.15s;
}
.navbar-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.45);
    color: white;
    text-decoration: none;
}

@media (min-width: 769px) and (max-width: 1000px) {
    .navbar-user-name-small { display: none; }
    .navbar-user-chip { padding: 5px; }
    .navbar nav a { min-width: 62px; padding: 4px 10px; }
}

/* ============ Mobile Drawer Menu ============ */
.drawer-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: var(--primary);
    border: none;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.15);
    padding: 0;
}
.drawer-toggle:hover {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: var(--primary-dark);
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 98;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 88vw;
    max-width: 340px;
    background: white;
    z-index: 99;
    transform: translateX(105%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    padding: 26px 22px calc(26px + env(safe-area-inset-top));
    position: relative;
}
.drawer-close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
    padding: 0;
}
.drawer-close:hover { background: rgba(255, 255, 255, 0.32); }

.drawer-user {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
}
.drawer-user-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.drawer-user-info { flex: 1; min-width: 0; }
.drawer-user-name {
    font-size: 17px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.drawer-user-role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #f3e8ff;
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.drawer-guest-cta {
    display: block;
    margin-top: 18px;
    padding: 12px 20px;
    background: white;
    color: var(--primary-dark);
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.15s;
}
.drawer-guest-cta:hover { transform: translateY(-1px); color: var(--primary-dark); text-decoration: none; }

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
}
.drawer-section-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 8px 14px;
    margin-top: 6px;
    margin-bottom: 6px;
}
.drawer-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    color: #334155;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s;
    margin-bottom: 4px;
}
.drawer-link:hover {
    background: #f5f3ff;
    color: var(--primary);
    text-decoration: none;
    transform: translateX(-3px);
}
[dir="rtl"] .drawer-link:hover { transform: translateX(3px); }
.drawer-link.active {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: var(--primary);
}
.drawer-link.active .drawer-link-icon {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}
.drawer-link-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    transition: all 0.15s;
}
.drawer-link:hover .drawer-link-icon {
    background: #ede9fe;
    color: var(--primary);
}
.drawer-link-text { flex: 1; }
.drawer-link-arrow { color: #cbd5e1; font-size: 12px; }

.drawer-footer {
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: #f9fafb;
}
.drawer-logout-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: var(--danger);
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.15);
}
.drawer-logout-btn:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* ============ Mobile Bottom Bar Navigation ============ */
@media (max-width: 768px) {
    .drawer-toggle { display: inline-flex; }

    /* Simplified mobile footer — copyright only */
    .public-footer {
        padding: 20px 20px calc(100px + env(safe-area-inset-bottom));
        text-align: center;
        background: #0b1120;
    }
    .public-footer .footer-grid { display: none; }
    .public-footer .footer-bottom {
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 8px;
        text-align: center;
        justify-content: center;
        box-shadow: none;
        font-size: 12px;
        color: #94a3b8;
        line-height: 1.7;
    }
    .public-footer .footer-bottom strong { color: white; }
    .navbar { padding: 12px 0; }
    .navbar .container {
        justify-content: space-between;
        gap: 10px;
        padding: 0 16px;
    }
    .navbar .brand { font-size: 17px; gap: 8px; }
    .navbar .brand::before { width: 36px; height: 36px; font-size: 15px; }

    /* Move top navigation to bottom bar */
    .navbar nav {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 60;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: saturate(180%) blur(16px);
        -webkit-backdrop-filter: saturate(180%) blur(16px);
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.1);
        display: flex;
        justify-content: space-around;
        gap: 0;
        border-radius: 20px 20px 0 0;
    }
    .navbar nav a {
        flex: 1;
        min-width: 0;
        padding: 6px 4px;
        gap: 3px;
        border-radius: 12px;
    }
    .navbar nav a .nav-icon-wrap {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
    .navbar nav a .nav-label { font-size: 10px; letter-spacing: 0.1px; }

    /* Compact user area at top */
    .navbar-user-name-small { display: none; }
    .navbar-user-chip { padding: 4px; background: transparent; box-shadow: none; }
    .navbar-user-chip:hover { background: transparent; box-shadow: none; }
    .navbar-user-avatar { width: 34px; height: 34px; font-size: 13px; }
    .navbar-logout {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }
    .navbar-logout::after { display: none; }
    .navbar-login-btn { padding: 8px 16px; font-size: 13px; }

    /* Prevent bottom bar from hiding content */
    body { padding-bottom: 90px; }
    .public-footer, footer { margin-bottom: 20px; }
}

/* Layout */
main { padding: 30px 0; min-height: calc(100vh - 120px); }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-title { font-size: 26px; font-weight: 700; margin: 0; }
.page-subtitle { color: var(--muted); margin-top: 4px; }

/* Card */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-title { font-size: 18px; font-weight: 700; margin: 0; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.15s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; color: white; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--accent); }
.btn-success:hover { background: #059669; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.form-textarea { min-height: 90px; resize: vertical; }
.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 4px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.table th, .table td {
    padding: 14px 18px;
    text-align: right;
}
.table thead {
    background: #f9fafb;
}
.table th {
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
}
.table tbody tr:nth-child(even) { background: #fafbfc; }
.table tbody tr:hover { background: #f1f5f9; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-primary { background: #ede9fe; color: var(--primary-dark); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-muted { background: #f3f4f6; color: var(--muted); }

/* Grid */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Stat cards */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--text); }

/* Auth pages — Elegant white with side illustration */
.auth-page {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}
@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; gap: 24px; min-height: auto; padding: 20px 0; }
}
.auth-visual {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    border-radius: 24px;
    padding: 48px 40px;
    color: white;
    position: relative;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.25);
}
@media (max-width: 900px) { .auth-visual { min-height: auto; padding: 32px 24px; } }
.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}
.auth-visual::after {
    content: '';
    position: absolute;
    top: -80px;
    left: -60px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.35) 0%, transparent 65%);
    filter: blur(20px);
    pointer-events: none;
}
.auth-visual > * { position: relative; z-index: 2; }
.auth-visual-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
    align-self: flex-start;
}
.auth-visual h2 {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 14px;
    letter-spacing: -0.5px;
    line-height: 1.3;
}
.auth-visual p { opacity: 0.9; margin: 0 0 30px; line-height: 1.85; font-size: 15px; }

.auth-benefits {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.auth-benefit {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    border-radius: 14px;
    transition: transform 0.2s;
}
.auth-benefit:hover { transform: translateX(-4px); }
[dir="rtl"] .auth-benefit:hover { transform: translateX(4px); }
.auth-benefit-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: #fbbf24;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.auth-benefit-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}
.auth-benefit-text strong { display: block; font-weight: 800; margin-bottom: 2px; }
.auth-benefit-text span { opacity: 0.85; font-size: 12px; }

.auth-form-side {
    display: flex;
    flex-direction: column;
    padding: 20px;
}
@media (max-width: 900px) { .auth-form-side { padding: 10px 0; } }

.auth-form-header { margin-bottom: 28px; }
.auth-form-header h1 {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}
.auth-form-header p { color: var(--muted); margin: 0; font-size: 15px; }

.auth-form .form-group { margin-bottom: 18px; }
.auth-form .form-input {
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid transparent;
    box-shadow: inset 0 0 0 1px #e5e7eb;
    transition: all 0.15s;
}
.auth-form .form-input:focus {
    background: white;
    box-shadow: inset 0 0 0 2px var(--primary), 0 0 0 4px rgba(124, 58, 237, 0.08);
}
.auth-input-wrap { position: relative; }
.auth-input-wrap .form-input { padding-inline-start: 46px; }
.auth-input-wrap .auth-input-icon {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
}
.auth-input-wrap .form-input:focus + .auth-input-icon { color: var(--primary); }

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #475569;
    cursor: pointer;
}
.auth-remember input { accent-color: var(--primary); width: 16px; height: 16px; }

.auth-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(124, 58, 237, 0.45); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-demo-accounts {
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.1);
}
.auth-demo-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    color: #6b21a8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
}
.auth-demo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.auth-demo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: transform 0.15s;
}
.auth-demo-item:hover { transform: translateX(-3px); }
[dir="rtl"] .auth-demo-item:hover { transform: translateX(3px); }
.auth-demo-role {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}
.auth-demo-role.admin   { background: linear-gradient(135deg, #ef4444, #dc2626); }
.auth-demo-role.student { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.auth-demo-role.parent  { background: linear-gradient(135deg, #10b981, #059669); }
.auth-demo-info { flex: 1; min-width: 0; }
.auth-demo-role-label {
    font-weight: 700;
    color: #0f172a;
    font-size: 13px;
    margin-bottom: 2px;
}
.auth-demo-email {
    color: var(--muted);
    font-size: 11px;
    direction: ltr;
    text-align: end;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Legacy auth-wrap fallback (unused now but preserved) */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}
.auth-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
.auth-brand {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}
.auth-subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 28px;
}

/* Question card */
.question-block {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}
.question-number {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}
.question-text {
    font-size: 18px;
    font-weight: 600;
    margin: 8px 0 20px;
    color: var(--text);
}
.option-item {
    display: block;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.option-item:hover {
    border-color: var(--primary);
    background: #f5f3ff;
}
.option-item input[type="radio"] { margin-left: 10px; }
.option-item.selected {
    border-color: var(--primary);
    background: #ede9fe;
}

/* Progress bar */
.progress {
    background: var(--border);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}
.progress-bar {
    background: var(--accent);
    height: 100%;
    transition: width 0.3s;
}
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* Empty state */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* Actions cell */
.actions { display: flex; gap: 8px; }

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 13px;
    background: var(--surface);
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.04);
    margin-top: 40px;
}

/* Utilities */
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.d-flex { display: flex; }
.gap-2 { gap: 12px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* ============ Sidebar Layout (Admin) ============ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #ffffff;
    color: var(--text);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 28px 20px 20px;
    text-align: center;
}
.sidebar-brand {
    color: var(--primary);
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    display: block;
    letter-spacing: 0.5px;
}
.sidebar-brand:hover { text-decoration: none; color: var(--primary-dark); }
.sidebar-tagline {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}
.sidebar-section-title {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 16px;
    margin: 16px 0 8px;
    letter-spacing: 1px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #4b5563;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.sidebar-link:hover {
    background: #f3f4f6;
    color: var(--primary);
    text-decoration: none;
}
.sidebar-link.active {
    background: #eef2ff;
    color: var(--primary);
    font-weight: 600;
}
.sidebar-link.active .sidebar-icon {
    color: var(--primary);
}
.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px;
    background: #f9fafb;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    margin-bottom: 8px;
}
.sidebar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-role {
    color: var(--muted);
    font-size: 12px;
}
.sidebar-logout {
    width: 100%;
    padding: 10px;
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
}
.sidebar-logout:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.app-content {
    margin-right: 260px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--surface);
    padding: 18px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 4px;
}
.topbar-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}
.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

.app-main {
    padding: 30px;
    flex: 1;
}

/* Sidebar responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .app-content { margin-right: 0; }
    .topbar-toggle { display: block; }
}

/* ============ Question Form (Rich Editor) ============ */
.q-editor {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 1100px) {
    .q-editor { grid-template-columns: 1fr; }
}

.q-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.q-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.q-section-title i { color: var(--primary); font-size: 16px; }
.q-section-hint {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.type-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.type-option {
    position: relative;
    cursor: pointer;
    background: #f9fafb;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.15s;
    box-shadow: 0 0 0 2px transparent inset;
}
.type-option:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}
.type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.type-option i {
    font-size: 24px;
    color: var(--muted);
    margin-bottom: 8px;
    display: block;
    transition: color 0.15s;
}
.type-option-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.type-option.active {
    background: #eef2ff;
    box-shadow: 0 0 0 2px var(--primary) inset;
}
.type-option.active i { color: var(--primary); }
.type-option.active .type-option-label { color: var(--primary-dark); }

.q-textarea-lg {
    font-size: 16px;
    min-height: 130px;
    padding: 16px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: all 0.15s;
    box-shadow: 0 0 0 2px transparent inset;
}
.option-row:hover { background: #f3f4f6; }
.option-row.selected {
    background: #ecfdf5;
    box-shadow: 0 0 0 2px var(--accent) inset;
}
.option-radio-wrap {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
}
.option-row.selected .option-radio-wrap {
    background: var(--accent);
    color: white;
}
.option-row input[type="radio"] { display: none; }
.option-row input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    padding: 6px 4px;
    outline: none;
    color: var(--text);
}
.option-row input[type="text"]::placeholder { color: #9ca3af; }
.option-row .correct-badge {
    font-size: 11px;
    color: var(--accent);
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.15s;
}
.option-row.selected .correct-badge { opacity: 1; }

.q-side-info {
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border-radius: var(--radius);
    padding: 22px;
}
.q-side-info h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.q-side-info ul {
    padding: 0;
    margin: 0;
    list-style: none;
    font-size: 13px;
    color: var(--text);
    line-height: 1.9;
}
.q-side-info li {
    display: flex;
    gap: 8px;
    align-items: start;
}
.q-side-info li i {
    color: var(--accent);
    margin-top: 5px;
    font-size: 11px;
}

.q-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 24px;
    box-shadow: var(--shadow);
    margin-top: 20px;
}
.q-actions .btn { padding: 12px 28px; font-size: 15px; }

/* ============ Parent Dashboard — Children Cards ============ */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.child-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}
.child-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
}

.child-header {
    padding: 24px 22px;
    color: white;
    position: relative;
    overflow: hidden;
}
.child-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 18px 18px;
    pointer-events: none;
}
.child-header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 2;
}
.child-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.child-info { flex: 1; min-width: 0; }
.child-name {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.child-email {
    font-size: 12px;
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.child-level-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.child-body {
    padding: 20px 22px;
    flex: 1;
}

.child-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 14px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 14px;
}
.child-stat { text-align: center; }
.child-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    line-height: 1;
}
.child-stat-lbl {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    margin-top: 4px;
}

.child-grade-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-radius: 12px;
    margin-bottom: 14px;
}
.child-grade-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}
.child-grade-label { font-size: 11px; color: #6b21a8; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.child-grade-name { font-size: 15px; font-weight: 800; color: #4c1d95; }
.child-grade-pct {
    margin-inline-start: auto;
    font-size: 20px;
    font-weight: 800;
    color: #4c1d95;
    letter-spacing: -0.5px;
}

.child-subjects-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.child-subject-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
}
.child-subject-mini.best {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
}
.child-subject-mini.worst {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
}
.child-subject-mini > i {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}
.child-subject-mini.best > i { background: linear-gradient(135deg, #10b981, #059669); }
.child-subject-mini.worst > i { background: linear-gradient(135deg, #ef4444, #dc2626); }
.child-subject-mini > div { flex: 1; }
.child-subject-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; opacity: 0.8; }
.child-subject-name { font-size: 14px; font-weight: 700; }
.child-subject-pct { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }

.child-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: #f9fafb;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: background 0.15s;
}
.child-view-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    text-decoration: none;
}
.child-view-btn i:first-child { font-size: 13px; }
.child-view-btn i:last-child { font-size: 11px; opacity: 0.75; }

/* ============ Static/Content Pages ============ */
.page-hero {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    border-radius: 24px;
    padding: 50px 40px;
    margin-bottom: 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.25);
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}
.page-hero > * { position: relative; z-index: 2; }
.page-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 18px;
}
.page-hero-title {
    font-size: 40px;
    font-weight: 800;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}
.page-hero-desc {
    font-size: 16px;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}
.page-hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    opacity: 0.85;
}

.page-content {
    background: white;
    border-radius: 20px;
    padding: 48px 44px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    line-height: 1.9;
    color: #334155;
    font-size: 15px;
}
.page-content h1, .page-content h2, .page-content h3, .page-content h4 {
    color: #0f172a;
    margin-top: 1.4em;
    margin-bottom: 0.5em;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.page-content h1 { font-size: 28px; }
.page-content h2 { font-size: 24px; }
.page-content h3 { font-size: 20px; }
.page-content h4 { font-size: 17px; }
.page-content p { margin: 0 0 1em; }
.page-content ul, .page-content ol {
    margin: 0 0 1em;
    padding-inline-start: 24px;
}
.page-content li { margin-bottom: 6px; }
.page-content a { color: var(--primary); text-decoration: underline; }
.page-content img { max-width: 100%; height: auto; border-radius: 10px; margin: 12px 0; }
.page-content blockquote {
    background: #f9fafb;
    padding: 16px 20px;
    border-radius: 10px;
    color: #475569;
    margin: 16px 0;
    font-style: italic;
}
.page-content code {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--primary-dark);
}
.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.page-content table th, .page-content table td {
    padding: 10px 14px;
    text-align: right;
    background: #fafbfc;
}
.page-content table th { background: #f1f5f9; font-weight: 700; }

/* Contact page */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.contact-card {
    background: white;
    border-radius: 18px;
    padding: 26px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
    text-decoration: none;
    color: inherit;
}
.contact-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
}
.contact-card h3 {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 6px;
}
.contact-card p {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 12px;
}
.contact-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 15px;
    padding: 8px 14px;
    background: #f5f3ff;
    border-radius: 8px;
    display: inline-block;
}
.contact-social-strip {
    background: white;
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* ============ Public Landing Page ============ */
.public-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    padding: 14px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 50;
}
.public-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
}
.public-nav-brand {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.public-nav-brand:hover { text-decoration: none; }
.public-nav-brand-badge {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.public-nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
}
.public-nav-links > a:not(.btn-pill) {
    color: #374151;
    font-weight: 500;
    font-size: 14px;
    padding: 6px 4px;
    position: relative;
}
.public-nav-links > a:not(.btn-pill):hover { color: var(--primary); text-decoration: none; }
.public-nav-links > a:not(.btn-pill)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.2s;
}
.public-nav-links > a:not(.btn-pill):hover::after { width: 100%; }

.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white !important;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
    text-decoration: none;
    color: white;
}

/* Hero */
.hero {
    background:
        radial-gradient(1200px 500px at 90% -10%, rgba(236, 72, 153, 0.15), transparent 60%),
        radial-gradient(1000px 500px at 10% 10%, rgba(59, 130, 246, 0.15), transparent 55%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    padding: 90px 0 140px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(79, 70, 229, 0.08) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.4;
    pointer-events: none;
}
.hero .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}
@media (max-width: 900px) {
    .hero .container { grid-template-columns: 1fr; text-align: center; }
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--primary);
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.12);
}
.hero-tag i { color: #f59e0b; }
.hero h1 {
    font-size: 54px;
    font-weight: 800;
    margin: 0 0 20px;
    line-height: 1.2;
    color: #0f172a;
    letter-spacing: -0.5px;
}
.hero h1 .grad-text {
    background: linear-gradient(90deg, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: 18px;
    color: #475569;
    margin: 0 0 32px;
    line-height: 1.85;
    max-width: 560px;
}
@media (max-width: 900px) { .hero p { margin-inline: auto; } }

.hero-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
@media (max-width: 900px) { .hero-buttons { justify-content: center; } }
.btn-hero {
    padding: 15px 30px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}
.btn-hero:hover { transform: translateY(-2px); text-decoration: none; }
.btn-hero-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
}
.btn-hero-primary:hover { color: white; box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45); }
.btn-hero-outline {
    background: white;
    color: var(--primary);
    border: 2px solid #e5e7eb;
}
.btn-hero-outline:hover { border-color: var(--primary); color: var(--primary); }

.hero-social {
    display: flex;
    gap: 20px;
    margin-top: 36px;
    padding-top: 28px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
}
.hero-avatars {
    display: flex;
}
.hero-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 0 0 3px white;
    margin-inline-end: -10px;
}
.hero-avatar:nth-child(2) { background: linear-gradient(135deg, #60a5fa, #34d399); }
.hero-avatar:nth-child(3) { background: linear-gradient(135deg, #fbbf24, #f97316); }
.hero-avatar:nth-child(4) { background: linear-gradient(135deg, #ec4899, #ef4444); }

/* Hero visual - mock dashboard */
.hero-visual {
    position: relative;
    height: 440px;
}
@media (max-width: 900px) { .hero-visual { display: none; } }
.mock-card {
    position: absolute;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);
    padding: 20px;
    transition: transform 0.3s;
}
.mock-card:hover { transform: translateY(-4px); }
.mock-main {
    inset-inline-start: 0;
    top: 20px;
    width: 100%;
    padding: 24px;
    animation: floatY 6s ease-in-out infinite;
}
.mock-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.mock-badge {
    background: #eef2ff;
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.mock-title { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.mock-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; }

.mock-score-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #10b981 0% 84%, #e5e7eb 84% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.mock-score-ring::before {
    content: '';
    position: absolute;
    inset: 8px;
    background: white;
    border-radius: 50%;
}
.mock-score-value {
    position: relative;
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    z-index: 1;
}
.mock-score-label { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 20px; }

.mock-bars { display: flex; flex-direction: column; gap: 12px; }
.mock-bar-row { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.mock-bar-label { min-width: 70px; color: #334155; font-weight: 600; }
.mock-bar-track {
    flex: 1;
    background: #f1f5f9;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.mock-bar-fill { height: 100%; border-radius: 999px; }
.mock-bar-value { color: var(--muted); font-weight: 600; min-width: 34px; text-align: end; }

.mock-float {
    position: absolute;
    background: white;
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    z-index: 3;
}
.mock-float-1 {
    top: -14px;
    inset-inline-end: -18px;
    animation: floatY 5s ease-in-out infinite;
    animation-delay: 0.5s;
}
.mock-float-2 {
    bottom: -10px;
    inset-inline-start: -14px;
    animation: floatY 6s ease-in-out infinite;
    animation-delay: 1s;
}
.mock-float-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.mock-float-1 .mock-float-icon { background: linear-gradient(135deg, #10b981, #059669); }
.mock-float-2 .mock-float-icon { background: linear-gradient(135deg, #f59e0b, #ef4444); }

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Stats bar */
.public-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1140px;
    margin: -70px auto 0;
    padding: 0 28px;
    position: relative;
    z-index: 4;
}
.public-stat {
    background: white;
    padding: 26px 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.03);
    transition: transform 0.2s;
}
.public-stat:hover { transform: translateY(-4px); }
.public-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
    color: white;
}
.public-stat:nth-child(1) .public-stat-icon { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.public-stat:nth-child(2) .public-stat-icon { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.public-stat:nth-child(3) .public-stat-icon { background: linear-gradient(135deg, #10b981, #14b8a6); }
.public-stat:nth-child(4) .public-stat-icon { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.public-stat-value { font-size: 32px; font-weight: 800; color: #0f172a; letter-spacing: -0.5px; }
.public-stat-label { color: var(--muted); font-size: 14px; margin-top: 4px; font-weight: 500; }
@media (max-width: 800px) { .public-stats { grid-template-columns: repeat(2, 1fr); } }

/* Sections */
.public-section {
    padding: 100px 0;
}
.public-section-alt { background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%); }
.public-section .container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 28px;
}
.section-eyebrow {
    text-align: center;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.public-section-title {
    text-align: center;
    font-size: 38px;
    font-weight: 800;
    margin: 0 0 14px;
    color: #0f172a;
    letter-spacing: -0.5px;
}
.public-section-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 17px;
    max-width: 640px;
    margin: 0 auto 64px;
    line-height: 1.8;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 900px) { .features-grid { grid-template-columns: 1fr; } }
.feature-card {
    background: white;
    padding: 32px 28px;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(15, 23, 42, 0.03);
    transition: transform 0.25s, box-shadow 0.25s;
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--fc-accent, var(--primary)), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--fc-bg, linear-gradient(135deg, #4f46e5, #7c3aed));
    color: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 22px;
    box-shadow: 0 8px 20px var(--fc-shadow, rgba(79, 70, 229, 0.3));
}
.feature-card h3 {
    font-size: 20px;
    margin: 0 0 12px;
    color: #0f172a;
    font-weight: 700;
}
.feature-card p {
    color: #475569;
    line-height: 1.8;
    margin: 0;
    font-size: 15px;
}

/* Steps with connecting line */
.steps-wrap {
    position: relative;
    padding: 20px 0;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    position: relative;
    z-index: 2;
}
@media (max-width: 900px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .steps-grid { grid-template-columns: 1fr; } }
.step-card {
    background: white;
    padding: 32px 22px 26px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    position: relative;
    transition: transform 0.2s;
}
.step-card:hover { transform: translateY(-4px); }
.step-number {
    position: absolute;
    top: -22px;
    right: 50%;
    transform: translateX(50%);
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}
.step-icon {
    font-size: 36px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 16px 0 18px;
}
.step-card h4 { font-size: 17px; margin: 0 0 8px; color: #0f172a; }
.step-card p { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0; }

/* Subjects */
.subjects-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}
.subject-chip {
    background: white;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
    cursor: default;
}
.subject-chip:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.1);
}
.subject-chip-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #ede9fe, #dbeafe);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.subject-chip-info h4 { font-size: 15px; margin: 0 0 4px; color: #0f172a; }
.subject-chip-info p { font-size: 12px; color: var(--muted); margin: 0; }

/* Levels showcase */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 800px) { .levels-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .levels-grid { grid-template-columns: 1fr; } }
.level-card {
    background: white;
    padding: 30px 22px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s;
}
.level-card:hover { transform: translateY(-4px); }
.level-icon-lg {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin-bottom: 16px;
}
.level-card.lv-beginner .level-icon-lg { background: linear-gradient(135deg, #fca5a5, #ef4444); }
.level-card.lv-intermediate .level-icon-lg { background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.level-card.lv-advanced .level-icon-lg { background: linear-gradient(135deg, #93c5fd, #3b82f6); }
.level-card.lv-expert .level-icon-lg { background: linear-gradient(135deg, #6ee7b7, #10b981); }
.level-card h4 { margin: 0 0 6px; font-size: 18px; color: #0f172a; }
.level-card p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }

/* ============ Test Taking Page ============ */
.test-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 1000px) {
    .test-layout { grid-template-columns: 1fr; }
    .test-sidebar { display: none; }
}

.test-sidebar {
    position: sticky;
    top: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    padding: 22px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.test-sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 18px;
}
.test-sidebar-title i { color: var(--primary); }

.mini-ring-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.mini-ring {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--primary) 0% var(--progress, 0%), #f1f5f9 var(--progress, 0%) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.4s;
}
.mini-ring::before {
    content: '';
    position: absolute;
    inset: 10px;
    background: white;
    border-radius: 50%;
}
.mini-ring-inner {
    position: relative;
    text-align: center;
    z-index: 1;
}
.mini-ring-value {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}
.mini-ring-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    font-weight: 600;
}

.q-nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 22px;
}
.q-nav-btn {
    aspect-ratio: 1;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    border: none;
    font-family: inherit;
}
.q-nav-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    text-decoration: none;
    transform: translateY(-1px);
}
.q-nav-btn.answered {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}
.q-nav-btn.answered:hover { color: white; }
.q-nav-btn.current {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
    transform: scale(1.08);
}
.q-nav-btn.current:hover { color: white; }

.test-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
    padding: 14px;
    background: #f9fafb;
    border-radius: 12px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #475569;
}
.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}
.legend-dot.unanswered { background: #e2e8f0; }
.legend-dot.answered { background: linear-gradient(135deg, #10b981, #059669); }
.legend-dot.current { background: linear-gradient(135deg, var(--primary), #7c3aed); }

.subject-summary {
    padding-top: 18px;
    box-shadow: inset 0 1px 0 var(--border);
}
.subject-summary-title {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.subject-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #334155;
}
.subject-summary-item .badge {
    padding: 2px 8px;
    font-size: 11px;
    background: #eef2ff;
    color: var(--primary);
    border-radius: 999px;
    font-weight: 700;
}

.q-card { scroll-margin-top: 20px; }

/* One question at a time */
.q-card {
    display: none;
    animation: qSlideIn 0.3s ease;
}
.q-card.is-active { display: block; }
@keyframes qSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Prev / Next navigation buttons */
.test-nav-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}
.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: white;
    color: #334155;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.06);
    transition: all 0.15s;
    border: none;
}
.btn-nav:hover:not(:disabled) {
    background: #f8fafc;
    color: var(--primary);
    text-decoration: none;
    transform: translateY(-1px);
}
.btn-nav:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.btn-nav-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white !important;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}
.btn-nav-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), #6d28d9);
    color: white !important;
}

/* ============ Premium Result Page ============ */
.result-hero {
    position: relative;
    background:
        radial-gradient(circle at 15% 25%, rgba(236, 72, 153, 0.35) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(59, 130, 246, 0.35) 0%, transparent 40%),
        linear-gradient(135deg, #1e1b4b 0%, #4f46e5 50%, #7c3aed 100%);
    color: white;
    border-radius: 28px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(79, 70, 229, 0.35);
    overflow: hidden;
    margin-bottom: 28px;
}
.result-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}
.result-hero > * { position: relative; z-index: 2; }

.result-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 24px;
}
.result-hero-eyebrow i { color: #fcd34d; }

.result-ring {
    width: 240px;
    height: 240px;
    margin: 0 auto 30px;
    position: relative;
}
.result-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.result-ring circle { fill: none; stroke-width: 14; stroke-linecap: round; }
.result-ring .track { stroke: rgba(255, 255, 255, 0.15); }
.result-ring .value {
    stroke: url(#ringGradient);
    stroke-dasharray: 691.15;
    stroke-dashoffset: 691.15;
    transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.6));
}
.result-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.result-ring-value {
    font-size: 60px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
}
.result-ring-sub {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 600;
}

.result-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}
.result-classification-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    margin-top: 12px;
}
.result-classification-chip i { font-size: 18px; }

.result-hero-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 26px;
    flex-wrap: wrap;
    font-size: 14px;
}
.result-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}
.result-hero-meta-item i { color: #fcd34d; }

/* Confetti (CSS-only) */
.confetti {
    position: absolute;
    top: -20px;
    width: 8px;
    height: 14px;
    opacity: 0;
    animation: confettiFall 2.4s ease-in forwards;
}
@keyframes confettiFall {
    0%   { transform: translateY(-20px) rotate(0);   opacity: 1; }
    100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

/* Redesigned stat cards */
.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
@media (max-width: 800px) { .result-stats { grid-template-columns: 1fr; } }
.result-stat {
    background: white;
    padding: 26px;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(15, 23, 42, 0.03);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s;
}
.result-stat:hover { transform: translateY(-3px); }
.result-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
}
.result-stat-1 .result-stat-icon { background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35); }
.result-stat-2 .result-stat-icon { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35); }
.result-stat-3 .result-stat-icon { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35); }
.result-stat-content { flex: 1; min-width: 0; }
.result-stat-label { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.result-stat-value {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.5px;
}
.result-stat-value-sm { font-size: 18px; }
.result-stat-delta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    margin-inline-start: 8px;
}
.delta-up   { color: #10b981; }
.delta-down { color: #ef4444; }
.delta-flat { color: var(--muted); }

/* Comparison card */
.result-compare {
    background: white;
    padding: 28px;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: center;
}
@media (max-width: 700px) { .result-compare { grid-template-columns: 1fr; text-align: center; } }
.compare-col { text-align: center; }
.compare-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.compare-value {
    font-size: 44px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -1px;
}
.compare-arrow {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: linear-gradient(135deg, #eef2ff, #ede9fe);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.compare-arrow.up { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #059669; }
.compare-arrow.down { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #dc2626; }

/* Subject breakdown - premium cards */
.result-subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.subject-result-card {
    background: white;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(15, 23, 42, 0.03);
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}
.subject-result-card:hover { transform: translateY(-3px); }

.sr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 10px;
}
.sr-name { font-weight: 700; font-size: 16px; color: #0f172a; }
.sr-score {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}
.sr-progress {
    background: #f1f5f9;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}
.sr-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.sr-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
}

/* Weak/Success sections */
.weak-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.weak-card {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    gap: 16px;
    align-items: start;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}
.weak-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.35);
}
.weak-name { font-weight: 800; color: #7c2d12; font-size: 16px; margin-bottom: 4px; }
.weak-percent { font-weight: 700; color: #92400e; font-size: 14px; margin-bottom: 6px; }
.weak-desc { color: #92400e; font-size: 13px; opacity: 0.85; }

.success-banner {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2);
}
.success-banner-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.4);
}
.success-banner-title { font-size: 18px; font-weight: 800; color: #065f46; margin-bottom: 4px; }
.success-banner-desc { color: #065f46; font-size: 14px; opacity: 0.9; }

/* Section header */
.result-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 32px 0 16px;
}
.result-section-title h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
}
.result-section-title h2 i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #eef2ff, #ede9fe);
    color: var(--primary);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Actions bar */
.result-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    margin-top: 24px;
    flex-wrap: wrap;
}
.result-actions .btn-hero { padding: 12px 24px; font-size: 14px; }

/* ============ Results Page (Timeline + Chart) ============ */
.results-hero {
    background:
        radial-gradient(circle at 20% 30%, rgba(236, 72, 153, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.25) 0%, transparent 45%),
        linear-gradient(135deg, #1e1b4b 0%, #4f46e5 60%, #7c3aed 100%);
    color: white;
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.3);
}
.results-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}
.results-hero > * { position: relative; z-index: 2; }
.results-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 14px;
}
.results-hero h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}
.results-hero p { opacity: 0.85; margin: 0 0 24px; font-size: 15px; }

.results-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 900px) { .results-summary { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .results-summary { grid-template-columns: 1fr; } }
.rs-stat {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: rsSlideUp 0.5s ease backwards;
}
.rs-stat:nth-child(1) { animation-delay: 0.05s; }
.rs-stat:nth-child(2) { animation-delay: 0.12s; }
.rs-stat:nth-child(3) { animation-delay: 0.19s; }
.rs-stat:nth-child(4) { animation-delay: 0.26s; }
@keyframes rsSlideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rs-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.rs-stat-label { font-size: 12px; opacity: 0.85; margin-bottom: 2px; }
.rs-stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }

/* Chart panel */
.results-chart-panel {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
    margin-bottom: 24px;
    animation: fadeUp 0.6s ease 0.15s backwards;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.results-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}
.results-chart-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}
.results-chart-title i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.3);
}
.results-chart-legend {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--muted);
}
.results-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.legend-swatch { width: 12px; height: 12px; border-radius: 4px; }

.chart-body { position: relative; height: 320px; }
.chart-dual {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.chart-subtitle {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chart-subtitle::before {
    content: '';
    width: 4px;
    height: 14px;
    background: linear-gradient(180deg, var(--primary), #7c3aed);
    border-radius: 2px;
}
.chart-scores { height: 240px; position: relative; }
.chart-changes { height: 180px; position: relative; }
.chart-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
}
.chart-empty-icon {
    font-size: 44px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

/* Timeline of results */
.results-timeline-panel {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
    animation: fadeUp 0.6s ease 0.25s backwards;
}
.timeline-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.timeline-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}
.timeline-title i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.3);
}

.timeline {
    position: relative;
    padding-inline-end: 40px;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 18px;
    width: 3px;
    background: linear-gradient(180deg, #eef2ff, #ede9fe);
    border-radius: 999px;
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
    animation: timelineSlide 0.5s ease backwards;
}
.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.15s; }
.timeline-item:nth-child(3) { animation-delay: 0.25s; }
.timeline-item:nth-child(4) { animation-delay: 0.35s; }
.timeline-item:nth-child(5) { animation-delay: 0.45s; }
.timeline-item:nth-child(6) { animation-delay: 0.55s; }
.timeline-item:nth-child(7) { animation-delay: 0.65s; }
.timeline-item:nth-child(8) { animation-delay: 0.75s; }
@keyframes timelineSlide {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}
[dir="rtl"] @keyframes timelineSlide {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.timeline-dot {
    position: absolute;
    top: 20px;
    right: -32px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    z-index: 1;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.timeline-dot.tl-success { background: linear-gradient(135deg, #10b981, #059669); }
.timeline-dot.tl-warning { background: linear-gradient(135deg, #f59e0b, #f97316); }
.timeline-dot.tl-danger  { background: linear-gradient(135deg, #ef4444, #dc2626); }

.timeline-card {
    background: #f9fafb;
    border-radius: 14px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.timeline-card:hover {
    transform: translateX(-4px);
    background: #f3f4f6;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}
@media (max-width: 700px) { .timeline-card { grid-template-columns: 1fr; } }
.timeline-info-title { font-weight: 700; font-size: 15px; color: #0f172a; margin-bottom: 2px; }
.timeline-info-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.timeline-info-meta i { font-size: 10px; }
.timeline-score-block { text-align: center; min-width: 90px; }
.timeline-score {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.5px;
}
.timeline-answers { font-size: 11px; color: var(--muted); margin-top: 2px; }
.timeline-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.tc-up { background: #d1fae5; color: #065f46; }
.tc-down { background: #fee2e2; color: #991b1b; }
.tc-flat { background: #f3f4f6; color: #475569; }
.tc-first { background: #ede9fe; color: #4c1d95; }
.timeline-view {
    background: white;
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}
.timeline-view:hover {
    background: var(--primary);
    color: white;
    text-decoration: none;
}

/* ============ Achievements & Test Cards ============ */
.achievements-panel {
    background: white;
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    margin-bottom: 20px;
}
.achievements-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.achievements-head h2 {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}
.achievements-head i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
@media (max-width: 900px) { .achievements-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .achievements-grid { grid-template-columns: 1fr; } }

.ach-card {
    background: #f9fafb;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.15s, background 0.15s;
}
.ach-card:hover { transform: translateY(-2px); background: #f1f5f9; }
.ach-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}
.ach-1 .ach-icon { background: linear-gradient(135deg, #10b981, #059669); }
.ach-2 .ach-icon { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.ach-3 .ach-icon { background: linear-gradient(135deg, #f59e0b, #f97316); }
.ach-4 .ach-icon { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.ach-info { flex: 1; min-width: 0; }
.ach-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.ach-value {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.ach-sub { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* Test cards grid */
.tests-grid-panel {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    margin-bottom: 20px;
}
.tests-grid-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 12px;
    flex-wrap: wrap;
}
.tests-grid-head h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}
.tests-grid-head h2 i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-chip {
    background: #f1f5f9;
    color: #475569;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filter-chip:hover { background: #e2e8f0; }
.filter-chip.active {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.filter-chip .count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.filter-chip.active .count { background: rgba(255, 255, 255, 0.25); }

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.test-tile {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.test-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.test-tile-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.test-ring {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    position: relative;
}
.test-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.test-ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.test-ring .bg { stroke: #f1f5f9; }
.test-ring .val { transition: stroke-dashoffset 0.8s ease; }
.test-ring-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
}
.test-tile-title { flex: 1; min-width: 0; }
.test-tile-title .num {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 2px;
}
.test-tile-title .date {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.test-tile-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.test-tile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
}
.test-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #334155;
}
.test-stat i {
    width: 24px;
    height: 24px;
    background: white;
    color: var(--primary);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}
.test-stat strong { color: #0f172a; }

.test-tile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
}
.test-change-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.test-change-pill.up { background: #d1fae5; color: #065f46; }
.test-change-pill.down { background: #fee2e2; color: #991b1b; }
.test-change-pill.flat { background: #f3f4f6; color: #475569; }
.test-change-pill.first { background: #ede9fe; color: #4c1d95; }

.test-view-btn {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
    transition: transform 0.15s;
}
.test-view-btn:hover {
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Level-based subtle background tint (top corner) */
.test-tile[data-lvl="expert"]       { background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 40%); }
.test-tile[data-lvl="advanced"]     { background: linear-gradient(135deg, #eff6ff 0%, #ffffff 40%); }
.test-tile[data-lvl="intermediate"] { background: linear-gradient(135deg, #fffbeb 0%, #ffffff 40%); }
.test-tile[data-lvl="beginner"]     { background: linear-gradient(135deg, #fef2f2 0%, #ffffff 40%); }

/* Filter hidden state */
.test-tile.filter-hidden { display: none; }

/* ============ Question Type Stats ============ */
.type-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.type-stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}
.type-stat-card:hover { transform: translateY(-3px); }
.type-stat-icon-lg {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    margin-bottom: 14px;
}
.type-stat-mcq  .type-stat-icon-lg { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.type-stat-tf   .type-stat-icon-lg { background: linear-gradient(135deg, #10b981, #059669); }
.type-stat-fill .type-stat-icon-lg { background: linear-gradient(135deg, #f59e0b, #f97316); }

.type-stat-label { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.type-stat-name  { font-size: 17px; font-weight: 800; color: #0f172a; margin-bottom: 12px; }
.type-stat-percent {
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 10px;
}
.type-stat-detail { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.type-stat-bar {
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}
.type-stat-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s ease;
}
.type-stat-mcq  .type-stat-bar-fill { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.type-stat-tf   .type-stat-bar-fill { background: linear-gradient(90deg, #10b981, #059669); }
.type-stat-fill .type-stat-bar-fill { background: linear-gradient(90deg, #f59e0b, #f97316); }

/* ============ Next Milestone Progress ============ */
.next-milestone {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 24px;
    align-items: center;
}
@media (max-width: 700px) {
    .next-milestone { grid-template-columns: 1fr; text-align: center; }
}
.nm-icon {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fbbf24;
    flex-shrink: 0;
    margin: 0 auto;
}
@media (min-width: 700px) { .nm-icon { margin: 0; } }
.nm-content { flex: 1; }
.nm-eyebrow {
    font-size: 12px;
    letter-spacing: 2px;
    opacity: 0.7;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 700;
}
.nm-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px;
}
.nm-desc { font-size: 14px; opacity: 0.85; margin: 0 0 14px; line-height: 1.7; }
.nm-progress {
    height: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    overflow: hidden;
}
.nm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f97316);
    border-radius: 999px;
    transition: width 0.8s ease;
}
.nm-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.85;
}
.nm-gap {
    text-align: center;
}
.nm-gap-value {
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    color: #fbbf24;
}
.nm-gap-label { font-size: 12px; opacity: 0.75; font-weight: 600; margin-top: 6px; }

/* ============ Milestones (Badges) ============ */
.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.milestone {
    background: white;
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}
.milestone:hover { transform: translateY(-3px); }
.milestone.locked {
    opacity: 0.55;
    filter: grayscale(0.6);
}
.milestone-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 12px;
    position: relative;
}
.milestone.earned .milestone-icon-wrap {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    color: white;
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.35);
}
.milestone-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.4;
}
.milestone-progress-mini {
    height: 5px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}
.milestone-progress-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f97316);
    border-radius: 999px;
    transition: width 0.8s ease;
}
.milestone.earned .milestone-progress-mini-fill { background: linear-gradient(90deg, #10b981, #059669); }
.milestone-count { font-size: 11px; color: var(--muted); font-weight: 700; }
.milestone.earned::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ Recommendations ============ */
.rec-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rec-item {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-radius: 14px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}
.rec-item.high { background: linear-gradient(135deg, #fef2f2, #fee2e2); box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2); }
.rec-priority {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.rec-item.high .rec-priority {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
.rec-content { flex: 1; }
.rec-title {
    font-weight: 800;
    color: #7c2d12;
    font-size: 15px;
    margin-bottom: 2px;
}
.rec-item.high .rec-title { color: #7f1d1d; }
.rec-desc { font-size: 13px; color: #92400e; opacity: 0.9; }
.rec-item.high .rec-desc { color: #991b1b; }
.rec-percent {
    font-size: 22px;
    font-weight: 800;
    color: #7c2d12;
    letter-spacing: -0.5px;
}
.rec-item.high .rec-percent { color: #7f1d1d; }

.rec-empty {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.2);
}
.rec-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.35);
}
.rec-empty-title { font-weight: 800; color: #065f46; font-size: 16px; margin-bottom: 4px; }
.rec-empty-desc { color: #065f46; font-size: 13px; opacity: 0.9; }

/* Radar chart wrapper */
.radar-wrap {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 30px;
    align-items: center;
    margin-bottom: 20px;
}
@media (max-width: 900px) { .radar-wrap { grid-template-columns: 1fr; } }
.radar-canvas-wrap { position: relative; height: 320px; }
.radar-side h3 { font-size: 18px; margin: 0 0 8px; color: #0f172a; }
.radar-side p { color: var(--muted); line-height: 1.8; margin: 0 0 20px; font-size: 14px; }
.radar-legend { display: flex; flex-direction: column; gap: 10px; }
.radar-legend-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #475569; }

/* ============ Grade Suggestion (Clean Report-Card Style) ============ */
.grade-suggest {
    display: grid;
    grid-template-columns: 220px 1fr;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
@media (max-width: 700px) {
    .grade-suggest { grid-template-columns: 1fr; }
}

.grade-suggest-side {
    background: #0f172a;
    color: white;
    padding: 32px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.grade-suggest-side-label {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.7;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.grade-suggest-side .grade-big-num {
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -3px;
    font-family: 'Cairo', sans-serif;
}
.grade-suggest-side .grade-big-name {
    font-size: 18px;
    font-weight: 700;
    margin-top: 6px;
}

.grade-suggest-body {
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}
.grade-suggest-body-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}
.grade-suggest-body-eyebrow i {
    color: #f59e0b;
    font-size: 14px;
}
.grade-suggest-body h3 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}
.grade-suggest-body p {
    color: #475569;
    line-height: 1.8;
    margin: 0 0 18px;
    font-size: 14px;
}
.grade-suggest-progress {
    display: flex;
    align-items: center;
    gap: 14px;
}
.grade-suggest-progress-bar {
    flex: 1;
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}
.grade-suggest-progress-fill {
    height: 100%;
    background: #0f172a;
    border-radius: 999px;
    transition: width 0.6s ease;
}
.grade-suggest-progress-num {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    min-width: 55px;
    text-align: end;
    letter-spacing: -0.5px;
}

/* Under-threshold variant (needs review) */
.grade-suggest.needs-review .grade-suggest-side {
    background: #7c2d12;
}
.grade-suggest.needs-review .grade-suggest-progress-fill {
    background: #ea580c;
}

/* Grade breakdown cards */
.grades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.grade-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}
.grade-card:hover { transform: translateY(-2px); }
.grade-card.is-suggested {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.35);
}
.grade-card.is-suggested::before {
    content: '\f005';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    left: 8px;
    color: #f59e0b;
    font-size: 12px;
}
.grade-badge {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #eef2ff, #ede9fe);
    color: var(--primary);
}
.grade-card.is-suggested .grade-badge {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    color: white;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}
.grade-info-name { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.grade-info-meta { font-size: 12px; color: var(--muted); }
.grade-info-score {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 2px;
}
.grade-info-score.p-high { color: #059669; }
.grade-info-score.p-mid  { color: #f59e0b; }
.grade-info-score.p-low  { color: #dc2626; }

/* ============ Custom Modal ============ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    padding: 20px;
}
.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}
.modal-card {
    background: white;
    border-radius: 20px;
    max-width: 460px;
    width: 100%;
    padding: 36px 32px 28px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-backdrop.open .modal-card {
    transform: translateY(0) scale(1);
}
.modal-icon {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.35);
    position: relative;
}
.modal-icon.info    { background: linear-gradient(135deg, var(--primary), #7c3aed); box-shadow: 0 10px 28px rgba(79, 70, 229, 0.35); }
.modal-icon.success { background: linear-gradient(135deg, #10b981, #059669);        box-shadow: 0 10px 28px rgba(16, 185, 129, 0.35); }
.modal-icon.danger  { background: linear-gradient(135deg, #ef4444, #dc2626);        box-shadow: 0 10px 28px rgba(239, 68, 68, 0.35); }

.modal-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px;
}
.modal-desc {
    color: #64748b;
    font-size: 15px;
    line-height: 1.75;
    margin: 0 0 28px;
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, box-shadow 0.15s;
    min-width: 130px;
}
.modal-btn:hover { transform: translateY(-1px); }
.modal-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}
.modal-btn-cancel:hover { background: #e2e8f0; }
.modal-btn-confirm {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}
.modal-btn-confirm:hover { box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45); }
.modal-btn-confirm.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.test-progress-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.test-progress-info {
    display: flex;
    flex-direction: column;
    min-width: 130px;
}
.test-progress-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.test-progress-count {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}
.test-progress-count strong { color: var(--primary); }
.test-progress-track {
    flex: 1;
    background: #f1f5f9;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
}
.test-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    border-radius: 999px;
    transition: width 0.3s ease;
    width: 0%;
}
.test-progress-percent {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    min-width: 44px;
    text-align: end;
}

.test-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.25);
}
.test-hero-title { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.test-hero-sub { opacity: 0.9; font-size: 14px; }
.test-hero-icon {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.q-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(15, 23, 42, 0.03);
    padding: 28px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}
.q-card.answered {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1), 0 0 0 2px #10b981;
}
.q-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}
.q-num-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.q-num-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eef2ff, #ede9fe);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}
.q-card.answered .q-num-circle {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}
.q-num-info { display: flex; flex-direction: column; }
.q-num-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.q-num-count { font-size: 15px; font-weight: 700; color: #0f172a; }

.q-subject-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ecfeff, #dbeafe);
    color: #0e7490;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.q-text-large {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.7;
    color: #0f172a;
    margin: 12px 0 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
}

/* MCQ options as cards */
.mcq-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) { .mcq-options { grid-template-columns: 1fr; } }
.opt-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #f9fafb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 0 0 2px transparent inset;
    position: relative;
}
.opt-card:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}
.opt-card input[type="radio"] { display: none; }
.opt-card.selected {
    background: linear-gradient(135deg, #eef2ff, #ede9fe);
    box-shadow: 0 0 0 2px var(--primary) inset;
}
.opt-letter {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: white;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.15s;
}
.opt-card.selected .opt-letter {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}
.opt-text { flex: 1; font-size: 15px; color: #1f2937; font-weight: 500; }
.opt-check {
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.15s;
    font-size: 18px;
}
.opt-card.selected .opt-check { opacity: 1; }

/* True/False - big colored cards */
.tf-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.tf-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f9fafb;
    box-shadow: 0 0 0 2px transparent inset;
}
.tf-card input[type="radio"] { display: none; }
.tf-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    transition: transform 0.2s;
}
.tf-card:hover .tf-icon { transform: scale(1.05); }
.tf-true .tf-icon { background: linear-gradient(135deg, #10b981, #059669); }
.tf-false .tf-icon { background: linear-gradient(135deg, #ef4444, #dc2626); }
.tf-label { font-weight: 800; font-size: 17px; color: #0f172a; }
.tf-card.selected.tf-true {
    background: #ecfdf5;
    box-shadow: 0 0 0 2px #10b981 inset;
}
.tf-card.selected.tf-false {
    background: #fef2f2;
    box-shadow: 0 0 0 2px #ef4444 inset;
}

/* Fill in blank - big input */
.fill-input {
    width: 100%;
    padding: 18px 22px;
    font-size: 17px;
    font-family: inherit;
    background: #f9fafb;
    border: none;
    border-radius: 12px;
    box-shadow: 0 0 0 2px transparent inset;
    outline: none;
    transition: all 0.15s;
    text-align: center;
    font-weight: 600;
    color: #0f172a;
}
.fill-input:focus {
    background: #eef2ff;
    box-shadow: 0 0 0 2px var(--primary) inset;
}
.fill-input:not(:placeholder-shown) {
    background: #ecfdf5;
    box-shadow: 0 0 0 2px #10b981 inset;
}

/* Submit floating bar */
.test-submit-bar {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.test-submit-status {
    font-size: 14px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.test-submit-status.complete { color: var(--accent); }
.test-submit-buttons { display: flex; gap: 10px; }
.btn-submit-test {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
    transition: transform 0.15s;
    font-family: inherit;
}
.btn-submit-test:hover { transform: translateY(-1px); }
.btn-submit-test:disabled {
    background: #e5e7eb;
    color: var(--muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ============ CTA (Rich) ============ */
.cta-section {
    padding: 100px 28px;
    position: relative;
}
.cta-card {
    max-width: 1140px;
    margin: 0 auto;
    background:
        radial-gradient(circle at 15% 20%, rgba(236, 72, 153, 0.25) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 45%),
        linear-gradient(135deg, #1e1b4b 0%, #4f46e5 50%, #7c3aed 100%);
    color: white;
    padding: 80px 60px;
    border-radius: 32px;
    box-shadow: 0 30px 70px rgba(79, 70, 229, 0.4);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 60px;
    align-items: center;
}
@media (max-width: 900px) {
    .cta-card { grid-template-columns: 1fr; padding: 60px 30px; text-align: center; }
}
.cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}
.cta-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
}
.cta-blob-1 { top: -80px; right: -80px; width: 260px; height: 260px; background: #ec4899; }
.cta-blob-2 { bottom: -80px; left: -80px; width: 240px; height: 240px; background: #3b82f6; }

.cta-content > * { position: relative; z-index: 2; }
.cta-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
}
.cta-eyebrow i { color: #fcd34d; }
.cta-card h2 {
    font-size: 42px;
    margin: 0 0 16px;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.25;
}
.cta-card p {
    opacity: 0.95;
    margin: 0 0 32px;
    font-size: 17px;
    line-height: 1.85;
    max-width: 520px;
}
@media (max-width: 900px) { .cta-card p { margin-inline: auto; } }

.cta-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
@media (max-width: 900px) { .cta-buttons { justify-content: center; } }
.cta-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: white;
    color: var(--primary-dark);
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}
.cta-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    color: var(--primary-dark);
    text-decoration: none;
}
.cta-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.15s;
}
.cta-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.cta-visual {
    position: relative;
    z-index: 2;
}
.cta-benefits {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cta-benefit {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s;
}
.cta-benefit:hover {
    transform: translateX(-4px);
    background: rgba(255, 255, 255, 0.14);
}
[dir="rtl"] .cta-benefit:hover { transform: translateX(4px); }
.cta-benefit-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.cta-benefit-text strong {
    display: block;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
}
.cta-benefit-text span {
    font-size: 13px;
    opacity: 0.85;
}

/* ============ Footer (Rich) ============ */
.public-footer {
    background:
        radial-gradient(circle at 20% 0%, rgba(79, 70, 229, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 40%),
        #0b1120;
    color: #94a3b8;
    padding: 70px 28px 24px;
    position: relative;
}
.footer-container {
    max-width: 1140px;
    margin: 0 auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
}

.footer-brand-block {
    max-width: 340px;
}
@media (max-width: 500px) { .footer-brand-block { max-width: none; margin-inline: auto; } }
.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
@media (max-width: 500px) { .footer-brand { justify-content: center; } }
.footer-brand-name {
    color: white;
    font-size: 22px;
    font-weight: 800;
}
.footer-brand-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
}
.footer-desc {
    color: #94a3b8;
    line-height: 1.85;
    margin: 0 0 20px;
    font-size: 14px;
}
.footer-socials {
    display: flex;
    gap: 10px;
}
@media (max-width: 500px) { .footer-socials { justify-content: center; } }
.footer-social {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.15s;
    text-decoration: none;
}
.footer-social:hover {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: white;
    transform: translateY(-2px);
    text-decoration: none;
}

.footer-col-title {
    color: white;
    font-weight: 700;
    font-size: 15px;
    margin: 0 0 18px;
    position: relative;
    padding-bottom: 10px;
}
.footer-col-title::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #ec4899);
    border-radius: 2px;
}
@media (max-width: 500px) {
    .footer-col-title::after { right: 50%; transform: translateX(50%); }
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s, padding 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.footer-links a::before {
    content: '\f0d9';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.15s;
    color: var(--primary);
}
.footer-links a:hover {
    color: white;
    text-decoration: none;
    padding-inline-end: 4px;
}
.footer-links a:hover::before { opacity: 1; }

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
}
.footer-contact li {
    display: flex;
    align-items: center;
    gap: 10px;
}
@media (max-width: 500px) { .footer-contact li { justify-content: center; } }
.footer-contact i {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.footer-bottom {
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: #64748b;
    font-size: 13px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
@media (max-width: 600px) {
    .footer-bottom { justify-content: center; text-align: center; }
}
.footer-heart {
    color: #ec4899;
    animation: heartbeat 1.4s ease-in-out infinite;
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.15); }
    60% { transform: scale(1); }
}

/* Level badges */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}
.level-badge-lg {
    padding: 8px 18px;
    font-size: 15px;
}
.level-success { background: #d1fae5; color: #065f46; }
.level-info    { background: #dbeafe; color: #1e40af; }
.level-warning { background: #fef3c7; color: #92400e; }
.level-danger  { background: #fee2e2; color: #991b1b; }

.classification-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 8px 30px rgba(79, 70, 229, 0.25);
}
.classification-hero-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
}
.classification-hero-content { flex: 1; }
.classification-hero-label {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 4px;
}
.classification-hero-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 4px;
}
.classification-hero-sub { opacity: 0.9; font-size: 14px; }
.classification-hero-score {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
}
@media (max-width: 600px) {
    .classification-hero { flex-direction: column; text-align: center; }
}
