:root {
    --navy: #101828;
    --indigo: #2746c7;
    --green: #15936b;
    --text: #182230;
    --muted: #667085;
    --line: #d9e2ef;
    --soft: #f5f7fb;
    --card: #ffffff;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(16, 24, 40, .08);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    background: var(--soft);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    text-decoration: none;
}

.navbar {
    min-height: 58px;
}

.navbar .container-fluid {
    min-width: 0;
    gap: 8px 12px;
}

.navbar-brand {
    min-width: 0;
    margin-right: 0;
    color: var(--navy);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar .small {
    min-width: 0;
    max-width: 48%;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-screen {
    min-height: calc(100vh - 37px);
    min-height: calc(100dvh - 37px);
    display: grid;
    place-items: center;
    padding: 14px 18px;
    background:
        radial-gradient(circle at 18% 12%, rgba(39, 70, 199, .14), transparent 28%),
        radial-gradient(circle at 86% 82%, rgba(21, 147, 107, .14), transparent 30%),
        linear-gradient(135deg, #f8fbff, #eef4f7);
}

.login-card {
    width: min(100%, 430px);
    padding: 24px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(217, 226, 239, .9);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.login-brand > div:last-child {
    min-width: 0;
}

.brand-mark {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--indigo), #1c7d69);
    border-radius: 14px;
    font-size: 22px;
}

.login-card h1,
.dashboard-head h1,
.start-card h1,
.finish-card h1 {
    margin: 0;
    color: var(--navy);
    font-weight: 800;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 750;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.login-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.login-title-row h1 {
    flex: 0 1 auto;
}

.login-level-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    color: #1d4f45;
    background: #eaf7f3;
    border: 1px solid #bfe3d8;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.login-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

.login-card .vstack {
    gap: 12px !important;
}

.login-card .form-label {
    margin-bottom: 5px;
}

.login-card .form-control-lg {
    min-height: 44px;
    padding: 8px 13px;
    font-size: 16px;
}

.password-field {
    position: relative;
    display: block;
}

.password-field .form-control {
    width: 100%;
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 4;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    line-height: 1;
    color: #667085;
    background: transparent;
    border: 0;
    border-radius: 50%;
    transform: translateY(-50%);
    transition: color .15s ease, background-color .15s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--indigo);
    background: #eef4ff;
    outline: none;
}

.password-toggle.is-visible {
    color: #fff;
    background: var(--indigo);
}

.login-card .btn-lg {
    padding: 9px 16px;
    font-size: 16px;
}

.form-label {
    color: #344054;
    font-weight: 700;
    font-size: 14px;
}

.form-control {
    border-color: var(--line);
    border-radius: 12px;
}

.form-control:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 .2rem rgba(39, 70, 199, .12);
}

.btn {
    border-radius: 12px;
    font-weight: 700;
}

.btn-primary {
    background: var(--indigo);
    border-color: var(--indigo);
}

.container {
    max-width: 1040px;
}

.dashboard-page {
    padding-top: 18px;
    padding-bottom: 24px;
}

.dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .06);
}

.dashboard-profile {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.dashboard-avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #2746c7, #15936b);
    border-radius: 12px;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0;
}

.dashboard-identity {
    min-width: 0;
}

.dashboard-identity p,
.dashboard-identity span {
    display: block;
    margin: 0;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-identity p {
    font-size: 12px;
    font-weight: 700;
}

.dashboard-identity span {
    margin-top: 3px;
    font-size: 13px;
    font-weight: 600;
}

.dashboard-head h1 {
    margin-top: 2px;
    font-size: clamp(22px, 4vw, 28px);
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.dashboard-logout {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-grid;
    place-items: center;
    color: #b42318;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 10px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.dashboard-logout:hover,
.dashboard-logout:focus-visible {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}

.dashboard-logout span {
    display: none;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.dashboard-stat {
    min-width: 0;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(16, 24, 40, .04);
}

.dashboard-stat i {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    margin-bottom: 8px;
    color: #344054;
    background: #eef2f7;
    border-radius: 8px;
    font-size: 13px;
}

.dashboard-stat-active i {
    color: #1d4ed8;
    background: #dbeafe;
}

.dashboard-stat-done i {
    color: #08704f;
    background: #dcfce7;
}

.dashboard-stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-stat strong {
    display: block;
    margin-top: 3px;
    color: var(--navy);
    font-size: 24px;
    line-height: 1;
}

.dashboard-section {
    margin-top: 20px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-title {
    margin: 0;
    color: var(--navy);
    font-size: 18px;
    font-weight: 800;
}

.history-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    color: #344054;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.history-link i {
    color: var(--indigo);
}

.empty-box,
.start-card,
.finish-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .04);
}

.empty-box {
    display: grid;
    gap: 4px;
    justify-items: center;
    padding: 28px 18px;
    color: var(--muted);
    text-align: center;
    border-radius: 12px;
}

.empty-box i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 6px;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 10px;
}

.empty-box strong {
    color: var(--navy);
}

.empty-box span {
    font-size: 13px;
}

.start-card {
    width: min(100%, 580px);
    margin: 0 auto;
}

.start-card h1 {
    font-size: clamp(22px, 4vw, 30px);
}

.lock-warning {
    margin: 18px 0;
    padding: 18px;
    color: #7f1d1d;
    background: #fee2e2;
    border: 2px solid #dc2626;
    border-radius: 12px;
    box-shadow: inset 7px 0 0 #b91c1c, 0 14px 30px rgba(185, 28, 28, .16);
}

.lock-warning-label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-bottom: 10px;
    padding: 4px 10px;
    color: #fff;
    background: #b91c1c;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.lock-warning h2 {
    margin: 0 0 8px;
    color: #7f1d1d;
    font-size: 24px;
    font-weight: 900;
}

.lock-warning p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

.lock-warning-count {
    margin-top: 14px;
    padding: 12px;
    color: #fff;
    background: #991b1b;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
}

.exam-list {
    display: grid;
    gap: 10px;
}

.exam-item {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 14px;
    color: inherit;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(16, 24, 40, .04);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.exam-item:not(.exam-item-static):hover {
    transform: translateY(-1px);
    border-color: #b8c8e6;
    box-shadow: 0 12px 28px rgba(16, 24, 40, .07);
}

.exam-main-info {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.exam-subject-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
}

.exam-copy {
    min-width: 0;
}

.exam-item strong {
    display: block;
    color: var(--navy);
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.exam-item span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.exam-copy span {
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exam-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.exam-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 8px;
    color: #475467;
    background: #f8fafc;
    border: 1px solid #e4eaf2;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
}

.exam-meta-row i {
    color: #64748b;
    font-size: 11px;
}

.exam-item-static {
    cursor: default;
}

.exam-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding-top: 10px;
    border-top: 1px solid #edf2f7;
    text-align: left;
}

.exam-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.exam-status-pill span {
    color: inherit;
    font-size: inherit;
}

.exam-status-text {
    min-width: 0;
    margin-right: auto;
}

.exam-status-text small {
    color: #475467;
    font-size: 11px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.exam-open-icon {
    flex: 0 0 auto;
    color: #2563eb;
    font-size: 12px;
}

.exam-item-success {
    border-color: #bbf7d0 !important;
    background: #f0fdf4 !important;
}

.exam-item-success .exam-status-pill {
    color: #08704f;
    background: #dcfce7;
}

.exam-item-danger {
    border-color: #fecaca !important;
    background: #fff7f7 !important;
}

.exam-item-danger .exam-status-pill {
    color: #b42318;
    background: #fee2e2;
}

.exam-item-primary .exam-status-pill {
    color: #1f3f8f;
    background: #dbeafe;
}

.exam-item-primary {
    border-color: #93c5fd !important;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 72%) !important;
}

.exam-item-muted {
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
}

.exam-item-muted .exam-status-pill {
    color: #475467;
    background: #e2e8f0;
}

.finish-card {
    max-width: 420px;
}

.finish-card i {
    margin-bottom: 14px;
    color: var(--green);
    font-size: 58px;
}

.app-footer {
    padding: 6px 12px 10px;
    color: #98a2b3;
    text-align: center;
    font-size: 11px;
    line-height: 1.4;
}

.app-footer strong {
    color: #667085;
    font-weight: 600;
}

.footer-divider {
    margin: 0 6px;
    color: #cbd5e1;
}

@media (max-width: 575px) {
    .navbar {
        min-height: 52px;
    }

    .navbar .container-fluid {
        flex-wrap: nowrap;
        padding-right: 12px;
        padding-left: 12px;
    }

    .navbar .small {
        max-width: 44%;
        font-size: 11px;
    }

    .login-screen {
        min-height: calc(100vh - 33px);
        min-height: calc(100dvh - 33px);
        padding: 10px 14px;
    }

    .login-card {
        padding: 18px;
    }

    .login-brand {
        align-items: flex-start;
        gap: 10px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 13px;
        font-size: 18px;
    }

    .login-card h1 {
        font-size: 23px;
        line-height: 1.12;
    }

    .login-title-row {
        gap: 6px 8px;
    }

    .login-level-badge {
        min-height: 24px;
        padding: 4px 9px;
        font-size: 12px;
    }

    .login-card p {
        font-size: 13px;
    }

    .dashboard-head {
        align-items: flex-start;
        padding: 14px;
    }

    .dashboard-avatar {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 10px;
        font-size: 15px;
    }

    .dashboard-head h1 {
        font-size: 22px;
    }

    .dashboard-identity p,
    .dashboard-identity span {
        max-width: min(100%, 235px);
    }

    .dashboard-stats {
        gap: 8px;
    }

    .dashboard-stat {
        padding: 10px;
        border-radius: 8px;
    }

    .dashboard-stat strong {
        font-size: 22px;
    }

    .history-link {
        padding-inline: 9px;
    }

    .history-link span {
        display: none;
    }

    .exam-item {
        border-radius: 10px;
    }

    .exam-status {
        align-items: flex-start;
    }
}
