/* Student portal styling on top of Velzon. */

body {
    background-color: var(--vz-light);
}

/* ------------------------------------------------------------------ topbar */

.student-topbar {
    background: linear-gradient(90deg, #405189, #3577f1);
    color: #fff;
}

.student-topbar a,
.student-topbar .navbar-brand {
    color: #fff;
    text-decoration: none;
}

.brand-logo-badge {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 6px;
    padding: 3px 6px;
    line-height: 0;
}

.brand-logo-badge img {
    height: 26px;
    width: auto;
    display: block;
}

.student-topbar .logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .18);
    font-size: 18px;
}

/* --------------------------------------------------------------- exam cards */

.exam-card {
    transition: transform .18s ease, box-shadow .18s ease;
    overflow: hidden;
}

.exam-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .08);
}

.exam-card-accent {
    height: 4px;
    width: 100%;
}

.exam-card-kind {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--vz-secondary-color, #878a99);
    margin-bottom: .15rem;
}

/* ---------------------------------------------------------------- exam play */

/* The exam header has to stay visible while scrolling a long paper - the timer
   and the save indicator are the two things a student checks constantly. */
.exam-play-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--vz-card-bg);
    border-bottom: 1px solid var(--vz-border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .04);
}

#exam-timer {
    font-variant-numeric: tabular-nums;
    min-width: 5.5rem;
    text-align: center;
}

.timer-danger {
    color: var(--vz-danger) !important;
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    50% { opacity: .45; }
}

.question-card .form-check {
    padding: .5rem .5rem .5rem 2rem;
    border-radius: .375rem;
    transition: background-color .15s ease;
}

.question-card .form-check:hover {
    background-color: var(--vz-light);
}

.question-card .form-check-input:checked ~ .form-check-label {
    font-weight: 600;
    color: var(--vz-primary);
}

.question-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--vz-primary-bg-subtle, #dfe7fb);
    color: var(--vz-primary);
    font-weight: 600;
    font-size: .8125rem;
    flex: 0 0 auto;
}

.question-save-state {
    min-height: 1.25rem;
}

/* Jump-to-question palette, so a long paper stays navigable. */
.question-palette {
    position: sticky;
    top: 90px;
}

.question-palette .palette-btn,
.offcanvas .palette-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: .8125rem;
    font-weight: 600;
}

.palette-btn.marked {
    background-color: var(--vz-warning);
    border-color: var(--vz-warning);
    color: #212529;
}

.palette-btn.current {
    outline: 2px solid var(--vz-primary);
    outline-offset: 2px;
}

/* Single-question-at-a-time CBT view: only the active card is shown, the
   rest stay in the DOM (so autosave/validation logic doesn't change) but
   are hidden rather than removed. */
.question-card {
    display: none;
}

.question-card.active {
    display: block;
}

.question-section-header,
.question-section-instructions {
    display: none;
}

.question-section-header.d-none,
.question-section-instructions.d-none {
    display: none !important;
}

.question-section-header:not(.d-none),
.question-section-instructions:not(.d-none) {
    display: flex;
}

p.question-section-instructions:not(.d-none) {
    display: block;
}

.question-stepper .btn:disabled {
    opacity: .4;
}

/* ------------------------------------------------------- result analysis */

.resonance-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .2rem .65rem .2rem .3rem;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    background: linear-gradient(90deg, #405189, #3577f1);
    white-space: nowrap;
}

.resonance-badge img {
    height: 18px;
    width: auto;
    border-radius: 4px;
    background: #fff;
    padding: 1px 3px;
}

.analysis-card-ai {
    border-top: 3px solid #3577f1;
}

.analysis-card-manual {
    border-top: 3px solid var(--vz-warning);
}

.exam-section-nav {
    background: var(--vz-card-bg);
    border: 1px solid var(--vz-border-color);
    border-radius: .5rem;
    padding: .35rem;
    gap: .25rem;
}

.exam-section-nav .nav-link {
    cursor: pointer;
    color: var(--vz-body-color);
    font-size: .8125rem;
    font-weight: 600;
    padding: .4rem .9rem;
    border-radius: .375rem;
}

.exam-section-nav .nav-link:hover {
    background: var(--vz-light);
}

.exam-section-nav .nav-link.active {
    background: var(--vz-primary);
    color: #fff;
}

.question-content {
    user-select: none;
}

/* Full page-scan question images shouldn't dominate the card - cap the
   height and let the student click to view full size if they need to. */
.question-image-wrap {
    max-height: 480px;
    overflow: hidden;
    border-radius: .5rem;
    border: 1px solid var(--vz-border-color);
    position: relative;
    cursor: zoom-in;
}

.question-image-wrap img {
    display: block;
    width: 100%;
    height: auto;
}

.question-image-wrap::after {
    content: "Click to expand";
    position: absolute;
    right: .5rem;
    bottom: .5rem;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: .6875rem;
    padding: .15rem .5rem;
    border-radius: .25rem;
}

.question-card-actions {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--vz-light);
    padding: .25rem;
    border-radius: .5rem;
}

.question-card-actions .btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Numbered answer buttons for image-based MCQs, whose real option text is
   baked into the scanned image itself. */
.image-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: .5rem;
    max-width: 360px;
}

.image-option-grid .btn {
    height: 52px;
    font-size: 1.0625rem;
    font-weight: 700;
    border-width: 2px;
}

.mark-review-btn.active {
    background-color: var(--vz-warning);
    border-color: var(--vz-warning);
    color: #212529;
}

.calculator-panel {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1030;
    width: 240px;
    background: var(--vz-card-bg);
    border: 1px solid var(--vz-border-color);
    border-radius: .5rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .15);
    padding: .75rem;
}

.calculator-display {
    background: var(--vz-light);
    border-radius: .375rem;
    padding: .5rem .75rem;
    text-align: right;
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
    margin-bottom: .5rem;
    overflow-x: auto;
    white-space: nowrap;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .35rem;
}

.calculator-key {
    padding: .5rem 0;
    font-size: .9375rem;
}

.calculator-key-eq {
    background-color: var(--vz-primary);
    border-color: var(--vz-primary);
    color: #fff;
}

.proctor-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, .75);
    display: flex;
    align-items: center;
    justify-content: center;
}

.proctor-lock-box {
    background: var(--vz-card-bg);
    border-radius: .75rem;
    padding: 2rem;
    max-width: 380px;
    text-align: center;
}

.proctor-lock-box i {
    font-size: 2.5rem;
    color: var(--vz-danger);
}

.code-editor-ace {
    border: 1px solid var(--vz-border-color);
    border-radius: .375rem;
    overflow: hidden;
}

.run-code-output {
    background: var(--vz-light);
    border-radius: .375rem;
    padding: .5rem .75rem;
    white-space: pre-wrap;
    max-height: 220px;
    overflow-y: auto;
}

/* -------------------------------------------------------------- guidelines */

.guidelines-list li {
    margin-bottom: .75rem;
    line-height: 1.6;
}

.guidelines-list li:last-child {
    margin-bottom: 0;
}

.legend-swatch {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: .375rem;
    flex: 0 0 auto;
}

.legend-not-answered {
    background: var(--vz-card-bg);
    border: 2px solid var(--vz-border-color);
}

.legend-answered {
    background-color: var(--vz-primary);
}

.legend-marked {
    background-color: var(--vz-warning);
}

.guidelines-camera-preview {
    display: block;
    width: 200px;
    max-width: 100%;
    border-radius: .5rem;
    margin-top: .75rem;
    border: 1px solid var(--vz-border-color);
}

.guidelines-declaration {
    position: sticky;
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, .06);
}

/* ------------------------------------------------------------------- result */

.score-ring {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 10px solid var(--vz-primary);
    background: var(--vz-card-bg);
}

/* ------------------------------------------------------------------- login */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--vz-body-bg, #f3f3f9);
}

.login-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.login-box { width: 100%; max-width: 400px; }

.login-logo { text-align: center; margin-bottom: 1.25rem; }
.login-logo img { width: 100%; max-width: 170px; height: auto; }

.login-card {
    background: var(--vz-card-bg, #fff);
    border-radius: .25rem;
    padding: 1.5rem;
    box-shadow: 0 5px 10px rgba(30, 32, 37, .12);
    animation: login-rise .45s ease both;
}

.login-card h5 { font-size: 1rem; }

.login-card .form-label { font-size: .8125rem; margin-bottom: .3rem; }
.login-card .form-control { font-size: .8125rem; }

.login-card .btn-success {
    --vz-btn-bg: #8fa80f;
    --vz-btn-border-color: #8fa80f;
    --vz-btn-hover-bg: #7d9409;
    --vz-btn-hover-border-color: #7d9409;
    --vz-btn-active-bg: #6f8508;
    --vz-btn-active-border-color: #6f8508;
    font-size: .875rem;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.login-card .btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(143, 168, 15, .35); }

.login-card .form-check-input:checked { background-color: #8fa80f; border-color: #8fa80f; }
.login-card .form-check-label { font-size: .8125rem; }

.login-card .invalid-feedback { display: block; font-size: .75rem; animation: login-fade .25s ease both; }
.login-card .form-control.is-invalid { background-image: none; padding-right: .9rem; }
.login-card .alert { font-size: .8125rem; padding: .6rem .9rem; animation: login-fade .3s ease both; }

.login-card.has-errors { animation: login-rise .45s ease both, login-shake .4s .45s both; }
.login-logo { animation: login-fade .5s ease both; }

.login-footer {
    text-align: center;
    padding: 1rem;
    font-size: .75rem;
    color: var(--vz-secondary-color, #878a99);
}

@keyframes login-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes login-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes login-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .login-logo, .login-card, .login-card .alert, .login-card .invalid-feedback { animation: none !important; }
}

.login-card .alert { position: relative; padding-right: 2.5rem; border: 0; border-left: 3px solid currentColor; }
.login-card .alert .btn-close { position: absolute; top: .55rem; right: .6rem; padding: .35rem; font-size: .6rem; }
.login-card .alert-danger { background: #fdecea; color: #c63d24; }
.login-card .alert-success { background: #e3f6f1; color: #087f6d; }
.login-card .alert-warning { background: #fef4e0; color: #946200; }
.login-card .alert-info { background: #e3f3fb; color: #1f7bad; }
.login-card .alert > div { color: inherit; }

.login-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 1rem;
    padding: .6rem .9rem;
    font-size: .8125rem;
    line-height: 1.4;
    color: #5f7208;
    background: #f1f7d6;
    border: 1px solid #dfe9a8;
    border-radius: .25rem;
    animation: login-fade .6s .3s ease both;
}
.login-note i { font-size: 1rem; color: #8fa80f; flex-shrink: 0; }
.login-note strong { color: #3f4d03; font-weight: 600; }

/* ============================================================ exam list v2 */

/* topbar: light, logo-first */
.student-topbar {
    background: #fff;
    color: var(--vz-body-color, #495057);
    border-bottom: 1px solid #e9ebec;
    box-shadow: 0 1px 8px rgba(30, 32, 37, .05);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.student-topbar a,
.student-topbar .navbar-brand { color: #495057; text-decoration: none; transition: color .15s ease; }
.student-topbar a:hover { color: #7d9409; }
.brand-logo-badge { padding: 0; background: transparent; border-radius: 0; }
.brand-logo-badge img { height: 34px; }
.topbar-avatar { background: #8fa80f; color: #fff; width: 28px; height: 28px; font-size: .8125rem; }

/* cards */
.exam-card {
    border: 1px solid #e9ebec;
    border-radius: .75rem;
    box-shadow: 0 1px 2px rgba(30, 32, 37, .04);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    animation: exam-rise .5s ease both;
}
.exam-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(30, 32, 37, .10); border-color: transparent; }
.exam-card .card-body { padding: 1.25rem; }
.exam-card-icon {
    width: 44px; height: 44px; border-radius: .65rem;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.exam-card-title { font-size: 1.0625rem; font-weight: 600; }
.exam-card-desc {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.exam-meta {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .3rem .65rem; font-size: .75rem; font-weight: 500;
    color: #495057; background: #f3f6f9; border-radius: 2rem;
}
.exam-btn { border-radius: .5rem; font-weight: 600; padding: .55rem 1rem; transition: transform .15s ease, box-shadow .15s ease; }
.exam-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(30, 32, 37, .12); }
.exam-card .btn-success { --vz-btn-bg: #8fa80f; --vz-btn-border-color: #8fa80f; --vz-btn-hover-bg: #7d9409; --vz-btn-hover-border-color: #7d9409; --vz-btn-active-bg: #6f8508; --vz-btn-active-border-color: #6f8508; }
.exam-card .btn-outline-success { --vz-btn-color: #6f8508; --vz-btn-border-color: #8fa80f; --vz-btn-hover-bg: #8fa80f; --vz-btn-hover-border-color: #8fa80f; --vz-btn-hover-color: #fff; }
.exam-card-accent.bg-primary { background: linear-gradient(90deg, #405189, #3577f1) !important; }
.exam-card-accent.bg-success { background: linear-gradient(90deg, #8fa80f, #bcd131) !important; }
.exam-card-accent.bg-warning { background: linear-gradient(90deg, #f7b84b, #f1963b) !important; }
.exam-empty { border: 1px dashed #ced4da; border-radius: .75rem; box-shadow: none; }

/* hero */
.exam-hero {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.75rem 2rem; color: #fff; border-radius: 1rem; overflow: hidden;
    background: linear-gradient(120deg, #405189 0%, #3577f1 60%, #5b8def 100%);
    box-shadow: 0 10px 28px rgba(53, 119, 241, .25);
    animation: exam-rise .5s ease both;
}
.exam-hero::before, .exam-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.exam-hero::before { width: 260px; height: 260px; right: -60px; top: -110px; }
.exam-hero::after { width: 160px; height: 160px; right: 140px; bottom: -90px; background: rgba(188, 209, 49, .22); }
.exam-hero-text { position: relative; z-index: 1; }
.exam-hero-kicker { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.exam-hero-title { color: #fff; font-weight: 600; margin: .25rem 0 .35rem; font-size: 1.5rem; }
.exam-hero-sub { opacity: .92; font-size: .9rem; }
.exam-hero-sub strong { color: #d8ea5a; }
.exam-hero-art {
    position: relative; z-index: 1; width: 84px; height: 84px;
    align-items: center; justify-content: center; font-size: 2.6rem;
    border-radius: 1.25rem; background: rgba(255, 255, 255, .16);
}

/* stat tiles */
.stat-tile {
    display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem;
    background: #fff; border: 1px solid #e9ebec; border-radius: .75rem;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: exam-rise .5s .08s ease both;
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30, 32, 37, .08); }
.stat-icon { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; border-radius: .65rem; }
.stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1.1; color: #212529; }
.stat-label { font-size: .75rem; color: #878a99; margin-top: .15rem; }
.stat-primary .stat-icon { background: #e4ebfd; color: #3577f1; }
.stat-info .stat-icon { background: #e1f3fb; color: #299cdb; }
.stat-warning .stat-icon { background: #fef2dc; color: #e69b1f; }
.stat-success .stat-icon { background: #eef5cf; color: #7d9409; }

/* filter tabs */
.exam-tabs { display: inline-flex; gap: .25rem; padding: .25rem; background: #fff; border: 1px solid #e9ebec; border-radius: 2rem; }
.exam-tab {
    display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .9rem;
    font-size: .8125rem; font-weight: 500; color: #6c757d; text-decoration: none;
    border-radius: 2rem; transition: background-color .15s ease, color .15s ease;
}
.exam-tab:hover { color: #405189; background: #f3f6f9; }
.exam-tab.active { color: #fff; background: #405189; }
.exam-tab-count { min-width: 20px; padding: 0 .35rem; font-size: .6875rem; line-height: 18px; text-align: center; border-radius: 1rem; background: rgba(0, 0, 0, .07); }
.exam-tab.active .exam-tab-count { background: rgba(255, 255, 255, .25); }

@keyframes exam-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .exam-card, .exam-hero, .stat-tile { animation: none !important; } }
@media (max-width: 575px) { .exam-hero { padding: 1.25rem; } .exam-hero-title { font-size: 1.2rem; } }

/* ============================================================ exam play v2 */
.exam-play {
    --ep-navy: #405189;
    --ep-navy-dark: #313f6d;
    --ep-navy-soft: #eaeefb;
    --ep-lime: #8fa80f;
    --ep-lime-soft: #f1f7d6;
    --ep-amber: #f7b84b;
    --ep-line: #e3e7ee;
    --ep-text: #2b3245;
}

/* one consistent brand blue instead of the theme's purple */
.exam-play .btn-primary,
.exam-play .offcanvas .btn-primary {
    --vz-btn-bg: var(--ep-navy);
    --vz-btn-border-color: var(--ep-navy);
    --vz-btn-hover-bg: var(--ep-navy-dark);
    --vz-btn-hover-border-color: var(--ep-navy-dark);
    --vz-btn-active-bg: var(--ep-navy-dark);
    --vz-btn-active-border-color: var(--ep-navy-dark);
    --vz-btn-disabled-bg: var(--ep-navy);
    --vz-btn-disabled-border-color: var(--ep-navy);
}
.exam-play .btn-outline-primary {
    --vz-btn-color: var(--ep-navy);
    --vz-btn-border-color: #c9d1ea;
    --vz-btn-hover-bg: var(--ep-navy);
    --vz-btn-hover-border-color: var(--ep-navy);
    --vz-btn-active-bg: var(--ep-navy);
    --vz-btn-active-border-color: var(--ep-navy);
    --vz-btn-disabled-color: var(--ep-navy);
    --vz-btn-disabled-border-color: #c9d1ea;
}
.exam-play .btn-success {
    --vz-btn-bg: var(--ep-lime);
    --vz-btn-border-color: var(--ep-lime);
    --vz-btn-hover-bg: #7d9409;
    --vz-btn-hover-border-color: #7d9409;
    --vz-btn-active-bg: #6f8508;
    --vz-btn-active-border-color: #6f8508;
    font-weight: 600;
}

/* ---- header */
.exam-play-header {
    top: 64px;
    padding: .85rem 1.15rem;
    background: #fff;
    border: 1px solid var(--ep-line);
    border-radius: .85rem;
    box-shadow: 0 6px 18px rgba(30, 32, 37, .07);
}
.exam-play-title { font-size: 1.1rem; font-weight: 700; color: var(--ep-text); }
.exam-play-meta { display: inline-flex; gap: .9rem; font-size: .8rem; color: #7b8396; }
.exam-play-meta i { color: var(--ep-lime); vertical-align: -1px; margin-right: .2rem; }

.exam-tool-btn {
    width: 36px; height: 36px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: .55rem; border: 1px solid var(--ep-line); color: #5b647a; background: #fff;
}
.exam-tool-btn:hover { background: var(--ep-navy-soft); color: var(--ep-navy); border-color: #c9d1ea; }

.exam-play-header .badge { border-radius: 2rem; padding: .4rem .75rem; font-weight: 600; font-size: .72rem; }
#save-status.bg-success { background-color: var(--ep-lime-soft) !important; color: #5f7208 !important; }

.exam-timer-wrap {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .85rem; border-radius: 2rem;
    background: var(--ep-navy-soft); color: var(--ep-navy); font-weight: 700;
}
.exam-timer-wrap i { font-size: 1.1rem; }
#exam-timer { font-size: 1.15rem; min-width: 3.6rem; }
.exam-timer-wrap:has(.timer-danger) { background: #fdecea; color: #d6393f; }

#submit-btn { border-radius: .6rem; padding: .5rem 1.1rem; box-shadow: 0 4px 12px rgba(143, 168, 15, .3); }

/* ---- instructions */
.exam-play .alert-info { border: 0; border-left: 4px solid #299cdb; background: #eaf5fc; color: #1f6b94; border-radius: .6rem; }

/* ---- section tabs */
.exam-section-nav {
    background: #fff; border: 1px solid var(--ep-line); border-radius: 2rem; padding: .3rem; gap: .2rem;
    overflow-x: auto; flex-wrap: nowrap !important;
}
.exam-section-nav .nav-link { border-radius: 2rem; padding: .45rem 1.1rem; font-weight: 600; color: #5b647a; white-space: nowrap; transition: background-color .15s, color .15s; }
.exam-section-nav .nav-link:hover { background: var(--ep-navy-soft); color: var(--ep-navy); }
.exam-section-nav .nav-link.active { background: var(--ep-navy); color: #fff; box-shadow: 0 3px 8px rgba(64, 81, 137, .3); }

/* ---- stepper */
.question-stepper .btn { border-radius: .6rem; padding: .5rem 1.1rem; font-weight: 600; }
.question-stepper .btn-outline-secondary { border-color: var(--ep-line); color: #5b647a; background: #fff; }
.question-stepper .btn-outline-secondary:hover { background: var(--ep-navy-soft); color: var(--ep-navy); border-color: #c9d1ea; }
.question-stepper #question-next-btn { background: var(--ep-navy); border-color: var(--ep-navy); color: #fff; }
.question-stepper #question-next-btn:hover { background: var(--ep-navy-dark); }
.question-position {
    padding: .35rem .9rem; border-radius: 2rem; background: #fff; border: 1px solid var(--ep-line);
    font-size: .8125rem; font-weight: 600; color: #5b647a;
}

.question-section-header h5 {
    font-size: .95rem; font-weight: 700; color: var(--ep-navy); text-transform: uppercase; letter-spacing: .05em;
    padding-left: .7rem; border-left: 4px solid var(--ep-lime);
}

/* ---- question card */
.exam-play .question-card {
    border: 1px solid var(--ep-line); border-radius: .85rem; box-shadow: 0 4px 16px rgba(30, 32, 37, .05);
}
.exam-play .question-card.active { animation: ep-fade .3s ease both; }
.exam-play .question-card .card-body { padding: 1.4rem; }
.question-num {
    width: 38px; height: 38px; font-size: .95rem; font-weight: 700;
    background: linear-gradient(135deg, var(--ep-navy), #3577f1); color: #fff;
    box-shadow: 0 4px 10px rgba(64, 81, 137, .3);
}
.exam-play .question-card .badge { border-radius: 2rem; font-weight: 700; padding: .35rem .65rem; }
.question-card-actions { background: #f3f6f9; border-radius: .6rem; }
.question-card-actions .btn { border-radius: .5rem; background: #fff; border-color: var(--ep-line); }
.question-card-actions .mark-review-btn { color: #d68a14; }
.question-card-actions .mark-review-btn:hover,
.mark-review-btn.active { background-color: var(--ep-amber); border-color: var(--ep-amber); color: #3a2a00; }
.question-card-actions .clear-response-btn { color: #6c757d; }
.question-card-actions .clear-response-btn:hover { background: #fdecea; color: #d6393f; border-color: #f5c6c2; }

.question-image-wrap { border: 1px solid var(--ep-line); border-radius: .75rem; background: #fff; max-height: 520px; overflow: auto; }
.question-image-wrap::after { background: rgba(43, 50, 69, .75); border-radius: 2rem; padding: .2rem .65rem; }

/* ---- answers: text options as selectable cards */
.exam-play .question-card .form-check {
    position: relative; margin-bottom: .6rem; padding: .8rem 1rem .8rem 3rem;
    border: 1.5px solid var(--ep-line); border-radius: .7rem; background: #fff; cursor: pointer;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.exam-play .question-card .form-check:hover { border-color: #aab6dc; background: #f8f9fe; }
.exam-play .question-card .form-check .form-check-input { position: absolute; left: 1rem; top: 50%; margin: -.55rem 0 0; float: none; }
.exam-play .question-card .form-check .form-check-label { display: block; cursor: pointer; width: 100%; }
.exam-play .question-card .form-check:has(.form-check-input:checked) {
    border-color: var(--ep-navy); background: var(--ep-navy-soft); box-shadow: 0 0 0 3px rgba(64, 81, 137, .12);
}
.exam-play .question-card .form-check-input:checked { background-color: var(--ep-navy); border-color: var(--ep-navy); }
.exam-play .question-card .form-check-input:checked ~ .form-check-label { color: var(--ep-navy); font-weight: 600; }

/* ---- answers: numbered buttons for image questions */
.image-option-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 420px; gap: .75rem; }
.image-option-grid .btn {
    height: 56px; border-radius: .75rem; font-size: 1.15rem; border-width: 1.5px;
    background: #fff; color: var(--ep-navy); border-color: var(--ep-line);
    transition: transform .15s, box-shadow .15s, background-color .15s, border-color .15s;
}
.image-option-grid .btn:hover { border-color: var(--ep-navy); background: var(--ep-navy-soft); transform: translateY(-2px); }
.image-option-grid .btn-check:checked + .btn {
    background: var(--ep-navy); border-color: var(--ep-navy); color: #fff; box-shadow: 0 6px 14px rgba(64, 81, 137, .35);
}

.exam-play .input-group-text { background: var(--ep-navy-soft); border-color: var(--ep-line); color: var(--ep-navy); }
.exam-play .answer-input.form-control { border-color: var(--ep-line); border-radius: .6rem; }
.exam-play .answer-input.form-control:focus { border-color: var(--ep-navy); box-shadow: 0 0 0 3px rgba(64, 81, 137, .15); }

.question-save-state { color: #7d9409; font-weight: 600; }

/* ---- palette */
.question-palette { top: 144px; border: 1px solid var(--ep-line); border-radius: .85rem; box-shadow: 0 6px 18px rgba(30, 32, 37, .07); overflow: hidden; }
.question-palette .card-header { background: var(--ep-navy-soft); border-bottom: 1px solid var(--ep-line); padding: .85rem 1.1rem; }
.question-palette .card-title { color: var(--ep-navy); font-weight: 700; }
.question-palette .card-body { max-height: calc(100vh - 290px); overflow-y: auto; padding: 1.1rem; }

.palette-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.palette-grid .palette-btn { width: 100%; height: 38px; }
.palette-btn {
    border-radius: .55rem; font-weight: 700; font-size: .8125rem;
    border: 1.5px solid var(--ep-line); background: #fff; color: #5b647a;
    transition: transform .12s, background-color .12s, border-color .12s;
}
.palette-btn.btn-outline-secondary { --vz-btn-hover-bg: var(--ep-navy-soft); --vz-btn-hover-color: var(--ep-navy); --vz-btn-hover-border-color: #aab6dc; --vz-btn-color: #5b647a; --vz-btn-border-color: var(--ep-line); }
.palette-btn:hover { transform: translateY(-1px); }
.palette-btn.btn-primary { color: #fff; box-shadow: 0 3px 8px rgba(64, 81, 137, .3); }
.palette-btn.marked { background: var(--ep-amber); border-color: var(--ep-amber); color: #3a2a00; box-shadow: 0 3px 8px rgba(247, 184, 75, .4); }
.palette-btn.current { outline: 2px solid var(--ep-lime); outline-offset: 2px; }

.palette-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--ep-line); font-size: .75rem; color: #6c7488; }
.palette-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.palette-legend .legend-swatch { width: 14px; height: 14px; border-radius: .3rem; }
.exam-play .legend-answered { background: var(--ep-navy); }
.exam-play .legend-marked { background: var(--ep-amber); }
.exam-play .legend-not-answered { background: #fff; border: 1.5px solid #c9d1de; }

/* ---- bottom submit */
.exam-submit-card { border: 1px dashed #c9d1de; border-radius: .85rem; background: #fbfcfe; box-shadow: none; }
#submit-btn-bottom { border-radius: .65rem; padding: .65rem 2rem; box-shadow: 0 6px 16px rgba(143, 168, 15, .35); }

/* ---- calculator */
.calculator-panel { border-radius: .85rem; border: 1px solid var(--ep-line); }
.calculator-display { background: var(--ep-navy-soft); color: var(--ep-navy); font-weight: 700; }
.calculator-key { border-radius: .5rem; }
.calculator-key-eq { background: var(--ep-lime); border-color: var(--ep-lime); }

@keyframes ep-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .exam-play .question-card.active { animation: none; } }
@media (max-width: 991px) {
    .exam-play-header { top: 62px; }
    .image-option-grid { max-width: none; }
}

.proctor-lock-overlay { background: rgba(33, 41, 66, .82); backdrop-filter: blur(3px); }
.proctor-lock-box { background: #fff; color: #2b3245; border-radius: 1rem; padding: 2rem 2.25rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.proctor-lock-box h5, .proctor-lock-box h4, .proctor-lock-box h6 { color: #2b3245; }
.proctor-lock-box p { color: #6c7488; }

.exam-play .question-image-wrap { overflow: hidden; max-height: 480px; }
.palette-grid { gap: .4rem; }
.palette-grid .palette-btn { height: 34px; }
.question-palette .card-body { max-height: calc(100vh - 270px); scrollbar-width: thin; }

.palette-btn.btn-primary { background: var(--ep-navy, #405189); border-color: var(--ep-navy, #405189); color: #fff; }
.palette-btn.btn-primary:hover { background: #313f6d; border-color: #313f6d; color: #fff; }
.palette-btn.marked { background: #f7b84b; border-color: #f7b84b; color: #3a2a00; }

/* ================================================== cards + result (polish) */

/* every card in the student portal */
main .card {
    border: 1px solid #e3e7ee;
    border-radius: .9rem;
    box-shadow: 0 2px 10px rgba(30, 32, 37, .05);
    background: #fff;
}
main .card-header {
    background: #f7f9fc;
    border-bottom: 1px solid #e3e7ee;
    border-radius: .9rem .9rem 0 0;
    padding: .9rem 1.25rem;
}
main .card-header .card-title { color: #2b3245; font-weight: 700; font-size: .95rem; }
main .card-header .card-title i { color: #8fa80f; }

/* ---- exam cards */
.exam-card { border: 1px solid #e3e7ee; border-radius: 1rem; overflow: hidden; box-shadow: 0 2px 10px rgba(30, 32, 37, .05); }
.exam-card:hover { transform: translateY(-5px); box-shadow: 0 18px 38px rgba(30, 32, 37, .12); }

.exam-card-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.1rem 1.25rem;
    color: #fff;
    overflow: hidden;
}
.exam-card-head::after {
    content: "";
    position: absolute; right: -30px; top: -40px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}
.exam-card-head.tone-primary { background: linear-gradient(120deg, #405189, #3577f1); }
.exam-card-head.tone-success { background: linear-gradient(120deg, #6f8508, #a9c21b); }
.exam-card-head.tone-warning { background: linear-gradient(120deg, #e8890c, #f7b84b); }

.exam-card-head .exam-card-icon {
    width: 46px; height: 46px; flex-shrink: 0; border-radius: .8rem;
    background: rgba(255, 255, 255, .2); color: #fff; font-size: 1.45rem;
    display: inline-flex; align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
}
.exam-card-head-text { display: flex; flex-direction: column; gap: .15rem; position: relative; z-index: 1; }
.exam-card-head .exam-card-kind { color: rgba(255, 255, 255, .8); font-size: .6875rem; font-weight: 700; letter-spacing: .09em; margin: 0; }
.exam-status { font-size: .9rem; font-weight: 700; display: inline-flex; align-items: center; gap: .35rem; }

.exam-card .card-body { padding: 1.25rem 1.25rem 1.3rem; }
.exam-card-title { font-size: 1.1rem; font-weight: 700; color: #2b3245; line-height: 1.3; }
.exam-meta { background: #f3f6f9; color: #3c455a; padding: .35rem .75rem; }
.exam-meta i { color: #8fa80f; font-size: .95rem; }
.exam-card .btn { padding: .65rem 1rem; border-radius: .65rem; }
.exam-card .btn-light:disabled { background: #f1f3f7; border-color: #e3e7ee; color: #8b93a5; opacity: 1; }

/* ---- result page */
.result-hero { overflow: hidden; border: 0; box-shadow: 0 12px 34px rgba(30, 32, 37, .10); }
main .result-hero { border-radius: 1.1rem; }

.result-hero-top {
    position: relative;
    padding: 1.6rem 1.75rem 4.2rem;
    text-align: center;
    color: #fff;
    background: linear-gradient(120deg, #405189 0%, #3577f1 100%);
    overflow: hidden;
}
.result-hero.result-success .result-hero-top { background: linear-gradient(120deg, #5f7208 0%, #a2bb14 100%); }
.result-hero.result-warning .result-hero-top { background: linear-gradient(120deg, #e07b00 0%, #f7b84b 100%); }
.result-hero.result-danger .result-hero-top { background: linear-gradient(120deg, #c93a3f 0%, #f06548 100%); }
.result-hero-top::before, .result-hero-top::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.result-hero-top::before { width: 280px; height: 280px; left: -80px; top: -140px; }
.result-hero-top::after { width: 200px; height: 200px; right: -50px; bottom: -110px; }
.result-hero-top > * { position: relative; z-index: 1; }

.result-hero-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .25rem .8rem; border-radius: 2rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    background: rgba(255, 255, 255, .18);
}
.result-hero-title { color: #fff; font-weight: 700; margin: .75rem 0 .35rem; font-size: 1.5rem; }
.result-hero-date { display: inline-flex; align-items: center; gap: .35rem; font-size: .8125rem; opacity: .88; }

.result-hero-body { padding: 0 1.75rem 1.9rem; text-align: center; }

.result-score-wrap {
    display: flex; align-items: center; justify-content: center; gap: 2rem; flex-wrap: wrap;
    margin-top: -3.2rem;
}

.score-ring {
    --ring: #405189;
    width: 170px; height: 170px; margin: 0; border: 0; flex-shrink: 0;
    border-radius: 50%; padding: 11px;
    background: conic-gradient(var(--ring) calc(var(--pct) * 1%), #e7ebf3 0);
    box-shadow: 0 10px 28px rgba(30, 32, 37, .18);
    display: flex; align-items: center; justify-content: center;
    animation: ring-in .8s ease both;
}
.result-success .score-ring { --ring: #8fa80f; }
.result-warning .score-ring { --ring: #f0a020; }
.result-danger .score-ring { --ring: #e5484d; }

.score-ring-inner {
    width: 100%; height: 100%; border-radius: 50%; background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-ring-value { font-size: 2.6rem; font-weight: 800; line-height: 1; color: #2b3245; }
.score-ring-max { margin-top: .3rem; font-size: .8125rem; color: #7b8396; }

.result-verdict { text-align: left; max-width: 340px; padding-top: 3rem; }
.result-verdict h4 { font-weight: 800; color: #2b3245; margin-bottom: .3rem; }
.result-verdict p { color: #6c7488; margin-bottom: .9rem; font-size: .9rem; }
.result-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.result-pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .4rem .85rem; border-radius: 2rem; font-size: .8125rem; font-weight: 600;
    background: #f3f6f9; color: #3c455a; border: 1px solid #e3e7ee;
}
.result-pill i { color: #8fa80f; }

.result-btn { border-radius: .65rem; padding: .6rem 1.3rem; font-weight: 600; }
.result-hero .btn-success { --vz-btn-bg: #8fa80f; --vz-btn-border-color: #8fa80f; --vz-btn-hover-bg: #7d9409; --vz-btn-hover-border-color: #7d9409; box-shadow: 0 6px 14px rgba(143, 168, 15, .3); }
.result-hero .btn-light { background: #f3f6f9; border-color: #e3e7ee; color: #3c455a; }

@media (max-width: 575px) {
    .result-verdict { text-align: center; padding-top: 0; }
    .result-pills { justify-content: center; }
}

/* analysis cards */
.analysis-card-ai { border-top: 4px solid #405189 !important; }
.analysis-card-manual { border-top: 4px solid #f7b84b !important; }
.analysis-card .card-body ul { padding-left: 1.1rem; }
.analysis-card .card-body ul li { margin-bottom: .35rem; }
.analysis-card .col-md-4 { }
.resonance-badge { background: linear-gradient(90deg, #405189, #3577f1); }

/* answer review */
.review-item { padding: 1rem 0; border-top: 1px solid #edf0f5; }
.review-item:first-child { border-top: 0; padding-top: .2rem; }
.review-num {
    width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .8125rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #405189, #3577f1);
}
.review-options li { padding: .4rem .75rem; margin-bottom: .35rem; border: 1px solid #e3e7ee; border-radius: .55rem; background: #fff; }
.review-options li.opt-correct { background: #eff6d4; border-color: #cfe08a; color: #4d6a0a; font-weight: 600; }
.review-options li.opt-wrong { background: #fdecea; border-color: #f5c6c2; color: #c63d24; }
.review-marks { font-size: .78rem; padding: .4rem .75rem; }

@keyframes ring-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .score-ring { animation: none; } }

.result-hero-body { position: relative; z-index: 2; }

/* ===================================================== guidelines page */
.guide-hero {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
    padding: 1.75rem 2rem; color: #fff; border-radius: 1rem; overflow: hidden;
    background: linear-gradient(120deg, #2f3d70 0%, #405189 45%, #3577f1 100%);
    box-shadow: 0 12px 30px rgba(53, 119, 241, .25);
}
.guide-hero::before { content: ""; position: absolute; width: 260px; height: 260px; right: -70px; top: -120px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.guide-hero::after { content: ""; position: absolute; width: 150px; height: 150px; left: 38%; bottom: -100px; border-radius: 50%; background: rgba(188, 209, 49, .25); }
.guide-hero > * { position: relative; z-index: 1; }
.guide-hero-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .8rem; border-radius: 2rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(255, 255, 255, .18); }
.guide-hero-title { color: #fff; font-weight: 800; margin: .7rem 0 .4rem; font-size: 1.6rem; }
.guide-hero-sub { max-width: 520px; opacity: .92; font-size: .9rem; }
.guide-hero-sub strong { color: #d8ea5a; }
.guide-hero-exam {
    display: flex; flex-direction: column; gap: .2rem; min-width: 220px; padding: 1rem 1.25rem; border-radius: .85rem;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(4px);
}
.guide-hero-exam-label { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.guide-hero-exam-title { font-size: 1.1rem; font-weight: 700; }
.guide-hero-exam-meta { display: flex; gap: .9rem; font-size: .8125rem; opacity: .92; }
.guide-hero-exam-meta i { color: #d8ea5a; margin-right: .2rem; }

.guide-steps { list-style: none; counter-reset: gstep; padding-left: 0; }
.guide-steps li {
    counter-increment: gstep; position: relative; padding: .15rem 0 .15rem 3rem; margin-bottom: 1rem; line-height: 1.6; color: #3c455a; font-size: .9rem;
}
.guide-steps li::before {
    content: counter(gstep); position: absolute; left: 0; top: .05rem;
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .8125rem; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #405189, #3577f1); box-shadow: 0 4px 10px rgba(64, 81, 137, .25);
}
.guide-steps li strong { color: #2b3245; }

.guide-card-warn { border-left: 4px solid #e5484d !important; }
.guide-card-warn .card-header { background: #fff5f4; }
.guide-card ul li { margin-bottom: .25rem; }

.guide-legend-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; font-size: .875rem; color: #3c455a; }
.guide-legend-row:last-child { margin-bottom: 0; }
.guide-legend-row .legend-swatch { width: 34px; height: 34px; border-radius: .55rem; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; }
.guide-legend-row .legend-answered { background: #405189; color: #fff; }
.guide-legend-row .legend-marked { background: #f7b84b; color: #3a2a00; }
.guide-legend-row .legend-not-answered { background: #fff; border: 1.5px solid #c9d1de; color: #5b647a; }

.guide-summary-row { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px dashed #e3e7ee; font-size: .875rem; }
.guide-summary-row:last-child { border-bottom: 0; padding-bottom: 0; }
.guide-summary-row .text-muted { flex: 1; }
.guide-summary-ic { width: 32px; height: 32px; border-radius: .55rem; display: inline-flex; align-items: center; justify-content: center; background: #f1f7d6; color: #7d9409; font-size: 1.05rem; }

.guide-declaration { border: 1px solid #d9e27a !important; background: #fcfdf2 !important; box-shadow: 0 -6px 18px rgba(30, 32, 37, .08) !important; }
.guide-declaration .form-check-input:checked { background-color: #8fa80f; border-color: #8fa80f; }
.guide-start-btn { --vz-btn-bg: #8fa80f; --vz-btn-border-color: #8fa80f; --vz-btn-hover-bg: #7d9409; --vz-btn-hover-border-color: #7d9409; --vz-btn-disabled-bg: #c8d58a; --vz-btn-disabled-border-color: #c8d58a; border-radius: .7rem; font-weight: 700; font-size: .95rem; padding: .7rem 1.6rem; box-shadow: 0 6px 16px rgba(143, 168, 15, .3); }
.guide-start-btn:disabled { box-shadow: none; opacity: 1; color: #fff; }

/* ============================================ exam list: hero + tiles v3 */
.exam-hero { background: linear-gradient(120deg, #2f3d70 0%, #405189 45%, #3577f1 100%); }
.exam-hero-art { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); }

.stat-tile { position: relative; overflow: hidden; padding: 1.1rem 1.25rem; border-radius: .9rem; box-shadow: 0 2px 10px rgba(30, 32, 37, .05); }
.stat-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tile, #405189); }
.stat-tile::after { content: ""; position: absolute; right: -24px; bottom: -34px; width: 90px; height: 90px; border-radius: 50%; background: var(--tile, #405189); opacity: .07; }
.stat-primary { --tile: #3577f1; } .stat-info { --tile: #299cdb; } .stat-warning { --tile: #f1a020; } .stat-success { --tile: #8fa80f; }
.stat-icon { width: 50px; height: 50px; font-size: 1.45rem; border-radius: .8rem; }
.stat-value { font-size: 1.75rem; font-weight: 800; }
.stat-label { font-size: .8rem; font-weight: 500; }

/* ===================================== colourful stat tiles (all pages) */
.stat-tile {
    color: #fff; border: 0; padding: 1.25rem 1.35rem; border-radius: 1rem;
    box-shadow: 0 10px 22px var(--tile-shadow, rgba(53, 119, 241, .25));
    background: var(--tile-bg, linear-gradient(135deg, #405189, #3577f1));
}
.stat-tile::before { display: none; }
.stat-tile::after { right: -28px; bottom: -40px; width: 120px; height: 120px; background: #fff; opacity: .14; }
.stat-tile:hover { transform: translateY(-4px); box-shadow: 0 16px 30px var(--tile-shadow, rgba(53, 119, 241, .3)); }
.stat-tile .stat-icon { background: rgba(255, 255, 255, .22) !important; color: #fff !important; backdrop-filter: blur(2px); }
.stat-tile .stat-value { color: #fff; }
.stat-tile .stat-label { color: rgba(255, 255, 255, .88); }
.stat-primary { --tile-bg: linear-gradient(135deg, #405189 0%, #3577f1 100%); --tile-shadow: rgba(53, 119, 241, .28); }
.stat-info { --tile-bg: linear-gradient(135deg, #0e8fb8 0%, #3cc3e8 100%); --tile-shadow: rgba(41, 156, 219, .28); }
.stat-warning { --tile-bg: linear-gradient(135deg, #e8820c 0%, #f7b84b 100%); --tile-shadow: rgba(241, 160, 32, .30); }
.stat-success { --tile-bg: linear-gradient(135deg, #6f8508 0%, #a9c21b 100%); --tile-shadow: rgba(143, 168, 15, .30); }

/* ============================================================ dashboard */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dash-head-title { font-weight: 800; color: #2b3245; margin-bottom: .2rem; }
.dash-head-sub { color: #6c7488; font-size: .9rem; }
.dash-head-sub strong { color: #7d9409; }

.dash-resume {
    display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem;
    border-radius: .9rem; background: linear-gradient(120deg, #fff6e4, #fffaf0); border: 1px solid #f6d9a0;
}
.dash-resume-icon { width: 46px; height: 46px; border-radius: .8rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, #e8820c, #f7b84b); }

.dash-empty { text-align: center; padding: 2rem 1rem; color: #8b93a5; }
.dash-empty i { display: block; font-size: 2.4rem; margin-bottom: .4rem; color: #c3cad9; }

.dash-row { display: flex; align-items: center; gap: .9rem; padding: .85rem 0; border-bottom: 1px dashed #e3e7ee; }
.dash-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dash-row:first-child { padding-top: 0; }
.min-w-0 { min-width: 0; }
.dash-row-icon { width: 42px; height: 42px; flex-shrink: 0; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.dash-row-icon.tone-primary { background: #e4ebfd; color: #3577f1; }
.dash-row-icon.tone-success { background: #eef5cf; color: #7d9409; }
.dash-row-icon.tone-warning { background: #fef2dc; color: #e69b1f; }
.dash-row-icon.tone-danger { background: #fdecea; color: #e5484d; }
.dash-row-title { font-weight: 700; color: #2b3245; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-sub { font-size: .78rem; color: #8b93a5; }
.dash-start { border-radius: .55rem; font-weight: 600; padding: .35rem .9rem; }
.dash-score { width: 150px; }
.dash-score-num { font-weight: 700; font-size: .85rem; color: #2b3245; }
.dash-score-num span { color: #8b93a5; font-weight: 500; }
.dash-progress { height: 6px; border-radius: 6px; background: #edf0f5; overflow: hidden; margin-top: .3rem; }
.dash-progress > div { height: 100%; border-radius: 6px; }
.dash-pct { min-width: 54px; text-align: center; padding: .25rem .5rem; border-radius: 2rem; font-weight: 800; font-size: .8rem; }
.dash-pct.tone-success, .dash-progress .tone-success, .trend-bar.tone-success { background: #8fa80f; }
.dash-pct.tone-primary, .dash-progress .tone-primary, .trend-bar.tone-primary { background: #405189; }
.dash-pct.tone-warning, .dash-progress .tone-warning, .trend-bar.tone-warning { background: #f0a020; }
.dash-pct.tone-danger, .dash-progress .tone-danger, .trend-bar.tone-danger { background: #e5484d; }
.dash-pct { color: #fff; }

.trend-chart { display: flex; align-items: flex-end; gap: .9rem; height: 240px; padding-top: .5rem; }
.trend-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.trend-val { font-size: .75rem; font-weight: 700; color: #2b3245; }
.trend-track { flex: 1; width: 100%; max-width: 56px; display: flex; align-items: flex-end; background: #f3f6f9; border-radius: .6rem; overflow: hidden; }
.trend-bar { width: 100%; border-radius: .6rem .6rem 0 0; animation: trend-grow .8s ease both; transform-origin: bottom; }
.trend-label { font-size: .68rem; color: #8b93a5; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@keyframes trend-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .trend-bar { animation: none; } }

/* ============================================================== profile */
.profile-head {
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
    padding: 1.5rem 1.75rem; background: #fff; border: 1px solid #e3e7ee; border-radius: 1rem;
    border-top: 5px solid #8fa80f; box-shadow: 0 2px 10px rgba(30, 32, 37, .05);
}
.profile-avatar {
    width: 76px; height: 76px; flex-shrink: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, #8fa80f, #bcd131); box-shadow: 0 8px 18px rgba(143, 168, 15, .35);
}
.profile-hero-text { flex: 1; min-width: 0; }
.profile-name { font-weight: 800; color: #2b3245; margin-bottom: .45rem; }
.profile-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.profile-chips span { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 2rem; font-size: .78rem; font-weight: 600; background: #f3f6f9; color: #3c455a; }
.profile-chips i { color: #8fa80f; }
.profile-hero-stat { flex-direction: column; align-items: center; padding: .75rem 1.5rem; border-radius: .9rem; color: #fff; background: linear-gradient(135deg, #405189, #3577f1); box-shadow: 0 8px 18px rgba(53, 119, 241, .25); }
.profile-hero-stat strong { font-size: 1.8rem; line-height: 1; }
.profile-hero-stat span { font-size: .75rem; opacity: .9; }

.profile-row { display: flex; align-items: center; gap: .85rem; padding: .7rem 0; border-bottom: 1px dashed #e3e7ee; }
.profile-row-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #8b93a5; }
.profile-row-value { font-weight: 600; color: #2b3245; overflow-wrap: anywhere; }
.profile-note { margin-top: 1rem; padding: .65rem .85rem; border-radius: .6rem; font-size: .8rem; color: #5f7208; background: #f1f7d6; }
#password-form .form-control { padding: .6rem .9rem; border-radius: .6rem; }

main .btn-success { --vz-btn-bg: #8fa80f; --vz-btn-border-color: #8fa80f; --vz-btn-hover-bg: #7d9409; --vz-btn-hover-border-color: #7d9409; --vz-btn-active-bg: #6f8508; --vz-btn-active-border-color: #6f8508; --vz-btn-color: #fff; }
main .btn-outline-success { --vz-btn-color: #6f8508; --vz-btn-border-color: #8fa80f; --vz-btn-hover-bg: #8fa80f; --vz-btn-hover-border-color: #8fa80f; --vz-btn-hover-color: #fff; --vz-btn-active-bg: #8fa80f; }
.topbar-link { font-weight: 500; }

/* ------------------------------------------------ guidelines extras */

.guide-checks {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.guide-check {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .9rem;
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 600;
}

.guide-check i { font-size: 1.1rem; }
.guide-check-ok { background: #e3f6ec; color: #0a8a5b; }
.guide-check-warn { background: #fdecea; color: #d6382b; }
.guide-check-info { background: #e5eefe; color: #2f63d0; }

.guide-table thead th {
    background: var(--vz-light);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--vz-secondary-color, #878a99);
    border-bottom: 0;
}

.guide-start-btn { padding: .75rem 1.75rem; font-weight: 700; box-shadow: 0 6px 16px rgba(10, 179, 156, .35); }

/* Fullscreen gate on the exam screen */
.fs-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 2050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 28, 48, .92);
    padding: 1rem;
}

.fs-gate-box {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem 2.25rem;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .35);
}

.fs-gate-box i { font-size: 2.75rem; color: #3577f1; }

/* ============================================ guidelines: declaration bar v2 */
.guide-declaration {
    border: 0 !important;
    border-radius: 1rem !important;
    background: linear-gradient(120deg, #25305c 0%, #405189 55%, #3577f1 100%) !important;
    box-shadow: 0 -8px 28px rgba(37, 48, 92, .28) !important;
    overflow: hidden;
    position: sticky;
}
.guide-declaration::after {
    content: "";
    position: absolute;
    right: -50px;
    top: -60px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    pointer-events: none;
}
.guide-declaration .card-body { position: relative; z-index: 1; padding: 1.25rem 1.5rem; }
.guide-declaration .form-check { display: flex; align-items: flex-start; gap: .85rem; padding-left: 0; }
.guide-declaration .form-check-input {
    float: none;
    flex: 0 0 auto;
    margin: .1rem 0 0;
    width: 1.6rem;
    height: 1.6rem;
    border: 2px solid rgba(255, 255, 255, .75);
    background-color: rgba(255, 255, 255, .12);
    border-radius: .45rem;
    cursor: pointer;
}
.guide-declaration .form-check-input:checked {
    background-color: #2ed3a0;
    border-color: #2ed3a0;
    box-shadow: 0 0 0 4px rgba(46, 211, 160, .25);
}
.guide-declaration .form-check-label { color: rgba(255, 255, 255, .95); font-size: .9rem !important; line-height: 1.55; cursor: pointer; }
.guide-declaration .btn-light { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); color: #fff; font-weight: 600; }
.guide-declaration .btn-light:hover { background: rgba(255, 255, 255, .25); color: #fff; }

.guide-start-btn {
    --vz-btn-bg: #13c58b;
    --vz-btn-border-color: #13c58b;
    --vz-btn-hover-bg: #0fae7a;
    --vz-btn-hover-border-color: #0fae7a;
    --vz-btn-disabled-bg: rgba(255, 255, 255, .18);
    --vz-btn-disabled-border-color: rgba(255, 255, 255, .25);
    background: linear-gradient(135deg, #13c58b, #5fdc6a);
    border: 0;
    color: #0b3b2a;
    border-radius: .8rem;
    font-weight: 800;
    letter-spacing: .01em;
    padding: .8rem 1.9rem;
    box-shadow: 0 8px 22px rgba(19, 197, 139, .45);
    transition: transform .15s ease, box-shadow .15s ease;
}
.guide-start-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(19, 197, 139, .55); color: #0b3b2a; }
.guide-start-btn:disabled { background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .6); box-shadow: none; opacity: 1; }

.guide-unlock-hint { color: rgba(255, 255, 255, .8); font-size: .8125rem; font-weight: 500; }

/* ============================================ top nav v3 (white, logo-led) */
.student-topbar {
    background: #fff;
    color: #2d3748;
    border-bottom: 3px solid #8fa80f;
    box-shadow: 0 4px 16px rgba(30, 32, 37, .06);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.student-topbar a, .student-topbar .navbar-brand { color: #2d3748; text-decoration: none; }
.topbar-logo { height: 38px; width: auto; display: block; }
.topbar-links { align-self: stretch; gap: .25rem; }
.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: 0 1rem;
    font-size: .875rem;
    font-weight: 600;
    color: #5b6478 !important;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    transition: color .15s ease, background .15s ease;
}
.topbar-link i { font-size: 1.1rem; }
.topbar-link:hover { color: #405189 !important; background: #f4f6fb; }
.topbar-link.active { color: #405189 !important; border-bottom-color: #405189; background: #eef2fb; }
.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .85rem .3rem .3rem;
    border-radius: 999px;
    background: #f1f4f9;
    font-size: .8125rem;
    font-weight: 600;
}
.topbar-user:hover { background: #e6ebf4; }
.topbar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8fa80f, #b4cc2b);
    color: #fff;
    font-weight: 700;
    font-size: .8125rem;
}
.topbar-logout {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .9rem;
    border-radius: .6rem;
    border: 1px solid #d9deea;
    font-size: .8125rem;
    font-weight: 600;
    color: #5b6478 !important;
}
.topbar-logout:hover { background: #fdecea; border-color: #f5c2bb; color: #c63d24 !important; }

/* ============================================ login v3 (split screen) */
.login-wrap { padding: 0; align-items: stretch; }
.login-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); width: 100%; min-height: calc(100vh - 52px); }
.login-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 3rem clamp(1.5rem, 5vw, 4.5rem);
    color: #fff;
    background: linear-gradient(150deg, #1d2750 0%, #2f3d70 45%, #405189 100%);
}
.login-brand::before, .login-brand::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-brand::before { width: 420px; height: 420px; right: -140px; top: -140px; background: rgba(143, 168, 15, .28); }
.login-brand::after { width: 300px; height: 300px; left: -100px; bottom: -110px; background: rgba(255, 255, 255, .07); }
.login-brand-inner { position: relative; z-index: 1; max-width: 460px; }
.login-brand-logo { background: #fff; border-radius: 1rem; padding: 1.1rem 1.5rem; display: inline-block; box-shadow: 0 14px 34px rgba(0, 0, 0, .25); margin-bottom: 2.25rem; }
.login-brand-logo img { display: block; width: 100%; max-width: 320px; height: auto; }
.login-brand-title { font-size: clamp(1.75rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.2; color: #fff; margin-bottom: .75rem; }
.login-brand-sub { color: rgba(255, 255, 255, .8); font-size: 1rem; margin-bottom: 1.75rem; }
.login-brand-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.login-brand-list li { display: flex; align-items: center; gap: .75rem; font-weight: 600; font-size: .95rem; }
.login-brand-list i { width: 36px; height: 36px; border-radius: .6rem; background: rgba(255, 255, 255, .14); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #d6ec63; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: #f6f8fc; }
.login-panel .login-box { max-width: 420px; }
.login-panel .login-card { border-radius: 1rem; padding: 2rem; border-top: 4px solid #8fa80f; box-shadow: 0 14px 38px rgba(30, 32, 37, .12); }
.login-panel .login-card h5 { font-size: 1.25rem; font-weight: 800; color: #25305c !important; }
.login-panel .login-card .form-control { padding: .7rem .95rem; font-size: .875rem; border-radius: .6rem; }
.login-panel .login-card .btn-success { padding: .75rem 1rem; font-size: .9rem; font-weight: 700; border-radius: .6rem; }
@media (max-width: 860px) {
    .login-split { grid-template-columns: 1fr; }
    .login-brand { padding: 2rem 1.5rem; }
    .login-brand-list, .login-brand-sub { display: none; }
    .login-brand-logo { margin-bottom: 1.25rem; }
}

/* ============================================ login v4 (logo above card) */
.login-page {
    background:
        radial-gradient(520px 520px at 12% 8%, rgba(143, 168, 15, .16), transparent 70%),
        radial-gradient(560px 560px at 90% 92%, rgba(64, 81, 137, .16), transparent 70%),
        #f6f8fc;
}
.login-wrap { align-items: center; padding: 2rem 1rem; }
.login-box { max-width: 420px; }
.login-logo { margin-bottom: 1.5rem; }
.login-logo img { max-width: 300px; }
.login-box .login-card { border-radius: 1.1rem; padding: 2rem 2rem 1.75rem; border-top: 4px solid #8fa80f; box-shadow: 0 18px 44px rgba(30, 32, 37, .14); background: #fff; }
.login-box .login-card h5 { font-size: 1.3rem; font-weight: 800; color: #25305c !important; }
.login-box .login-card .form-control { padding: .72rem .95rem; font-size: .875rem; border-radius: .6rem; }
.login-box .login-card .btn-success { padding: .78rem 1rem; font-size: .9rem; font-weight: 700; border-radius: .6rem; }
.login-box .login-note { margin-top: 1rem; }

/* ============================================ typography: Inter (self-hosted) */
:root {
    --vz-font-family-primary: Inter, "Noto Sans Telugu", "Nirmala UI", Gautami, "Segoe UI", Arial, sans-serif;
    --vz-body-font-family: Inter, "Noto Sans Telugu", "Nirmala UI", Gautami, "Segoe UI", Arial, sans-serif;
    --bs-body-font-family: Inter, "Noto Sans Telugu", "Nirmala UI", Gautami, "Segoe UI", Arial, sans-serif;
}
html { font-size: 16px; }
.exam-timer, #exam-timer, .palette-btn, .question-num, .review-num { font-variant-numeric: tabular-nums; }
body, input, button, select, textarea, .btn, .form-control, .card, .badge, h1, h2, h3, h4, h5, h6 {
    font-family: Inter, "Noto Sans Telugu", "Nirmala UI", Gautami, "Segoe UI", Arial, sans-serif;
}
body { font-size: .94rem; line-height: 1.55; letter-spacing: 0; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: 0; }
.fs-12 { font-size: .78rem !important; }
.fs-13 { font-size: .86rem !important; }
.fs-14 { font-size: .92rem !important; }
.question-content, .question-card .form-check-label, .review-item { font-size: 1.02rem; line-height: 1.65; }
.font-monospace, code, pre, .ace_editor { font-family: Consolas, "Courier New", monospace !important; }

/* syllabus list on guidelines */
.guide-syllabus { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.guide-syllabus li { display: flex; flex-wrap: wrap; gap: .35rem .6rem; padding: .6rem .85rem; background: #f6f8fc; border-left: 3px solid #8fa80f; border-radius: .5rem; font-size: 1rem; }
.guide-syllabus strong { color: #25305c; }
.guide-syllabus span { color: #4a5568; }

.review-time { margin-top: .3rem; font-size: .8rem; color: #878a99; white-space: nowrap; }
.review-time i { vertical-align: -1px; }

/* ============================================ answered = green */
.legend-answered,
.exam-play .legend-answered { background: #1fb36b !important; color: #fff; }
.palette-btn.btn-primary,
.exam-play .palette-btn.btn-primary {
    --vz-btn-bg: #1fb36b;
    --vz-btn-border-color: #1fb36b;
    --vz-btn-hover-bg: #179a5b;
    --vz-btn-hover-border-color: #179a5b;
    --vz-btn-active-bg: #179a5b;
    --vz-btn-active-border-color: #179a5b;
    background-color: #1fb36b !important;
    border-color: #1fb36b !important;
    color: #fff !important;
}

/* ===== Fullscreen exam: everything fits one screen, no page scroll ===== */
html:fullscreen, html:fullscreen body { height: 100vh; overflow: hidden; }
html:fullscreen body { min-height: 0 !important; }
html:fullscreen .student-topbar { flex: 0 0 auto; }
html:fullscreen .student-topbar .navbar-brand { padding-top: .25rem !important; padding-bottom: .25rem !important; }
html:fullscreen .topbar-logo { max-height: 32px; width: auto; }
html:fullscreen footer { display: none; }
html:fullscreen main { flex: 1 1 auto; min-height: 0; padding: .6rem 0 !important; overflow: hidden; }
html:fullscreen main > .container { height: 100%; max-width: 100%; padding: 0 1rem; }
html:fullscreen main .alert:not(.exam-play .alert) { display: none; }

html:fullscreen .exam-play { height: 100%; display: flex; flex-direction: column; min-height: 0; }
html:fullscreen .exam-play-header { flex: 0 0 auto; margin-bottom: .6rem !important; padding: .5rem .9rem; position: static; }
html:fullscreen .exam-play > .alert-info { display: none; }
html:fullscreen .exam-section-nav { flex: 0 0 auto; margin-bottom: .5rem !important; }
html:fullscreen .exam-play > .row { flex: 1 1 auto; min-height: 0; margin: 0; --bs-gutter-y: 0; }
html:fullscreen .exam-play > .row > [class*="col-"] { height: 100%; min-height: 0; display: flex; flex-direction: column; }
html:fullscreen .exam-play .question-stepper { flex: 0 0 auto; margin-bottom: .5rem !important; }
html:fullscreen .exam-play .question-section-header { margin: 0 0 .4rem !important; }
html:fullscreen .exam-play .question-section-instructions { margin-bottom: .4rem; }
html:fullscreen .exam-play .question-card.active { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0 !important; }
html:fullscreen .exam-play .question-card.active > .card-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1rem 1.2rem; scrollbar-width: thin; }
html:fullscreen .exam-play .question-image-wrap { max-height: 38vh; text-align: center; }
html:fullscreen .exam-play .question-image { max-height: 36vh; width: auto; max-width: 100%; object-fit: contain; }
html:fullscreen .exam-play .question-card .form-check { margin-bottom: .4rem; padding-top: .55rem; padding-bottom: .55rem; }
html:fullscreen .exam-play textarea.answer-input { max-height: 30vh; }
html:fullscreen .exam-submit-card { display: none; }
html:fullscreen .question-palette { position: static; height: 100%; display: flex; flex-direction: column; margin: 0; }
html:fullscreen .question-palette .card-body { flex: 1 1 auto; min-height: 0; max-height: none; }

/* ===== Selected answer = green ===== */
.exam-play .question-card .form-check:has(.form-check-input:checked) {
    border-color: var(--ep-lime); background: var(--ep-lime-soft); box-shadow: 0 0 0 3px rgba(143, 168, 15, .18);
}
.exam-play .question-card .form-check-input:checked { background-color: var(--ep-lime); border-color: var(--ep-lime); }
.exam-play .question-card .form-check-input:focus { border-color: var(--ep-lime); box-shadow: 0 0 0 .2rem rgba(143, 168, 15, .25); }
.exam-play .question-card .form-check-input:checked ~ .form-check-label { color: #4f5f06; font-weight: 600; }
.exam-play .question-card .form-check:hover { border-color: #b9cc4a; background: #f8fbe9; }
.image-option-grid .btn:hover { border-color: var(--ep-lime); background: var(--ep-lime-soft); }
.image-option-grid .btn-check:checked + .btn {
    background: var(--ep-lime); border-color: var(--ep-lime); color: #fff; box-shadow: 0 6px 14px rgba(143, 168, 15, .4);
}

/* ===== Whole option row is clickable ===== */
.exam-play .question-card .form-check .form-check-label::after { content: ""; position: absolute; inset: 0; border-radius: .7rem; cursor: pointer; }

/* ===== Stronger timer + submit ===== */
.exam-timer-wrap {
    background: linear-gradient(135deg, #313f6d, #405189); color: #fff;
    padding: .5rem 1.1rem; box-shadow: 0 4px 12px rgba(64, 81, 137, .4);
}
.exam-timer-wrap i { font-size: 1.3rem; color: #d8ea5a; }
#exam-timer { font-size: 1.45rem; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; min-width: 4.4rem; }
.exam-timer-wrap:has(.timer-danger) { background: linear-gradient(135deg, #c62828, #e53935); color: #fff; animation: ep-pulse 1s ease-in-out infinite; }
.exam-timer-wrap:has(.timer-danger) i { color: #fff; }
@keyframes ep-pulse { 50% { box-shadow: 0 0 0 6px rgba(229, 57, 53, .25); } }

#submit-btn {
    padding: .65rem 1.6rem; font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; border-radius: .65rem;
    background: linear-gradient(135deg, #7d9409, #a3bd18); border: 0; color: #fff;
    box-shadow: 0 6px 16px rgba(143, 168, 15, .5);
}
#submit-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(143, 168, 15, .6); filter: brightness(1.05); }

/* ===== Palette polish ===== */
.question-palette { border: 0; border-radius: 1rem; box-shadow: 0 8px 24px rgba(30, 32, 37, .10); }
.question-palette .card-header { background: linear-gradient(135deg, #313f6d, #405189); border: 0; padding: .9rem 1.1rem; }
.question-palette .card-title { color: #fff; font-size: .95rem; letter-spacing: .02em; }
.question-palette .card-title i { color: #d8ea5a !important; }
.question-palette .card-body { padding: 1rem; background: #fbfcfe; }
.palette-grid { grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.palette-grid .palette-btn {
    height: 40px; border-radius: .6rem; font-size: .85rem; font-weight: 700; padding: 0;
    background: #fff; border: 1.5px solid #dde2ec; color: #5b647a;
}
.palette-grid .palette-btn:hover { border-color: var(--ep-lime); background: var(--ep-lime-soft); color: #4f5f06; transform: translateY(-2px); }
.palette-grid .palette-btn.btn-primary {
    background: linear-gradient(135deg, #7d9409, #a3bd18); border-color: transparent; color: #fff;
    box-shadow: 0 3px 8px rgba(143, 168, 15, .4);
}
.palette-grid .palette-btn.btn-primary:hover { background: linear-gradient(135deg, #6f8508, #94ad12); color: #fff; }
.palette-grid .palette-btn.marked { background: linear-gradient(135deg, #f1963b, #f7b84b); border-color: transparent; color: #3a2a00; }
.palette-grid .palette-btn.current { outline: 2.5px solid var(--ep-navy); outline-offset: 2px; transform: scale(1.06); }
.palette-legend { gap: .45rem 1rem; margin-top: 1rem; padding-top: .85rem; font-size: .75rem; }
.exam-play .legend-answered { background: var(--ep-lime); }
.exam-play .legend-current { background: #fff; border: 2px solid var(--ep-navy); }

/* ===== Mobile exam view ===== */
@media (max-width: 767px) {
    main { padding-top: .6rem !important; padding-bottom: 5.5rem !important; }
    main > .container { padding-left: .6rem; padding-right: .6rem; }

    /* header: title row + tools row, sticky */
    .exam-play-header { position: sticky; top: 0; z-index: 1020; padding: .55rem .7rem; margin-bottom: .7rem !important; border-radius: .75rem; }
    .exam-play-title { font-size: .95rem; margin-bottom: 0 !important; }
    .exam-play-meta { font-size: .72rem; gap: .6rem; }
    .exam-play-header > .d-flex { gap: .5rem !important; }
    .exam-play-header > .d-flex > div:last-child { width: 100%; justify-content: space-between; flex-wrap: nowrap !important; gap: .4rem !important; }
    #save-status, #camera-status { display: none !important; }
    #fullscreen-toggle { display: none; }
    .exam-tool-btn { width: 34px; height: 34px; }
    .exam-timer-wrap { padding: .35rem .8rem; margin-left: auto; }
    #exam-timer { font-size: 1.2rem; min-width: 3.6rem; }
    #submit-btn { padding: .45rem .9rem; font-size: .9rem; }
    #submit-btn i { display: none; }

    .exam-section-nav { margin-bottom: .6rem !important; }
    .exam-section-nav .nav-link { padding: .35rem .85rem; font-size: .8rem; }

    /* question card */
    .exam-play .question-card .card-body { padding: .9rem; }
    .exam-play .question-card .card-body > .d-flex { gap: .6rem !important; }
    .question-num { width: 32px; height: 32px; font-size: .85rem; flex-shrink: 0; }
    .exam-play .question-card .form-check { padding: .7rem .8rem .7rem 2.6rem; }
    .exam-play .question-card .form-check .form-check-input { left: .8rem; }
    .question-content, .question-card .form-check-label { font-size: 1rem; }
    .exam-play .question-image-wrap { max-height: none; overflow: auto; }
    .exam-play .question-image { max-width: 100%; height: auto; }
    .image-option-grid { grid-template-columns: repeat(4, 1fr); gap: .5rem; }
    .image-option-grid .btn { height: 48px; }

    /* stepper becomes a fixed bottom bar */
    .question-stepper {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; margin: 0 !important;
        padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom)); background: #fff;
        border-top: 1px solid var(--ep-line); box-shadow: 0 -6px 18px rgba(30, 32, 37, .1);
    }
    .question-stepper .btn { padding: .55rem .9rem; font-size: .9rem; }
    .question-position { font-size: .75rem; padding: .3rem .7rem; }
    #submit-btn-bottom { width: 100%; }

    .palette-grid { grid-template-columns: repeat(6, 1fr); }
    #question-palette-offcanvas { width: 88vw; }
}
@media (max-width: 380px) {
    .question-stepper .btn { padding: .5rem .65rem; }
    .palette-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ===== Marks badges + review/clear buttons ===== */
.exam-play .question-card .badge.mark-pos,
.exam-play .question-card .badge.mark-neg {
    display: inline-flex; align-items: center; gap: .1rem; padding: .4rem .75rem; font-size: .8rem; font-weight: 700;
    border: 1px solid transparent;
}
.exam-play .question-card .badge.mark-pos { background: #e6f4d0 !important; color: #4f6a05 !important; border-color: #cfe5a3; }
.exam-play .question-card .badge.mark-neg { background: #fde8e8 !important; color: #c62828 !important; border-color: #f6c5c5; }
.exam-play .question-card .badge i { font-size: .85rem; }

.exam-play .question-card-actions { display: inline-flex; gap: .4rem; padding: 0; background: transparent; }
.exam-play .question-card-actions .btn {
    display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem;
    border-radius: 2rem; font-size: .8rem; font-weight: 600; background: #fff;
    border: 1.5px solid #e3e7ee; transition: all .15s;
}
.exam-play .question-card-actions .btn i { font-size: 1rem; }
.exam-play .question-card-actions .mark-review-btn { color: #b87408; border-color: #f7d9a2; background: #fffaf0; }
.exam-play .question-card-actions .mark-review-btn:hover { background: #f7b84b; border-color: #f7b84b; color: #3a2a00; }
.exam-play .question-card-actions .mark-review-btn.active { background: #f7b84b; border-color: #f7b84b; color: #3a2a00; box-shadow: 0 3px 8px rgba(247, 184, 75, .45); }
.exam-play .question-card-actions .clear-response-btn { color: #6c757d; }
.exam-play .question-card-actions .clear-response-btn:hover { background: #fdecea; border-color: #f5c6c2; color: #d6393f; }
@media (max-width: 575px) { .exam-play .question-card-actions .qa-label { display: none; } .exam-play .question-card-actions .btn { padding: .4rem .6rem; } }

/* ===== Instructions + section tabs ===== */
.exam-play .exam-instructions {
    display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 1.1rem; margin-bottom: 1rem;
    background: linear-gradient(135deg, #f4f7ff, #eaf5fc); border: 1px solid #d3e3f5; border-left: 4px solid #3577f1;
    border-radius: .85rem; color: #2b4a6b; box-shadow: 0 3px 10px rgba(53, 119, 241, .08);
}
.exam-instructions-icon {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: #3577f1; color: #fff; font-size: 1.15rem; box-shadow: 0 3px 8px rgba(53, 119, 241, .35);
}
.exam-instructions .alert-heading { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #1f4f8f; }
.exam-instructions-body { font-size: .875rem; line-height: 1.55; color: #3c5873; }

.exam-play .exam-section-nav {
    display: flex; gap: .3rem; padding: .35rem; margin-bottom: 1rem !important;
    background: #eef1f7; border: 0; border-radius: 3rem; box-shadow: inset 0 1px 3px rgba(30, 32, 37, .08);
    scrollbar-width: none;
}
.exam-section-nav::-webkit-scrollbar { display: none; }
.exam-play .exam-section-nav .nav-link {
    padding: .5rem 1.3rem; font-size: .85rem; font-weight: 600; color: #5b647a; background: transparent; border: 0; border-radius: 3rem;
}
.exam-play .exam-section-nav .nav-link:hover { background: rgba(255, 255, 255, .7); color: var(--ep-navy); }
.exam-play .exam-section-nav .nav-link.active {
    background: linear-gradient(135deg, #313f6d, #405189); color: #fff; box-shadow: 0 4px 10px rgba(64, 81, 137, .4);
}
@media (max-width: 767px) {
    .exam-play .exam-instructions { padding: .7rem .8rem; gap: .6rem; }
    .exam-instructions-icon { width: 30px; height: 30px; font-size: 1rem; }
    .exam-play .exam-section-nav .nav-link { padding: .4rem .9rem; font-size: .8rem; }
}

/* ============================================ login v5: Velzon-standard controls */
.login-box .login-card .form-control,
.login-panel .login-card .form-control { padding: .5rem .9rem; font-size: .8125rem; border-radius: .25rem; }
.login-box .login-card .btn-success,
.login-panel .login-card .btn-success {
    padding: .5rem 1rem;
    font-size: .8125rem;
    font-weight: 500;
    border-radius: .25rem;
    box-shadow: none;
}
.login-card .btn-success:hover { transform: none; box-shadow: none; }
.login-box .login-card { padding: 1.75rem; border-radius: .6rem; }
.login-box .login-card h5 { font-size: 1.15rem; }

/* ============================================ exam screen: tighter vertical rhythm */
.exam-play .question-section-header { margin-top: .15rem !important; margin-bottom: .45rem !important; }
.exam-play .question-section-header h5 { font-size: 1.05rem; }
.exam-play .exam-play-header { margin-bottom: .75rem !important; }
.exam-play .exam-section-nav { margin-bottom: .6rem !important; }
.exam-play .question-stepper { margin-bottom: .6rem !important; }
.exam-play .question-card .card-body { padding: 1.05rem 1.25rem; }
.exam-play .question-card .form-check { margin-bottom: .2rem; padding-top: .4rem; padding-bottom: .4rem; }

/* ============================================ exam screen: buttons + palette fixes */
/* review / clear buttons: the old fixed 32px square clipped their labels */
.exam-play .question-card-actions .btn {
    width: auto !important;
    height: auto !important;
    min-width: 0;
    white-space: nowrap;
    padding: .38rem .9rem;
    line-height: 1.2;
}
.exam-play .question-card .d-flex.align-items-center.gap-2.text-nowrap { flex-wrap: wrap; row-gap: .4rem; }

/* previous / next */
.exam-play .question-stepper .btn {
    min-width: 120px;
    padding: .5rem 1.1rem;
    font-weight: 600;
    border-radius: .6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}
.exam-play .question-stepper .btn-outline-secondary { background: #fff; border-color: #d6dce8; color: #405189; }
.exam-play .question-stepper .btn-outline-secondary:hover:not(:disabled) { background: #eef2fb; }
.exam-play .question-stepper .btn-outline-primary { background: #405189; border-color: #405189; color: #fff; }
.exam-play .question-stepper .btn-outline-primary:hover:not(:disabled) { background: #313f6d; border-color: #313f6d; }

/* question palette */
.question-palette .card-header .card-title,
.question-palette .card-header h6 { color: #fff !important; }
.palette-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .55rem; }
.palette-grid .palette-btn {
    height: 42px;
    border-radius: .65rem;
    font-size: .9rem;
    font-weight: 700;
    background: #fff;
    border: 1.5px solid #d6dce8;
    color: #4a5468;
    box-shadow: none;
}
.palette-grid .palette-btn:hover { border-color: #405189; background: #eef2fb; color: #25305c; transform: translateY(-1px); }
.palette-grid .palette-btn.btn-primary,
.exam-play .palette-grid .palette-btn.btn-primary { background: #1fb36b !important; border-color: #1fb36b !important; color: #fff !important; box-shadow: 0 3px 8px rgba(31, 179, 107, .35); }
.palette-grid .palette-btn.marked { background: #f7b84b !important; border-color: #f7b84b !important; color: #3a2a00 !important; }
.palette-grid .palette-btn.current { outline: 2.5px solid #405189; outline-offset: 2px; transform: none; }
.palette-legend { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; font-size: .78rem; color: #5b647a; }
.palette-legend span { display: inline-flex; align-items: center; gap: .45rem; }
.legend-swatch { flex: 0 0 auto; width: 18px; height: 18px; border-radius: .35rem; display: inline-block; }
.exam-play .legend-answered, .legend-answered { background: #1fb36b !important; }
.exam-play .legend-marked, .legend-marked { background: #f7b84b !important; }
.exam-play .legend-not-answered, .legend-not-answered { background: #fff !important; border: 1.5px solid #c3cbdb; }
.exam-play .legend-current, .legend-current { background: #fff !important; border: 2px solid #405189; }
.palette-grid .palette-btn { height: 38px; }

/* ============================================ calculator v2 */
.calculator-panel {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
    width: 272px;
    padding: 0;
    background: #fff !important;
    border: 1px solid #d6dce8;
    border-radius: .9rem;
    box-shadow: 0 18px 44px rgba(20, 28, 48, .28);
    overflow: hidden;
    touch-action: none;
}
.calculator-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .75rem .55rem .9rem;
    background: linear-gradient(135deg, #313f6d, #405189);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    cursor: move;
    user-select: none;
}
.calculator-head i { color: #d8ea5a; margin-right: .35rem; }
.calculator-close {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.calculator-close:hover { background: rgba(255, 255, 255, .3); }
.calculator-body { padding: .75rem; background: #fff; }
.calculator-display {
    background: #eef2fb;
    color: #25305c;
    border-radius: .6rem;
    padding: .65rem .85rem;
    text-align: right;
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: .65rem;
    overflow-x: auto;
    white-space: nowrap;
    min-height: 3.1rem;
}
.calculator-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.calculator-key {
    height: 46px;
    border: 1px solid #e0e5ef;
    border-radius: .6rem;
    background: #f6f8fc;
    color: #1f2a44;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: background .12s, transform .08s;
}
.calculator-key:hover { background: #e9eef9; }
.calculator-key:active { transform: scale(.96); }
.calculator-key-wide { grid-column: span 2; }
.calculator-key-fn { background: #eceff5; color: #5b647a; }
.calculator-key-op { background: #e5ebfa; color: #405189; font-size: 1.2rem; }
.calculator-key-eq { background: #1fb36b; border-color: #1fb36b; color: #fff; font-size: 1.25rem; }
.calculator-key-eq:hover { background: #179a5b; }
#calculator-toggle.active { background: #405189; color: #fff; border-color: #405189; }
@media (max-width: 767px) { .calculator-panel { right: .6rem; left: auto; bottom: 5.2rem; width: 250px; } .calculator-key { height: 42px; } }

/* ============================================ palette v3: always fully visible */
.question-palette {
    position: sticky;
    top: 144px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 262px);
    min-height: 380px;
    max-height: 820px;
    overflow: hidden;
}
.question-palette .card-header { flex: 0 0 auto; }
.question-palette .palette-stats { flex: 0 0 auto; }
.question-palette .palette-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto;
    scrollbar-width: thin;
}
.question-palette .palette-foot { flex: 0 0 auto; padding: .7rem 1rem .8rem; background: #fff; border-top: 1px solid #e6eaf2; }
.question-palette .palette-foot .palette-legend { margin: 0; padding: 0; border: 0; }

.palette-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; padding: .7rem .8rem; background: #f3f6fb; border-bottom: 1px solid #e6eaf2; }
.palette-stat { text-align: center; font-size: .68rem; line-height: 1.25; color: #5b647a; padding: .35rem .2rem; border-radius: .5rem; background: #fff; border: 1px solid #e3e8f1; }
.palette-stat b { display: block; font-size: 1.05rem; color: #25305c; }
.palette-stat-answered b { color: #1fb36b; }
.palette-stat-marked b { color: #d68a14; }

.palette-group + .palette-group { margin-top: 1rem; }
.palette-group-title { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; font-size: .78rem; font-weight: 700; color: #25305c; text-transform: uppercase; letter-spacing: .03em; }
.palette-group-title small { font-weight: 600; color: #6b7387; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.palette-bare .palette-stats { border-radius: .6rem; margin-bottom: 1rem; border: 1px solid #e6eaf2; }
.palette-bare .palette-legend { margin-top: 1rem; }
html:fullscreen .question-palette { height: calc(100vh - 262px); }

/* ============================================ result analysis tabs */
.result-tabs { border-bottom: 2px solid #e6eaf2; gap: .25rem; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.result-tabs::-webkit-scrollbar { display: none; }
.result-tabs .nav-link { border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; color: #5b647a; font-weight: 600; font-size: .9rem; padding: .7rem 1.05rem; white-space: nowrap; background: transparent; }
.result-tabs .nav-link i { margin-right: .35rem; font-size: 1.05rem; vertical-align: -2px; }
.result-tabs .nav-link:hover { color: #405189; }
.result-tabs .nav-link.active { color: #405189; border-bottom-color: #8fa80f; background: transparent; }

.takeaways { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.takeaways li { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; }
.takeaways i { color: #1fb36b; font-size: 1.1rem; margin-top: .1rem; }

.kpi { display: flex; align-items: center; gap: .8rem; height: 100%; padding: .9rem 1rem; border-radius: .85rem; background: #fff; border: 1px solid #e6eaf2; box-shadow: 0 2px 8px rgba(30, 32, 37, .04); }
.kpi > i { flex: 0 0 auto; width: 44px; height: 44px; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #405189; background: #eaeefb; }
.kpi span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7387; font-weight: 600; }
.kpi b { display: block; font-size: 1.45rem; line-height: 1.15; color: #25305c; }
.kpi small { color: #6b7387; font-size: .76rem; }
.kpi-up > i { color: #1fb36b; background: #e3f6ec; } .kpi-up b { color: #148a52; }
.kpi-down > i { color: #e5484d; background: #fdecea; } .kpi-down b { color: #c62f35; }
.kpi-skip > i { color: #7b8499; background: #eef0f5; }
.kpi-rank > i { color: #8fa80f; background: #f0f6d3; }
.kpi-top > i { color: #d68a14; background: #fdf0d6; }
.kpi-pct > i { color: #405189; background: #eaeefb; }

.subj-card { border: 1px solid #e6eaf2; border-top: 4px solid #405189; border-radius: .85rem; }
.subj-card.subj-success { border-top-color: #1fb36b; } .subj-card.subj-warning { border-top-color: #f7b84b; } .subj-card.subj-danger { border-top-color: #e5484d; }
.subj-name { font-weight: 700; color: #25305c; }
.subj-rank { background: #eaeefb; color: #405189; font-weight: 600; }
.subj-score { font-size: 1.8rem; font-weight: 800; color: #25305c; line-height: 1.1; margin-bottom: .5rem; }
.subj-score small { font-size: .95rem; font-weight: 600; color: #7b8499; }
.subj-progress { height: 8px; background: #eef0f5; border-radius: 99px; }
.subj-success .progress-bar { background: #1fb36b; } .subj-warning .progress-bar { background: #f7b84b; } .subj-danger .progress-bar { background: #e5484d; }
.subj-stats { display: flex; gap: 1rem; font-size: .85rem; color: #5b647a; margin-bottom: .6rem; }
.subj-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .75rem; font-size: .82rem; color: #5b647a; }
.subj-meta i { margin-right: .25rem; color: #8a93a8; }

.board-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7387; background: #f6f8fc; border: 0; }
.board-table td { border-color: #eef0f5; }
.board-table .progress-bar { background: #405189; }
.board-me { background: #eefaf3; }
.board-me .progress-bar { background: #1fb36b !important; }
.rank-chip { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 700; font-size: .85rem; background: #eef0f5; color: #4a5468; }
.rank-chip.rank-1 { background: #f7c948; color: #5a3f00; } .rank-chip.rank-2 { background: #cfd5df; color: #3b4352; } .rank-chip.rank-3 { background: #e0a272; color: #4a2a0f; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: .2rem; }

.q-chip { display: inline-flex; align-items: baseline; gap: .35rem; margin: 0 .4rem .4rem 0; padding: .3rem .7rem; border-radius: 99px; background: #f3f6fb; border: 1px solid #e3e8f1; font-weight: 700; font-size: .85rem; color: #25305c; }
.q-chip small { font-weight: 500; color: #6b7387; font-size: .72rem; }
.q-table-wrap { max-height: 560px; overflow-y: auto; }
.q-table thead th { position: sticky; top: 0; z-index: 1; background: #f6f8fc; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7387; border: 0; }
.q-res-correct { background: #e3f6ec; color: #148a52; } .q-res-wrong { background: #fdecea; color: #c62f35; } .q-res-skipped { background: #eef0f5; color: #5b647a; }
.q-lvl-easy { background: #e3f6ec; color: #148a52; } .q-lvl-medium { background: #fdf0d6; color: #a86b0c; } .q-lvl-hard { background: #fdecea; color: #c62f35; }
.q-table .progress-bar { background: #405189; }
.q-filter .btn.active { background: #405189; border-color: #405189; color: #fff; }
@media (max-width: 575px) { .result-tabs .nav-link { padding: .6rem .8rem; font-size: .82rem; } .subj-meta { grid-template-columns: 1fr; } }

/* long equations must never widen the page on phones */
.review-item > .flex-grow-1 { min-width: 0; overflow-x: auto; overflow-wrap: anywhere; }
.review-item .katex-display { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
.question-card .flex-grow-1, .question-card .form-check-label { min-width: 0; overflow-wrap: anywhere; }

/* ============================================ chapters, strategy, practice */
.section-title { font-size: 1rem; font-weight: 800; color: #25305c; display: flex; align-items: center; gap: .5rem; }
.section-title i { color: #8fa80f; font-size: 1.2rem; }

.revise-card { border: 1px solid #f3c9c9; border-left: 4px solid #e5484d; border-radius: .85rem; }
.revise-list { padding-left: 1.2rem; display: grid; gap: .9rem; }
.revise-list li::marker { font-weight: 800; color: #e5484d; }

.heat-subject { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #6b7387; margin: .2rem 0 .5rem; }
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1.1rem; }
.heat-tile { border-radius: .75rem; padding: .7rem .8rem; border: 1px solid transparent; }
.heat-name { font-size: .8rem; font-weight: 700; line-height: 1.25; min-height: 2.1em; }
.heat-pct { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.heat-pct small { font-size: .8rem; font-weight: 700; }
.heat-sub { font-size: .7rem; opacity: .85; }
.heat-good { background: #d9f3e6; color: #0d6b3f; border-color: #b5e4cb; }
.heat-ok { background: #ecf5cf; color: #4f6a05; border-color: #d6e5a0; }
.heat-weak { background: #fdf0d6; color: #8a5a06; border-color: #f2d9a0; }
.heat-bad { background: #fde3e1; color: #a7262c; border-color: #f4b8b5; }
.heat-legend { font-size: .72rem; color: #6b7387; display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: .4rem; }
.heat-legend i.heat-good { background: #7fd1a5; } .heat-legend i.heat-ok { background: #c3dc7a; } .heat-legend i.heat-weak { background: #f5c867; } .heat-legend i.heat-bad { background: #ef8d88; }

.action-card { display: flex; gap: .8rem; height: 100%; padding: 1rem; border-radius: .85rem; background: #fff; border: 1px solid #e6eaf2; border-left: 4px solid #405189; box-shadow: 0 2px 8px rgba(30, 32, 37, .04); }
.action-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: .65rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; background: #eaeefb; color: #405189; }
.action-impact { white-space: nowrap; font-size: .75rem; font-weight: 800; color: #148a52; background: #e3f6ec; border-radius: 99px; padding: .15rem .55rem; align-self: flex-start; }
.action-danger { border-left-color: #e5484d; } .action-danger .action-ic { background: #fdecea; color: #e5484d; }
.action-warning { border-left-color: #f7b84b; } .action-warning .action-ic { background: #fdf0d6; color: #d68a14; }
.action-info { border-left-color: #299cdb; } .action-info .action-ic { background: #e1f1fb; color: #299cdb; }
.action-success { border-left-color: #1fb36b; } .action-success .action-ic { background: #e3f6ec; color: #1fb36b; }

.habit-list { display: grid; gap: .2rem; }
.habit { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid #eef0f5; }
.habit:last-child { border-bottom: 0; }
.habit > i { font-size: 1.3rem; }
.habit div { flex: 1; min-width: 0; }
.habit b { display: block; font-size: .88rem; color: #25305c; }
.habit span { font-size: .78rem; color: #6b7387; overflow-wrap: anywhere; }
.habit em { font-style: normal; font-weight: 800; color: #25305c; }

.quad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.quad { border-radius: .85rem; padding: 1rem; text-align: center; }
.quad b { display: block; font-size: 1.9rem; line-height: 1.1; }
.quad span { display: block; font-weight: 700; font-size: .85rem; }
.quad small { font-size: .72rem; opacity: .85; }
.quad-good { background: #d9f3e6; color: #0d6b3f; } .quad-ok { background: #ecf5cf; color: #4f6a05; }
.quad-warn { background: #fdf0d6; color: #8a5a06; } .quad-bad { background: #fde3e1; color: #a7262c; }

.practice-hero { border: 0; border-radius: 1rem; background: linear-gradient(135deg, #f3f8e0, #eaf1fb); }
.practice-hero h5 { color: #25305c; font-weight: 800; }
.mistake-card { background: #fff; border: 1px solid #e6eaf2; border-radius: .85rem; padding: 1rem 1.1rem; margin-bottom: .8rem; }
.mistake-card.is-fixed { border-color: #b5e4cb; background: #f6fcf9; }
.mistake-no { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 28px; padding: 0 .55rem; border-radius: .5rem; background: #25305c; color: #fff; font-weight: 800; font-size: .8rem; }
.fixed-flag { color: #148a52; font-weight: 700; font-size: .85rem; }
.mistake-text { font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.mistake-options { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .3rem; }
.mistake-options li { padding: .35rem .7rem; border-radius: .5rem; background: #f6f8fc; font-size: .92rem; }
.mistake-options li.is-correct { background: #e3f6ec; color: #0d6b3f; }
.mistake-answers { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .6rem; font-size: .88rem; color: #5b647a; }
.solution-box { background: #fffaf0; border: 1px solid #f2d9a0; border-radius: .7rem; padding: .8rem 1rem; font-size: .93rem; line-height: 1.6; overflow-wrap: anywhere; }
.solution-tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #a86b0c; margin-bottom: .35rem; }
.practice-runner { border: 2px solid #b8c6ee; border-radius: 1rem; }
.pr-question { font-size: 1.05rem; line-height: 1.65; overflow-wrap: anywhere; }
.pr-options { display: grid; gap: .5rem; }
.pr-option { display: flex; align-items: flex-start; gap: .6rem; padding: .6rem .9rem; border: 1.5px solid #dde2ec; border-radius: .65rem; cursor: pointer; background: #fff; }
.pr-option:hover { background: #f3f6fb; }
.pr-option.is-right { background: #e3f6ec; border-color: #1fb36b; }
.pr-option.is-wrong { background: #fdecea; border-color: #e5484d; }
.pr-ok { color: #148a52; font-weight: 700; } .pr-bad { color: #c62f35; font-weight: 600; }
@media (max-width: 575px) { .quad-grid { grid-template-columns: 1fr 1fr; } .heat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================ glossy polish: result analysis */
:root {
    --gloss: linear-gradient(180deg, rgba(255, 255, 255, .42) 0%, rgba(255, 255, 255, .08) 46%, rgba(255, 255, 255, 0) 52%);
    --navy-grad: linear-gradient(135deg, #4a5ca3 0%, #405189 45%, #2c3a6b 100%);
    --lime-grad: linear-gradient(135deg, #b6cf2e 0%, #8fa80f 55%, #748a0a 100%);
    --green-grad: linear-gradient(135deg, #3ddc8e 0%, #1fb36b 55%, #12945a 100%);
    --red-grad: linear-gradient(135deg, #f4676c 0%, #e5484d 55%, #c7343a 100%);
    --amber-grad: linear-gradient(135deg, #ffd27a 0%, #f7b84b 55%, #e29a1d 100%);
    --card-shadow: 0 10px 28px rgba(37, 48, 92, .10), 0 2px 6px rgba(37, 48, 92, .06);
}

.result-tabs {
    border: 0;
    gap: .4rem;
    padding: .45rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, #ffffff, #eef1f8);
    box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(37, 48, 92, .10), 0 0 0 1px #e1e6f1;
}
.result-tabs .nav-link {
    position: relative;
    border: 0 !important;
    margin: 0;
    border-radius: .75rem;
    color: #55607a;
    font-weight: 700;
    padding: .62rem 1.1rem;
    transition: transform .15s ease, box-shadow .15s ease, color .15s ease, background .15s ease;
}
.result-tabs .nav-link:hover { background: rgba(64, 81, 137, .08); color: #2c3a6b; transform: translateY(-1px); }
.result-tabs .nav-link.active {
    color: #fff !important;
    background: var(--navy-grad) !important;
    box-shadow: 0 8px 18px rgba(64, 81, 137, .38), inset 0 1px 0 rgba(255, 255, 255, .35);
    overflow: hidden;
}
.result-tabs .nav-link.active::after { content: ""; position: absolute; inset: 0; background: var(--gloss); pointer-events: none; border-radius: inherit; }
.result-tabs .nav-link.active i { color: #d8ea5a; }

.result-tab-content .card { border: 0; border-radius: 1rem; box-shadow: var(--card-shadow); overflow: hidden; }
.result-tab-content .card-header { background: linear-gradient(180deg, #ffffff, #f2f5fb); border-bottom: 1px solid #e8ecf5; padding: .85rem 1.1rem; }
.result-tab-content .card-title { font-weight: 800; color: #25305c; }
.result-tab-content .card-title i { color: #8fa80f; }

.kpi {
    position: relative; overflow: hidden; border: 0;
    background: linear-gradient(180deg, #ffffff, #f4f6fb);
    box-shadow: var(--card-shadow), inset 0 1px 0 #fff;
    transition: transform .18s ease, box-shadow .18s ease;
}
.kpi::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 52%; background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0)); pointer-events: none; }
.kpi:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(37, 48, 92, .16); }
.kpi > i { position: relative; color: #fff !important; box-shadow: 0 6px 14px rgba(37, 48, 92, .25), inset 0 1px 0 rgba(255, 255, 255, .45); }
.kpi > i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--gloss); }
.kpi-pct > i { background: var(--navy-grad); } .kpi-up > i { background: var(--green-grad); } .kpi-down > i { background: var(--red-grad); }
.kpi-skip > i { background: linear-gradient(135deg, #9aa3b8, #6f7893); } .kpi-rank > i { background: var(--lime-grad); } .kpi-top > i { background: var(--amber-grad); }

.subj-card { border: 0 !important; box-shadow: var(--card-shadow); background: linear-gradient(180deg, #fff, #f6f8fc); position: relative; }
.subj-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--navy-grad); }
.subj-card.subj-success::before { background: var(--green-grad); } .subj-card.subj-warning::before { background: var(--amber-grad); } .subj-card.subj-danger::before { background: var(--red-grad); }
.subj-progress { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
.subj-progress .progress-bar { background-image: var(--gloss), var(--navy-grad) !important; border-radius: 99px; }
.subj-success .progress-bar { background-image: var(--gloss), var(--green-grad) !important; } .subj-warning .progress-bar { background-image: var(--gloss), var(--amber-grad) !important; } .subj-danger .progress-bar { background-image: var(--gloss), var(--red-grad) !important; }
.subj-rank { background: var(--navy-grad); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.action-card { border: 0; box-shadow: var(--card-shadow); background: linear-gradient(180deg, #fff, #f6f8fc); position: relative; overflow: hidden; transition: transform .18s ease; }
.action-card:hover { transform: translateY(-3px); }
.action-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--navy-grad); }
.action-danger::before { background: var(--red-grad); } .action-warning::before { background: var(--amber-grad); } .action-info::before { background: linear-gradient(135deg, #5bbcf0, #299cdb); } .action-success::before { background: var(--green-grad); }
.action-ic { color: #fff !important; position: relative; box-shadow: 0 6px 14px rgba(37, 48, 92, .22), inset 0 1px 0 rgba(255, 255, 255, .4); background: var(--navy-grad); }
.action-ic::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--gloss); }
.action-danger .action-ic { background: var(--red-grad); } .action-warning .action-ic { background: var(--amber-grad); } .action-info .action-ic { background: linear-gradient(135deg, #5bbcf0, #299cdb); } .action-success .action-ic { background: var(--green-grad); }
.action-impact { background: var(--green-grad); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.heat-tile { position: relative; overflow: hidden; box-shadow: 0 4px 12px rgba(37, 48, 92, .10); transition: transform .15s ease; }
.heat-tile:hover { transform: translateY(-2px) scale(1.02); }
.heat-tile::after { content: ""; position: absolute; inset: 0; background: var(--gloss); pointer-events: none; }
.heat-good { background: linear-gradient(135deg, #e3f8ee, #c4ecd8); } .heat-ok { background: linear-gradient(135deg, #f1f8d8, #dcec9f); }
.heat-weak { background: linear-gradient(135deg, #fff3dc, #fadf9f); } .heat-bad { background: linear-gradient(135deg, #fee9e7, #f8bdb9); }
.quad { position: relative; overflow: hidden; box-shadow: 0 6px 16px rgba(37, 48, 92, .10); }
.quad::after { content: ""; position: absolute; inset: 0; background: var(--gloss); pointer-events: none; }
.quad-good { background: linear-gradient(135deg, #e3f8ee, #bfe9d3); } .quad-ok { background: linear-gradient(135deg, #f1f8d8, #d9ea96); }
.quad-warn { background: linear-gradient(135deg, #fff3dc, #f8d994); } .quad-bad { background: linear-gradient(135deg, #fee9e7, #f6b4b0); }

.result-tab-content .btn, .result-btn, .practice-hero .btn, .practice-runner .btn, #practice-summary .btn {
    position: relative; overflow: hidden; border: 0; border-radius: .7rem; font-weight: 700;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.result-tab-content .btn::after, .result-btn::after, .practice-hero .btn::after, .practice-runner .btn::after, #practice-summary .btn::after {
    content: ""; position: absolute; inset: 0; background: var(--gloss); pointer-events: none;
}
.result-tab-content .btn:hover, .result-btn:hover, .practice-hero .btn:hover, .practice-runner .btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-success, .result-btn.btn-success, #practice-start, #pr-next { background: var(--green-grad) !important; color: #fff !important; box-shadow: 0 8px 18px rgba(31, 179, 107, .38), inset 0 1px 0 rgba(255, 255, 255, .4); }
.result-tab-content .btn-primary, #pr-check { background: var(--navy-grad) !important; color: #fff !important; box-shadow: 0 8px 18px rgba(64, 81, 137, .36), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-warning, #ps-retry { background: var(--amber-grad) !important; color: #4a3200 !important; box-shadow: 0 8px 18px rgba(247, 184, 75, .4), inset 0 1px 0 rgba(255, 255, 255, .5); }
.result-tab-content .btn-outline-primary, .result-tab-content .btn-outline-secondary, .result-tab-content .btn-light {
    background: linear-gradient(180deg, #ffffff, #eef1f8) !important; color: #2c3a6b !important; box-shadow: 0 4px 12px rgba(37, 48, 92, .12), inset 0 1px 0 #fff, 0 0 0 1px #dfe5f1;
}
.q-filter .btn.active { background: var(--navy-grad) !important; color: #fff !important; box-shadow: 0 6px 14px rgba(64, 81, 137, .35), inset 0 1px 0 rgba(255, 255, 255, .35); }
.q-filter { box-shadow: 0 0 0 1px #dfe5f1; border-radius: .75rem; overflow: hidden; }

.q-table thead th, .board-table th { background: linear-gradient(180deg, #f8f9fd, #eceff7) !important; }
.q-table tbody tr:hover, .board-table tbody tr:hover { background: #f4f7fd; }
.q-table .progress-bar, .board-table .progress-bar { background-image: var(--gloss), var(--navy-grad); border-radius: 99px; }
.board-me .progress-bar { background-image: var(--gloss), var(--green-grad) !important; }
.q-chip { background: linear-gradient(180deg, #fff, #eef1f8); box-shadow: 0 3px 8px rgba(37, 48, 92, .10), inset 0 1px 0 #fff; }
.q-res, .q-lvl { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55); font-weight: 700; }
.rank-chip { box-shadow: 0 3px 8px rgba(37, 48, 92, .18), inset 0 1px 0 rgba(255, 255, 255, .55); }
.rank-chip.rank-1 { background: linear-gradient(135deg, #ffe08a, #f2b72c); } .rank-chip.rank-2 { background: linear-gradient(135deg, #eef1f6, #bcc4d3); } .rank-chip.rank-3 { background: linear-gradient(135deg, #f0c09a, #cf8a52); }
.takeaways-card { border: 0; background: linear-gradient(135deg, #f7fbe6, #eef3fc); }
.practice-hero { box-shadow: var(--card-shadow); background: linear-gradient(135deg, #f4f9df, #e8effb) !important; position: relative; overflow: hidden; }
.practice-hero::before { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0)); pointer-events: none; }
.mistake-card { box-shadow: 0 4px 14px rgba(37, 48, 92, .07); border: 0; background: linear-gradient(180deg, #fff, #f8f9fd); }
.mistake-no { background: var(--navy-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.pr-option { box-shadow: 0 2px 6px rgba(37, 48, 92, .06); transition: transform .12s ease, background .12s ease; }
.pr-option:hover { transform: translateX(3px); }
#pr-bar { background-image: var(--gloss), var(--green-grad); border-radius: 99px; }
.section-title i { background: var(--lime-grad); color: #fff; width: 28px; height: 28px; border-radius: .55rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }

/* time is up: freeze the paper while the final sync + submit run */
.exam-locked .question-card, .exam-locked .question-stepper, .exam-locked .col-lg-3 { pointer-events: none; opacity: .6; }

/* result tabs: show every tab - wrap onto extra rows instead of hiding them off-screen */
.result-tabs { flex-wrap: wrap !important; overflow: visible !important; row-gap: .35rem; }
.result-tabs .nav-item { flex: 0 0 auto; }
.result-tabs .nav-link { padding: .55rem .9rem; font-size: .88rem; }
@media (max-width: 575px) {
    .result-tabs { gap: .3rem; padding: .35rem; }
    .result-tabs .nav-item { flex: 1 1 calc(50% - .3rem); }
    .result-tabs .nav-link { width: 100%; text-align: center; padding: .55rem .4rem; font-size: .8rem; }
}
