@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

:root {
    --p9: #2a3d62;
    --p8: #355080;
    --p7: #406093;
    --p6: #4C8CE4;
    --p5: #5a9be8;
    --p4: #7bb4f0;
    --p1: #dce8f8;
    --p0: #eef3fb;
    --g7: #3a7a30;
    --g6: #5a9b3a;
    --g5: #91D06C;
    --g1: #e4f3d9;
    --g0: #f2f8ed;
    --y: #FFF799;
    --yd: #e6de5c;
    --x9: #111827;
    --x7: #374151;
    --x5: #6b7280;
    --x3: #d1d5db;
    --x1: #f3f4f6;
    --x0: #f9fafb;
    --bg: #eef3fb;
    --surface: #fff;
    --border: #c5d8f0;
    --border2: #dce8f8;
    --text: #2a3d62;
    --muted: #7bb4f0;
    --s1: 0 1px 3px rgba(64, 96, 147, .1), 0 1px 2px rgba(64, 96, 147, .06);
    --s2: 0 4px 20px rgba(64, 96, 147, .12);
    --s3: 0 10px 40px rgba(64, 96, 147, .16);
    --r: 12px;
    --rs: 8px;
    --rl: 16px;
    --rx: 24px;
}

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

html {
    scroll-behavior: smooth
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 15px;
    color: var(--x9);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

main {
    flex: 1
}

a {
    text-decoration: none
}

.fw-500 {
    font-weight: 500 !important
}

.fw-600 {
    font-weight: 600 !important
}

.fw-700 {
    font-weight: 700 !important
}

.fw-800 {
    font-weight: 800 !important
}

.font-mono {
    font-family: 'JetBrains Mono', monospace !important
}

#mainNav {
    background: linear-gradient(135deg, #2a3d62 0%, #406093 40%, #4C8CE4 100%) !important;
    height: 64px;
    box-shadow: 0 2px 24px rgba(40, 60, 100, .35);
    z-index: 1040;
    border-bottom: 1px solid rgba(255, 255, 255, .1)
}

#mainNav .navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff !important;
    letter-spacing: -.02em
}

#mainNav .navbar-brand i {
    color: #91D06C
}

.nav-link-pill {
    color: rgba(255, 255, 255, .82) !important;
    font-weight: 500;
    border-radius: 8px;
    padding: .4rem .85rem !important;
    transition: color .2s, background .2s
}

.nav-link-pill:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .12)
}

.nav-link-pill.active {
    color: #fff !important;
    background: rgba(255, 255, 255, .18)
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: rgba(255, 255, 255, .14);
    border: 1.5px solid rgba(255, 255, 255, .25);
    border-radius: 50px;
    padding: .3rem .8rem .3rem .3rem;
    color: #fff !important;
    cursor: pointer;
    transition: background .2s, border-color .2s
}

.profile-trigger:hover,
.profile-trigger.show {
    background: rgba(255, 255, 255, .24);
    border-color: rgba(255, 255, 255, .5)
}

.profile-trigger::after {
    display: none
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(145, 208, 108, .35);
    color: #fff;
    font-weight: 800;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center
}

.profile-info {
    flex-direction: column;
    line-height: 1.2
}

.profile-name {
    font-size: .85rem;
    font-weight: 700;
    color: #fff
}

.profile-role-label {
    font-size: .68rem;
    color: rgba(255, 255, 255, .7)
}

.profile-chevron {
    font-size: .72rem;
    color: rgba(255, 255, 255, .7);
    transition: transform .25s
}

.profile-trigger.show .profile-chevron {
    transform: rotate(180deg)
}

.profile-dropdown {
    width: 275px;
    border: none !important;
    border-radius: var(--rl) !important;
    box-shadow: 0 8px 40px rgba(42, 61, 98, .2), 0 2px 8px rgba(0, 0, 0, .06) !important;
    overflow: hidden;
    margin-top: .5rem !important;
    animation: dropIn .2s ease
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.2rem 1.25rem;
    background: linear-gradient(135deg, #2a3d62, #406093)
}

.pd-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(145, 208, 108, .3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .3);
    flex-shrink: 0
}

.pd-name {
    font-weight: 700;
    font-size: .9rem;
    color: #fff
}

.pd-email {
    font-size: .72rem;
    color: rgba(255, 255, 255, .7);
    margin-top: 1px;
    word-break: break-all
}

.pd-role-badge {
    display: inline-flex;
    align-items: center;
    margin-top: .35rem;
    padding: .15rem .55rem;
    border-radius: 50px;
    font-size: .68rem;
    font-weight: 700
}

.pd-role-teacher {
    background: rgba(255, 247, 153, .3);
    color: #FFF799
}

.pd-role-student {
    background: rgba(145, 208, 108, .25);
    color: #91D06C
}

.profile-dropdown-body {
    background: #fff;
    padding: .4rem
}

.pd-menu-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .85rem;
    border-radius: 10px;
    color: var(--x7);
    font-size: .875rem;
    font-weight: 500;
    transition: background .15s, color .15s
}

.pd-menu-item:hover {
    background: var(--p0);
    color: var(--p7)
}

.pd-menu-item i {
    font-size: .95rem;
    width: 18px;
    text-align: center;
    color: var(--x5)
}

.pd-menu-item:hover i {
    color: var(--p6)
}

.profile-dropdown-footer {
    padding: .4rem;
    background: #fff;
    border-top: 1px solid var(--x1)
}

.pd-logout {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .85rem;
    border-radius: 10px;
    color: #dc2626;
    font-size: .875rem;
    font-weight: 600;
    transition: background .15s;
    width: 100%
}

.pd-logout:hover {
    background: #fef2f2;
    color: #b91c1c
}

.pd-logout i {
    font-size: .95rem;
    width: 18px;
    text-align: center
}

.role-badge-teacher {
    background: #fffef0;
    color: #7a6800;
    border: 1px solid var(--yd);
    border-radius: 50px;
    padding: .18rem .65rem;
    font-size: .75rem;
    font-weight: 700
}

.role-badge-student {
    background: var(--p1);
    color: var(--p8);
    border: 1px solid var(--p4);
    border-radius: 50px;
    padding: .18rem .65rem;
    font-size: .75rem;
    font-weight: 700
}

.badge-active {
    background: var(--g1) !important;
    color: var(--g7) !important;
    border: 1px solid #91D06C !important
}

.badge-closed {
    background: var(--x1) !important;
    color: var(--x5) !important;
    border: 1px solid var(--x3) !important
}

.btn-primary-custom {
    background: linear-gradient(135deg, #406093 0%, #4C8CE4 100%);
    border: none;
    color: #fff !important;
    font-weight: 600;
    border-radius: var(--rs);
    padding: .5rem 1.25rem;
    box-shadow: 0 2px 10px rgba(64, 96, 147, .25);
    transition: background .2s, transform .2s, box-shadow .2s
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #2a3d62 0%, #406093 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(64, 96, 147, .35);
    color: #fff !important
}

.card {
    border-radius: var(--r) !important;
    border: 1px solid var(--border) !important;
    background: #fff;
    box-shadow: var(--s1)
}

.card-header {
    border-radius: var(--r) var(--r) 0 0 !important;
    border-bottom: 1px solid var(--border2) !important;
    background: #fff !important
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1.35rem 1.5rem;
    border-radius: var(--r);
    background: #fff;
    border: 1px solid var(--border2);
    box-shadow: var(--s1);
    transition: transform .25s, box-shadow .25s
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--s2)
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1
}

.stat-label {
    font-size: .78rem;
    color: var(--x5);
    margin-top: 2px;
    font-weight: 500
}

.stat-blue .stat-icon {
    background: var(--p1);
    color: var(--p6)
}

.stat-blue .stat-value {
    color: var(--p6)
}

.stat-blue {
    border-left: 4px solid var(--p5) !important
}

.stat-green .stat-icon {
    background: var(--g1);
    color: var(--g6)
}

.stat-green .stat-value {
    color: var(--g6)
}

.stat-green {
    border-left: 4px solid var(--g5) !important
}

.stat-orange .stat-icon {
    background: #fff7ed;
    color: #ea580c
}

.stat-orange .stat-value {
    color: #ea580c
}

.stat-orange {
    border-left: 4px solid #f97316 !important
}

.stat-purple .stat-icon {
    background: #f5f3ff;
    color: #7c3aed
}

.stat-purple .stat-value {
    color: #7c3aed;
    font-size: 1rem
}

.stat-purple {
    border-left: 4px solid #8b5cf6 !important
}

.table {
    color: var(--x9)
}

.table thead th {
    background: var(--p0) !important;
    color: var(--p8);
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid var(--p1) !important
}

.table tbody tr {
    transition: background .15s
}

.table-hover tbody tr:hover {
    background: var(--p0) !important
}

.table td,
.table th {
    border-color: var(--border2) !important;
    vertical-align: middle
}

.enroll-key-badge {
    background: var(--p1);
    color: var(--p8);
    padding: .25rem .65rem;
    border-radius: 7px;
    font-family: 'JetBrains Mono', monospace;
    font-size: .875rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .08em;
    transition: background .2s, color .2s
}

.enroll-key-badge:hover {
    background: var(--p6);
    color: #fff
}

.enroll-key-card {
    background: linear-gradient(135deg, var(--p0), var(--g0));
    border-radius: var(--r);
    padding: 1.25rem 1.5rem;
    border: 1.5px solid var(--p1)
}

.enroll-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--p7), var(--p6));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem
}

.enroll-key-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: .22em;
    color: var(--p7)
}

.question-num {
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: linear-gradient(135deg, var(--p7), var(--p6));
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.answer-score-pill,
.result-score-pill {
    border-radius: 50px;
    padding: .28rem .9rem;
    font-weight: 700;
    font-size: .875rem;
    white-space: nowrap
}

.pill-high {
    background: var(--g1);
    color: var(--g7)
}

.pill-mid {
    background: #FFF799;
    color: #7a6800
}

.pill-low {
    background: #fee2e2;
    color: #991b1b
}

.answer-review-card,
.result-answer-card {
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--s1);
    border: 1px solid var(--border2)
}

.answer-review-header,
.result-answer-header {
    background: var(--p0);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border2)
}

.answer-review-body,
.result-answer-body {
    background: #fff;
    padding: 1.25rem
}

.answer-section {
    background: #f8fafd;
    border-radius: var(--rs);
    padding: 1rem;
    height: 100%;
    border: 1px solid var(--border2)
}

.student-answer-section {
    border-left: 4px solid var(--p6)
}

.key-answer-section {
    border-left: 4px solid var(--g5)
}

.section-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--x5);
    margin-bottom: .6rem
}

.section-content {
    font-size: .9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    color: var(--x7)
}

.score-progress {
    height: 8px;
    border-radius: 4px;
    background: var(--border2)
}

.edit-score-form {
    background: #fffef0;
    border: 1.5px dashed var(--yd);
    border-radius: var(--rs);
    padding: 1rem 1.25rem;
    margin-top: .75rem
}

.submission-header-card {
    background: linear-gradient(135deg, var(--p0) 0%, var(--g0) 100%);
    border-radius: var(--rl);
    padding: 1.5rem 2rem;
    border: 1.5px solid var(--p1)
}

.final-score-ring {
    display: inline-block;
    text-align: center;
    background: #fff;
    border-radius: var(--r);
    padding: 1.2rem 1.8rem;
    box-shadow: var(--s1);
    border: 1.5px solid var(--border2)
}

.ring-value {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1
}

.ring-label {
    font-size: .75rem;
    color: var(--x5);
    margin-top: 4px
}

.ring-high .ring-value {
    color: var(--g6)
}

.ring-mid .ring-value {
    color: #d97706
}

.ring-low .ring-value {
    color: #dc2626
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .875rem;
    flex-shrink: 0
}

.avatar-circle.sm {
    width: 32px;
    height: 32px;
    font-size: .8rem;
    background: var(--p1);
    color: var(--p7)
}

.avatar-circle.lg {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--p7), var(--p6));
    color: #fff
}

.subject-card-link {
    text-decoration: none !important
}

.subject-card {
    background: #fff;
    border-radius: var(--rl);
    overflow: hidden;
    border: 1px solid var(--border2);
    box-shadow: var(--s1);
    transition: transform .25s, box-shadow .25s;
    height: 100%
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--s2)
}

.subject-card-accent {
    height: 5px
}

.accent-1 {
    background: linear-gradient(90deg, #2a3d62, #406093)
}

.accent-2 {
    background: linear-gradient(90deg, #3a7a30, #91D06C)
}

.accent-3 {
    background: linear-gradient(90deg, #406093, #4C8CE4)
}

.accent-4 {
    background: linear-gradient(90deg, #4C8CE4, #7bb4f0)
}

.accent-5 {
    background: linear-gradient(90deg, #5a9b3a, #91D06C)
}

.accent-6 {
    background: linear-gradient(90deg, #355080, #5a9be8)
}

.subject-card-body {
    padding: 1.4rem
}

.subject-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem
}

.accent-icon-1 {
    background: var(--p1);
    color: var(--p7)
}

.accent-icon-2 {
    background: var(--g1);
    color: var(--g7)
}

.accent-icon-3 {
    background: var(--p1);
    color: var(--p6)
}

.accent-icon-4 {
    background: var(--p1);
    color: var(--p5)
}

.accent-icon-5 {
    background: var(--g1);
    color: var(--g6)
}

.accent-icon-6 {
    background: var(--p1);
    color: var(--p8)
}

.subject-card-footer {
    display: flex;
    justify-content: space-between;
    padding-top: .75rem;
    border-top: 1px solid var(--x1);
    color: var(--x5);
    font-size: .8rem
}

.subject-card-add {
    border: 2px dashed var(--border)
}

.subject-card-add:hover {
    border-color: var(--p6);
    background: var(--p0)
}

.subject-hero {
    background: linear-gradient(135deg, var(--p0) 0%, var(--g0) 100%);
    border-radius: var(--rl);
    padding: 2rem;
    border: 1.5px solid var(--p1)
}

.subject-hero-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--p7), var(--p6));
    color: #fff;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem
}

.essay-card {
    background: #fff;
    border-radius: var(--r);
    border: 1.5px solid var(--border2);
    box-shadow: var(--s1);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s
}

.essay-card-active {
    border-color: var(--p6)
}

.essay-card-done {
    opacity: .85
}

.essay-card-inactive {
    opacity: .7
}

.essay-card:hover {
    box-shadow: var(--s2);
    transform: translateY(-2px)
}

.essay-card-body {
    padding: 1.2rem
}

.essay-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%
}

.dot-active {
    background: var(--g5);
    box-shadow: 0 0 0 3px rgba(145, 208, 108, .2);
    animation: pulse 2s infinite
}

.dot-done {
    background: var(--p6)
}

.dot-inactive {
    background: var(--x3)
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(145, 208, 108, .2)
    }

    50% {
        box-shadow: 0 0 0 6px rgba(145, 208, 108, .06)
    }
}

.essay-meta {
    display: flex;
    gap: 1rem
}

.essay-meta-item {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    color: var(--x5)
}

.exam-topbar {
    background: #fff;
    border-radius: var(--r);
    padding: 1.1rem 1.4rem;
    border: 1.5px solid var(--border2);
    box-shadow: var(--s1);
    position: sticky;
    top: 70px;
    z-index: 100
}

.exam-timer {
    background: var(--p1);
    color: var(--p8);
    border-radius: 50px;
    padding: .45rem 1.2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    transition: background .3s, color .3s
}

.timer-warning {
    background: #FFF799 !important;
    color: #7a6800 !important
}

.timer-danger {
    background: #fee2e2 !important;
    color: #991b1b !important;
    animation: blink 1s step-end infinite
}

@keyframes blink {
    50% {
        opacity: .5
    }
}

.question-card {
    background: #fff;
    border-radius: var(--r);
    border: 2px solid var(--border2);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s
}

.qcard-filled {
    border-color: var(--g5) !important
}

.qcard-active {
    border-color: var(--p6) !important;
    box-shadow: 0 0 0 4px rgba(76, 140, 228, .1)
}

.question-card-header {
    background: var(--p0);
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--border2)
}

.question-card-body {
    padding: 1.2rem 1.4rem
}

.student-answer-field {
    resize: vertical;
    background: #f8fafd;
    border: 1.5px solid var(--border2);
    border-radius: var(--rs);
    transition: border-color .2s, box-shadow .2s, background .2s;
    color: var(--x9)
}

.student-answer-field:focus {
    border-color: var(--p6) !important;
    box-shadow: 0 0 0 3px rgba(76, 140, 228, .1) !important;
    background: #fff;
    outline: none
}

.submit-section {
    max-width: 600px;
    margin: 0 auto
}

.submit-card {
    background: linear-gradient(135deg, var(--p0), var(--g0));
    border-radius: var(--rl);
    padding: 1.75rem 2rem;
    text-align: center;
    border: 1.5px solid var(--p1)
}

.result-hero {
    background: linear-gradient(135deg, #2a3d62 0%, #406093 60%, #4C8CE4 100%);
    border-radius: var(--rl);
    padding: 2.5rem;
    position: relative;
    overflow: hidden
}

.result-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(145, 208, 108, .08);
    border-radius: 50%
}

.result-hero h2,
.result-hero p,
.result-hero small,
.result-hero .text-muted {
    color: #fff !important
}

.result-hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, .15);
    border-radius: 50px;
    padding: .28rem .9rem;
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: .75rem;
    color: #fff
}

.final-score-display {
    background: rgba(255, 255, 255, .12);
    border-radius: var(--rl);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, .2);
    text-align: center
}

.score-number {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    color: #fff
}

.score-max {
    font-size: 1rem;
    color: rgba(255, 255, 255, .65)
}

.grade-letter {
    font-size: 2.2rem;
    font-weight: 900
}

.grade-label {
    color: rgba(255, 255, 255, .9);
    font-size: 1rem
}

.grade-success .score-number,
.grade-success .grade-letter {
    color: #91D06C
}

.grade-warning .score-number,
.grade-warning .grade-letter {
    color: #FFF799
}

.grade-danger .score-number,
.grade-danger .grade-letter {
    color: #fca5a5
}

.your-answer-block {
    background: var(--p0);
    border-radius: var(--rs);
    padding: 1rem;
    border-left: 4px solid var(--p6)
}

.answer-text {
    font-size: .9rem;
    line-height: 1.7;
    white-space: pre-wrap
}

.result-progress {
    height: 10px;
    border-radius: 5px;
    background: var(--border2)
}

.auth-body {
    background: var(--bg);
    min-height: 100vh
}

.auth-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh
}

.auth-left {
    width: 44%;
    background: linear-gradient(145deg, #2a3d62 0%, #406093 50%, #4C8CE4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: rgba(145, 208, 108, .08);
    border-radius: 50%
}

.auth-left::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -15%;
    width: 400px;
    height: 400px;
    background: rgba(255, 247, 153, .06);
    border-radius: 50%
}

.auth-brand-content {
    max-width: 380px;
    position: relative;
    z-index: 1
}

.brand-icon {
    width: 72px;
    height: 72px;
    background: rgba(145, 208, 108, .2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff
}

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fff
}

.auth-card {
    width: 100%;
    max-width: 430px
}

.feature-item {
    color: rgba(255, 255, 255, .88);
    margin-bottom: .6rem;
    font-size: .88rem
}

.role-preview-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .1);
    border-radius: 12px;
    padding: .85rem 1rem;
    margin-bottom: .75rem;
    border: 1px solid rgba(255, 255, 255, .08);
    transition: background .2s
}

.role-preview-card:hover {
    background: rgba(255, 255, 255, .15)
}

.role-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem
}

.role-option input[type="radio"] {
    display: none
}

.role-card-select {
    border: 2px solid var(--x3);
    border-radius: var(--r);
    padding: 1.2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
    background: #fff
}

.role-option input:checked+.role-card-select {
    border-color: var(--p6);
    background: var(--p0);
    box-shadow: 0 0 0 4px rgba(76, 140, 228, .1)
}

.role-card-select:hover {
    border-color: var(--p5);
    background: var(--p0)
}

.form-control,
.form-select {
    border: 1.5px solid #d1d5db;
    background: #f9fafb;
    border-radius: var(--rs);
    color: var(--x9);
    transition: border-color .2s, box-shadow .2s, background .2s
}

.form-control:focus,
.form-select:focus {
    border-color: var(--p6) !important;
    box-shadow: 0 0 0 3px rgba(76, 140, 228, .1) !important;
    background: #fff;
    outline: none
}

.input-group-text {
    background: var(--p0);
    border: 1.5px solid #d1d5db;
    color: var(--p7)
}

.aes-tip-card {
    background: var(--p0);
    border-radius: var(--r);
    padding: 1.2rem 1.5rem;
    border-left: 4px solid var(--p6)
}

.info-banner {
    background: var(--p0);
    border-radius: var(--rs);
    padding: .75rem 1rem;
    border: 1px solid var(--p1);
    font-size: .875rem;
    color: var(--p8)
}

.enroll-hero-icon {
    width: 80px;
    height: 80px;
    background: var(--p1);
    color: var(--p7);
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem
}

.empty-state,
.empty-state-hero {
    padding: 3rem 1rem;
    text-align: center
}

.empty-hero-icon {
    width: 88px;
    height: 88px;
    background: var(--p1);
    color: var(--p6);
    border-radius: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1rem
}

.page-header {
    padding: .5rem 0 1rem
}

.answer-key-preview {
    background: var(--p0);
    border-radius: var(--rs);
    padding: .6rem .9rem;
    margin-top: .5rem;
    border: 1px solid var(--border2)
}

.answer-key-text {
    font-size: .8rem;
    color: var(--x5)
}

.footer {
    border-top: 2px solid var(--border2);
    background: #fff;
    color: var(--x5)
}

#toastContainer {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem
}

.toast-msg {
    background: var(--p8);
    color: #fff;
    border-radius: 8px;
    padding: .65rem 1.1rem;
    font-size: .875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
    box-shadow: var(--s2);
    animation: slideIn .3s ease, fadeOut .3s ease 2.7s forwards
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0
    }

    to {
        transform: none;
        opacity: 1
    }
}

@keyframes fadeOut {
    from {
        opacity: 1
    }

    to {
        opacity: 0;
        pointer-events: none
    }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile & Tablet
══════════════════════════════════════════════════════════ */

/* --- Navbar toggler (hamburger) --- */
#mainNav .navbar-toggler {
    border: 1.5px solid rgba(255, 255, 255, .3);
    border-radius: var(--rs);
    padding: .35rem .55rem;
    transition: background .2s, border-color .2s
}

#mainNav .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .15);
    outline: none
}

#mainNav .navbar-toggler:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .5)
}

#mainNav .navbar-toggler-icon {
    filter: brightness(0) invert(1);
    width: 1.2em;
    height: 1.2em
}

/* --- Tablet & below (≤991px) --- */
@media (max-width: 991.98px) {
    #mainNav {
        height: auto;
        padding: .6rem 0
    }

    #mainNav .navbar-collapse {
        background: rgba(30, 50, 85, .95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: var(--r);
        margin-top: .75rem;
        padding: .75rem;
        border: 1px solid rgba(255, 255, 255, .1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, .2)
    }

    #mainNav .navbar-nav {
        gap: .25rem !important
    }

    .nav-link-pill {
        padding: .55rem 1rem !important;
        border-radius: var(--rs);
        font-size: .9rem
    }

    /* Profile trigger on mobile — full width */
    #mainNav .navbar-nav.ms-auto {
        margin-top: .5rem;
        padding-top: .5rem;
        border-top: 1px solid rgba(255, 255, 255, .12)
    }

    .profile-trigger {
        width: 100%;
        justify-content: flex-start
    }

    .profile-info {
        display: flex !important
    }

    /* Dropdown on mobile — full width */
    .profile-dropdown {
        width: 100% !important;
        position: static !important;
        margin-top: .5rem !important;
        box-shadow: none !important;
        border: 1px solid rgba(255, 255, 255, .1) !important;
        border-radius: var(--r) !important
    }

    /* Auth pages */
    .auth-wrapper {
        flex-direction: column
    }

    .auth-left {
        width: 100%;
        min-height: auto;
        padding: 2rem 1.5rem
    }

    .auth-right {
        padding: 1.5rem
    }

    .auth-card {
        max-width: 100%
    }

    /* Subject hero */
    .subject-hero {
        padding: 1.25rem
    }

    .subject-hero-icon {
        width: 48px;
        height: 48px;
        font-size: 1.4rem
    }

    /* Exam topbar */
    .exam-topbar {
        top: 0;
        border-radius: 0;
        padding: .75rem 1rem
    }

    /* Submission header */
    .submission-header-card {
        padding: 1rem 1.25rem
    }

    /* Result hero */
    .result-hero {
        padding: 1.5rem
    }

    .score-number {
        font-size: 3rem
    }

    /* Stat cards responsive */
    .stat-card {
        padding: 1rem 1.15rem
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
        border-radius: 10px
    }

    .stat-value {
        font-size: 1.4rem
    }
}

/* --- Phone (≤575px) --- */
@media (max-width: 575.98px) {
    body {
        font-size: 14px
    }

    .container-fluid {
        padding-left: .75rem !important;
        padding-right: .75rem !important
    }

    /* Page header */
    .page-header h2 {
        font-size: 1.35rem
    }

    /* Auth */
    .auth-left {
        padding: 1.5rem 1rem
    }

    .brand-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        border-radius: 16px
    }

    .role-selector-grid {
        grid-template-columns: 1fr
    }

    /* Subject cards */
    .subject-card-body {
        padding: 1rem
    }

    /* Enroll key */
    .enroll-key-display {
        font-size: 1.4rem;
        letter-spacing: .15em
    }

    .enroll-key-card {
        padding: 1rem 1.15rem
    }

    /* Essay cards */
    .essay-card-body {
        padding: .9rem
    }

    .essay-meta {
        flex-wrap: wrap;
        gap: .5rem
    }

    /* Question cards (exam) */
    .question-card-header {
        padding: .75rem 1rem
    }

    .question-card-body {
        padding: .9rem 1rem
    }

    /* Answer review */
    .answer-review-header,
    .result-answer-header {
        padding: .75rem 1rem
    }

    .answer-review-body,
    .result-answer-body {
        padding: .9rem 1rem
    }

    .answer-section {
        padding: .75rem
    }

    /* Final score */
    .final-score-ring {
        padding: .9rem 1.2rem
    }

    .ring-value {
        font-size: 1.8rem
    }

    .final-score-display {
        padding: 1.25rem
    }

    .score-number {
        font-size: 2.5rem
    }

    .grade-letter {
        font-size: 1.6rem
    }

    /* Empty states */
    .empty-state,
    .empty-state-hero {
        padding: 2rem .75rem
    }

    .empty-hero-icon {
        width: 68px;
        height: 68px;
        font-size: 2rem;
        border-radius: 20px
    }

    .enroll-hero-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
        border-radius: 18px
    }

    /* Tables responsive */
    .table {
        font-size: .82rem
    }

    .table thead th {
        font-size: .72rem;
        padding: .5rem .4rem !important
    }

    .table td,
    .table th {
        padding: .5rem .4rem !important
    }

    /* Buttons */
    .btn-primary-custom {
        padding: .45rem 1rem;
        font-size: .875rem
    }

    /* Toast */
    #toastContainer {
        bottom: 1rem;
        right: 1rem;
        left: 1rem
    }

    .toast-msg {
        font-size: .82rem
    }
}