#al-exam { max-width: 700px; margin: auto; }
.al-question { margin-bottom: 20px; }
#al_timer { font-weight: bold; margin-bottom: 15px; color: red; }
/* ==============================
   RESET NHẸ + BASE
============================== */
.al-exam-do-wrapper * {
    box-sizing: border-box;
}

.al-exam-do-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue",
                 Arial, sans-serif;
    line-height: 1.5;
    color: #222;
}

/* ==============================
   LAYOUT DESKTOP
============================== */
.al-exam-do-wrapper {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

/* ==============================
   CONTENT (BÀI THI)
============================== */
.al-exam-content {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
}

.al-exam-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
}

.al-exam-content p {
    margin: 8px 0;
}

.al-exam-content label {
    cursor: pointer;
    padding: 6px 0;
}

/* radio đẹp hơn */
.al-exam-content input[type="radio"] {
    margin-right: 6px;
}

/* ==============================
   SIDEBAR
============================== */
.al-exam-sidebar {
    position: sticky;
    top: 90px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
}

.al-exam-sidebar h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

/* input tên */
.al-exam-sidebar input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin-top: 5px;
}

/* timer */
#al-timer {
    display: inline-block;
    font-weight: bold;
    font-size: 20px;
    color: #d93025;
}

/* ==============================
   BUTTONS
============================== */
#al-submit-btn {
    width: 100%;
    padding: 12px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    cursor: pointer;
}

#al-submit-btn:hover {
    background: #005f8d;
}

#al-cancel-btn {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

#al-cancel-btn:hover {
    background: #eee;
}

/* ==============================
   POPUP KẾT QUẢ
============================== */
#al-result-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#al-result-popup > div {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    width: 320px;
    max-width: calc(100% - 40px);
    text-align: center;
}

#al-result-popup h3 {
    margin-top: 0;
}

#al-result-popup button {
    margin-top: 15px;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    background: #0073aa;
    color: #fff;
    cursor: pointer;
}

#al-result-popup button:hover {
    background: #005f8d;
}

/* ==============================
   RESPONSIVE MOBILE
============================== */
@media (max-width: 768px) {

    .al-exam-sidebar {
        position: relative;
        top: auto;
        order: -1; /* sidebar lên trên */
    }

    .al-exam-content {
        padding: 16px;
    }

    .al-exam-content h2 {
        font-size: 20px;
    }

    #al-timer {
        font-size: 18px;
    }
	.al-exam-wrapper, .al-exam-do-wrapper {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* ==============================
   RESPONSIVE SMALL MOBILE
============================== */
@media (max-width: 480px) {

    .al-exam-content h2 {
        font-size: 18px;
    }

    #al-submit-btn,
    #al-cancel-btn {
        font-size: 14px;
        padding: 10px;
    }

    #al-result-popup > div {
        padding: 20px;
    }

}
