/* ============================================
   UP Police Prep — Professional Education UI
   Mobile-First • Modern • Clean
   ============================================ */

/* ---------- CSS Variables / Theme ---------- */
:root {
    --primary: #1565c0;
    --primary-dark: #0d47a1;
    --primary-light: #e3f2fd;
    --accent: #ff6f00;
    --accent-light: #fff8e1;
    --success: #2e7d32;
    --success-light: #e8f5e9;
    --danger: #c62828;
    --danger-light: #ffebee;
    --warning: #f9a825;
    --info: #0277bd;
    --bg-body: #f0f4f8;
    --bg-card: #ffffff;
    --text-primary: #1a2332;
    --text-secondary: #5a6a7e;
    --text-muted: #8896a4;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text-primary); }
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Navbar ---------- */
.navbar-main {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
    box-shadow: 0 2px 20px rgba(13,71,161,0.3);
    padding: 0.6rem 0;
    z-index: 1050;
}
.navbar-main .navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.navbar-main .navbar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.navbar-main .nav-link {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    color: rgba(255,255,255,0.85) !important;
}
.navbar-main .nav-link:hover,
.navbar-main .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: #fff !important;
}
.navbar-main .nav-link i { margin-right: 4px; }
.navbar-main .btn-register {
    background: var(--accent);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.45rem 1.2rem;
    border-radius: 50px;
    transition: var(--transition);
    font-size: 0.85rem;
}
.navbar-main .btn-register:hover {
    background: #e65100;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,111,0,0.4);
}
.navbar-main .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-top: 0.5rem;
}
.navbar-main .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
}
.navbar-main .dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ---------- Cards ---------- */
.card {
    border: none;
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 1rem 1.25rem;
    font-weight: 600;
}
.card-body { padding: 1.25rem; }

/* Elevated card */
.card-elevated {
    box-shadow: var(--shadow);
    border-radius: var(--radius-lg);
}
.card-elevated:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: 50px;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    box-shadow: 0 2px 8px rgba(21,101,192,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #0a3d91);
    box-shadow: 0 4px 16px rgba(21,101,192,0.4);
    transform: translateY(-2px);
}
.btn-accent {
    background: linear-gradient(135deg, var(--accent), #e65100);
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,111,0,0.3);
}
.btn-accent:hover {
    background: linear-gradient(135deg, #e65100, #bf360c);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,111,0,0.4);
    transform: translateY(-2px);
}
.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}
.btn-success {
    background: linear-gradient(135deg, var(--success), #1b5e20);
    border: none;
}
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b71c1c);
    border: none;
}
.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}
.btn-sm {
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
}

/* ---------- Badges ---------- */
.badge {
    border-radius: 50px;
    font-weight: 600;
    padding: 0.35em 0.8em;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

/* ---------- Progress ---------- */
.progress {
    border-radius: 50px;
    height: 8px;
    background: var(--border-color);
    overflow: hidden;
}
.progress-bar {
    border-radius: 50px;
    transition: width 1s ease;
}

/* ---------- Alerts ---------- */
.alert {
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ---------- Tables ---------- */
.table { font-size: 0.9rem; }
.table th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.9rem 1rem;
    border-bottom: 2px solid var(--border-color);
}
.table td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}
.table-hover tbody tr:hover { background: var(--primary-light); }

/* ---------- Hero Section ---------- */
.hero-section {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 40%, #1976d2 100%);
    position: relative;
    overflow: hidden;
    padding: 4rem 0 3rem;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}
.hero-section .container { position: relative; z-index: 2; }
.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
}
.hero-subtitle {
    font-size: 1.15rem;
    opacity: 0.9;
    line-height: 1.7;
}
.hero-exam-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    color: #fff;
}
.hero-exam-card .table { color: #fff; }
.hero-exam-card .table th { 
    color: rgba(255,255,255,0.7); 
    border-color: rgba(255,255,255,0.15);
    font-size: 0.72rem;
}
.hero-exam-card .table td { 
    border-color: rgba(255,255,255,0.1);
    padding: 0.6rem 0.5rem;
}
.hero-exam-card .table .total-row {
    background: rgba(255,255,255,0.1);
    font-weight: 700;
    border-radius: var(--radius-sm);
}

/* ---------- Stats Strip ---------- */
.stats-strip {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}
.stat-item {
    text-align: center;
    padding: 0.5rem;
}
.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ---------- Feature Cards ---------- */
.feature-card {
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    height: 100%;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}
.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}
.feature-icon.blue { background: var(--primary-light); color: var(--primary); }
.feature-icon.orange { background: var(--accent-light); color: var(--accent); }
.feature-icon.green { background: var(--success-light); color: var(--success); }
.feature-icon.red { background: var(--danger-light); color: var(--danger); }
.feature-card:hover .feature-icon { transform: scale(1.1); }
.feature-card h5 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0; line-height: 1.6; }

/* ---------- Section Headers ---------- */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.section-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}
.section-divider {
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 50px;
    margin: 0.75rem auto 0;
}

/* ---------- Test Cards ---------- */
.test-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
}
.test-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.test-card .card-body { padding: 1.5rem; }
.test-card .test-meta {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}
.test-card .test-meta-item {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.test-card .test-meta-item i { font-size: 1rem; display: block; margin-bottom: 2px; color: var(--primary); }
.test-card .test-meta-item strong { color: var(--text-primary); }
.test-badge-free {
    background: linear-gradient(135deg, var(--success), #1b5e20);
    color: #fff;
    padding: 0.3em 0.9em;
}
.test-badge-paid {
    background: linear-gradient(135deg, var(--accent), #e65100);
    color: #fff;
    padding: 0.3em 0.9em;
}

/* ---------- Dashboard Stats ---------- */
.dash-stat {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.dash-stat::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}
.dash-stat h3 { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.25rem; }
.dash-stat small { opacity: 0.85; font-size: 0.8rem; font-weight: 500; }
.dash-stat.stat-blue { background: linear-gradient(135deg, #1565c0, #0d47a1); }
.dash-stat.stat-green { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
.dash-stat.stat-cyan { background: linear-gradient(135deg, #0277bd, #01579b); }
.dash-stat.stat-amber { background: linear-gradient(135deg, #f9a825, #f57f17); }

/* ---------- Test Taking Page ---------- */
.test-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.timer-display {
    font-size: 1.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: rgba(255,255,255,0.15);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.timer-display.warning {
    background: var(--danger);
    animation: timer-pulse 1s infinite;
}
@keyframes timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.question-panel {
    padding: 1.5rem;
}
.question-subject-badge {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
    border-radius: 50px;
    padding: 0.3em 1em;
    font-size: 0.78rem;
}
.question-number {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}
.question-text {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.65;
    margin: 1rem 0 1.25rem;
    color: var(--text-primary);
}

/* Options */
.option-label {
    cursor: pointer;
    padding: 0.85rem 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 0.6rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    -webkit-tap-highlight-color: transparent;
}
.option-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateX(4px);
}
.option-label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
}
.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: var(--transition);
}
.option-label:has(input:checked) .option-letter {
    background: var(--primary);
    color: #fff;
}

/* Question Navigator */
.question-nav {
    position: sticky;
    top: 80px;
}
.question-nav-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 10px;
    transition: var(--transition);
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
}
.question-nav-btn:hover { transform: scale(1.08); box-shadow: var(--shadow-sm); }
.question-nav-btn.answered { background: var(--success); color: #fff; border-color: var(--success); }
.question-nav-btn.marked { background: #6f42c1; color: #fff; border-color: #6f42c1; }
.question-nav-btn.current { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,101,192,0.25); }
.question-nav-btn.unanswered { background: var(--bg-card); color: var(--text-secondary); }

.nav-legend .badge {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    padding: 0;
}

/* Navigation footer bar on test page */
.test-nav-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Result Page ---------- */
.result-score-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-weight: 800;
    font-size: 2rem;
    border: 6px solid;
}
.result-score-ring.good { border-color: var(--success); color: var(--success); background: var(--success-light); }
.result-score-ring.avg { border-color: var(--warning); color: #e65100; background: var(--accent-light); }
.result-score-ring.poor { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }
.result-score-ring small { font-size: 0.7rem; font-weight: 600; opacity: 0.7; }

/* Review page options */
.review-option {
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    transition: var(--transition);
}
.review-option.correct {
    border-color: var(--success);
    background: var(--success-light);
}
.review-option.wrong {
    border-color: var(--danger);
    background: var(--danger-light);
}

/* ---------- Auth Pages ---------- */
.auth-wrapper {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.auth-card .auth-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}
.auth-card .auth-header h3 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.auth-card .auth-header p { opacity: 0.8; font-size: 0.85rem; margin: 0; }
.auth-card .auth-body { padding: 1.75rem 1.5rem; }
.auth-card .form-control {
    border-radius: var(--radius);
    padding: 0.65rem 1rem;
    border: 2px solid var(--border-color);
    font-size: 0.9rem;
    transition: var(--transition);
}
.auth-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

/* ---------- Pricing Cards ---------- */
.pricing-card {
    border-radius: var(--radius-xl);
    transition: var(--transition);
    border: 2px solid var(--border-color);
    overflow: hidden;
}
.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}
.pricing-card.featured {
    border-color: var(--primary);
    position: relative;
}
.pricing-card.featured::before {
    content: 'MOST POPULAR';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    text-align: center;
    padding: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}
.pricing-card .price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}
.pricing-card .price-period {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.pricing-feature {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pricing-feature i { color: var(--success); font-size: 1rem; }

/* ---------- CTA Section ---------- */
.cta-section {
    background: linear-gradient(135deg, var(--primary-dark), #1565c0, #1976d2);
    color: #fff;
    padding: 3.5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='rgba(255,255,255,0.03)' d='M44.5,-76.4C58.8,-69.2,72.4,-59.4,79.9,-46.1C87.5,-32.8,89,-16.4,86.2,-1.6C83.4,13.1,76.3,26.3,68.2,38.7C60.1,51.2,51,62.9,39.1,70.7C27.3,78.5,13.6,82.3,-0.8,83.7C-15.3,85,-30.5,84,-43.4,77.3C-56.3,70.5,-66.8,58,-74.1,44C-81.5,30,-85.7,15,-84.6,0.6C-83.5,-13.7,-77.1,-27.5,-68.5,-38.8C-59.9,-50.2,-49.1,-59.2,-37,-66.3C-24.9,-73.5,-12.4,-78.8,1.2,-80.9C14.8,-83,30.1,-83.6,44.5,-76.4Z' transform='translate(100 100)' /%3E%3C/svg%3E") center/cover;
}

/* ---------- Footer ---------- */
.footer-main {
    background: linear-gradient(180deg, #1a2332, #0f1723);
    color: #fff;
    padding: 3rem 0 0;
}
.footer-main h5 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.footer-main .footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.88rem;
    display: block;
    padding: 0.25rem 0;
    transition: var(--transition);
}
.footer-main .footer-links a:hover {
    color: #fff;
    transform: translateX(4px);
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.25rem 0;
    margin-top: 2rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
}

/* ---------- Form Styles ---------- */
.form-control, .form-select {
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

/* ---------- Empty States ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}
.empty-state .empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}
.empty-state h4 { color: var(--text-secondary); font-size: 1.1rem; }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Leaderboard ---------- */
.rank-gold { color: #f9a825; }
.rank-silver { color: #78909c; }
.rank-bronze { color: #bf360c; }
.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
}
.rank-badge.gold { background: linear-gradient(135deg, #fdd835, #f9a825); color: #fff; }
.rank-badge.silver { background: linear-gradient(135deg, #b0bec5, #78909c); color: #fff; }
.rank-badge.bronze { background: linear-gradient(135deg, #d84315, #bf360c); color: #fff; }

/* ---------- Page Header ---------- */
.page-header {
    padding: 1.5rem 0 1rem;
    margin-bottom: 1.5rem;
}
.page-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.page-header h2 i {
    color: var(--primary);
    font-size: 1.3rem;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c0c8d4; border-radius: 50px; }
::-webkit-scrollbar-thumb:hover { background: #8896a4; }

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.5s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

/* Mobile-first adjustments */
@media (max-width: 991.98px) {
    .navbar-main .navbar-collapse {
        background: var(--primary-dark);
        border-radius: var(--radius);
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: var(--shadow-lg);
    }
    .navbar-main .nav-link {
        padding: 0.7rem 1rem !important;
        border-radius: var(--radius-sm);
    }
}

@media (max-width: 767.98px) {
    /* Hero */
    .hero-section { padding: 2.5rem 0 2rem; }
    .hero-title { font-size: 1.7rem; letter-spacing: -0.5px; }
    .hero-subtitle { font-size: 0.95rem; }
    .hero-exam-card { padding: 1.25rem; margin-top: 1.5rem; }

    /* Stats */
    .stat-number { font-size: 1.3rem; }
    .stat-label { font-size: 0.72rem; }

    /* Section headers */
    .section-header h2 { font-size: 1.35rem; }
    .section-header p { font-size: 0.88rem; }

    /* Cards */
    .card-body { padding: 1rem; }
    .card-header { padding: 0.85rem 1rem; }

    /* Feature cards */
    .feature-card { padding: 1.25rem 1rem; }
    .feature-icon { width: 52px; height: 52px; font-size: 1.2rem; }

    /* Dashboard stats */
    .dash-stat h3 { font-size: 1.3rem; }
    .dash-stat { padding: 1rem; }

    /* Page headers */
    .page-header h2 { font-size: 1.2rem; }

    /* Buttons */
    .btn { padding: 0.5rem 1.2rem; font-size: 0.85rem; }
    .btn-lg { padding: 0.65rem 1.5rem; font-size: 0.95rem; }

    /* Test taking */
    .test-header { padding: 0.6rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .test-header h5 { font-size: 0.9rem; flex: 1; }
    .timer-display { font-size: 1.1rem; padding: 0.3rem 0.8rem; }
    .question-panel { padding: 1rem; }
    .question-text { font-size: 0.95rem; }
    .option-label { padding: 0.75rem 0.9rem; font-size: 0.88rem; }
    .option-letter { width: 28px; height: 28px; font-size: 0.78rem; }
    .question-nav-btn { width: 34px; height: 34px; font-size: 0.72rem; border-radius: 8px; }

    /* Question navigator: horizontal scroll on mobile */
    .mobile-nav-scroll {
        display: flex;
        overflow-x: auto;
        gap: 0.35rem;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .mobile-nav-scroll::-webkit-scrollbar { display: none; }
    .mobile-nav-scroll .question-nav-btn { flex-shrink: 0; }

    /* Test nav footer */
    .test-nav-footer { padding: 0.6rem 0.75rem; gap: 0.35rem; }
    .test-nav-footer .btn { padding: 0.4rem 0.7rem; font-size: 0.78rem; }

    /* Tables */
    .table-responsive { margin: -0.25rem; }
    .table th, .table td { padding: 0.65rem 0.5rem; font-size: 0.8rem; }

    /* Result */
    .result-score-ring { width: 110px; height: 110px; font-size: 1.6rem; border-width: 5px; }

    /* Auth */
    .auth-card { margin: 0 0.5rem; }
    .auth-card .auth-header { padding: 1.5rem 1.25rem 1.25rem; }
    .auth-card .auth-body { padding: 1.25rem; }

    /* Pricing */
    .pricing-card .price-amount { font-size: 2rem; }

    /* Footer */
    .footer-main { padding: 2rem 0 0; }
    .footer-main h5 { font-size: 0.95rem; margin-top: 1.5rem; }
    .footer-bottom { text-align: center; }

    /* Leaderboard */
    .rank-badge { width: 28px; height: 28px; font-size: 0.7rem; }
}

@media (max-width: 575.98px) {
    .hero-title { font-size: 1.45rem; }
    .hero-section { padding: 2rem 0 1.5rem; }
    .hero-exam-card .table { font-size: 0.82rem; }
    .stat-number { font-size: 1.1rem; }
    .feature-card { padding: 1rem; }
    .dash-stat h3 { font-size: 1.1rem; }
    .dash-stat small { font-size: 0.7rem; }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    .btn { min-height: 44px; }
    .nav-link { min-height: 44px; display: flex; align-items: center; }
    .option-label { min-height: 48px; }
    .question-nav-btn { min-width: 40px; min-height: 40px; }
    .dropdown-item { min-height: 44px; display: flex; align-items: center; }
}

/* ---------- Print Styles ---------- */
@media print {
    .navbar-main, .footer-main, .btn, .question-nav { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
