:root {
    --navy: #08294f;
    --orange: #f39a2e;
    --blue: #155da0;
    --bg: #f4f7fa;
    --green: #198754;
    --red: #b42318;
    --muted: #667085;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: #1d2939;
}

/* ==============================
   HEADER
   ============================== */

.top {
    min-height: 105px;
    height: auto;
    background: #ffffff;
    border-bottom: 4px solid var(--orange);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5%;
    box-shadow: 0 2px 10px #0001;
}

.brand {
    display: flex;
    align-items: center;
    gap: 22px;
}

/* MiS logo */
.brand img {
    width: 180px;
    height: 65px;
    object-fit: contain;
    object-position: left center;
    display: block;
}

/* Branding text */
.brand strong {
    color: var(--navy);
    font-size: 24px;
    line-height: 1.15;
    display: block;
}

.brand span {
    color: var(--orange);
    font-size: 14px;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

.top nav {
    display: flex;
    gap: 20px;
}

.top a {
    color: var(--navy);
    font-weight: bold;
    text-decoration: none;
}

/* ==============================
   MAIN PAGE
   ============================== */

.wrap {
    max-width: 1180px;
    margin: 32px auto;
    padding: 0 20px;
}

.hero {
    background: linear-gradient(135deg, var(--navy), #154f83);
    color: white;
    border-radius: 18px;
    padding: 36px;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 38px;
    margin: 0 0 8px;
}

.hero .orange {
    color: #ffad49;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.grid.two {
    grid-template-columns: repeat(2, 1fr);
}

.card {
    background: white;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 3px 16px #102a4312;
    border: 1px solid #e6ebf0;
}

.metric {
    font-size: 32px;
    font-weight: 800;
    color: var(--navy);
}

.muted {
    color: var(--muted);
}

.btn {
    display: inline-block;
    background: var(--orange);
    color: white !important;
    text-decoration: none;
    border: 0;
    border-radius: 8px;
    padding: 11px 17px;
    font-weight: bold;
    cursor: pointer;
}

.btn.secondary {
    background: var(--navy);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    margin: 6px 0 15px;
    font: inherit;
}

label {
    font-weight: bold;
    color: var(--navy);
}

.auth {
    max-width: 520px;
    margin: 55px auto;
}

.auth h1 {
    color: var(--navy);
}

.flash {
    padding: 14px;
    background: #e8f5e9;
    border-left: 5px solid var(--green);
    margin-bottom: 18px;
}

.module {
    border-left: 5px solid var(--orange);
}

.progress {
    height: 12px;
    background: #e8edf2;
    border-radius: 10px;
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    background: var(--orange);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background: var(--navy);
    color: white;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    background: #eef2f6;
    font-size: 12px;
    font-weight: bold;
}

.pass {
    color: var(--green);
}

.fail {
    color: var(--red);
}

.lesson {
    line-height: 1.7;
}

.lesson h2 {
    color: var(--navy);
    margin-top: 28px;
}

.question {
    margin: 22px 0;
    padding: 18px;
    background: #f8fafc;
    border-radius: 10px;
}

.question label {
    display: block;
    font-weight: normal;
    color: #1d2939;
}

.question input {
    margin-right: 8px;
}

footer {
    text-align: center;
    color: #667085;
    padding: 35px 20px;
    font-size: 12px;
}

/* ==============================
   MOBILE
   ============================== */

@media (max-width: 800px) {

    .grid,
    .grid.two {
        grid-template-columns: 1fr;
    }

    .top {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
        padding: 15px 20px;
    }

    .brand {
        gap: 14px;
    }

    .brand img {
        width: 145px;
        height: 55px;
    }

    .brand strong {
        font-size: 20px;
    }

    .brand span {
        font-size: 12px;
    }

    .top nav {
        flex-wrap: wrap;
    }

    .hero h1 {
        font-size: 30px;
    }
}

/* ==============================
   PRINT
   ============================== */

@media print {

    .top nav,
    .btn,
    footer {
        display: none;
    }

    .wrap {
        max-width: none;
        margin: 0;
    }

    .card {
        box-shadow: none;
    }
}
/* ==============================
   QUIZ / KNOWLEDGE CHECK FIX
   ============================== */

.question label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    margin: 4px 0;
    font-weight: normal;
    color: #1d2939;
    cursor: pointer;
    border-radius: 8px;
}

.question label:hover {
    background: #eef4fa;
}

.question input[type="radio"],
.question input[type="checkbox"] {
    width: auto !important;
    height: auto;
    margin: 0 !important;
    padding: 0;
    flex: 0 0 auto;
    cursor: pointer;
}

.question label:has(input[type="radio"]:checked),
.question label:has(input[type="checkbox"]:checked) {
    background: #eaf3fb;
    color: var(--navy);
    font-weight: bold;
}

.question input[type="radio"] {
    width: 18px !important;
    height: 18px;
    accent-color: var(--navy);
}

.question input[type="checkbox"] {
    width: 18px !important;
    height: 18px;
    accent-color: var(--navy);
}