body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 8px;
}

#login-container, .login-card {
    max-width: 450px;
    margin: 150px auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
}

#login-container h2, .login-card h2 {
    margin-top: -10px;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 25px;
}

#login-container input, .login-card input,
#login-container select, .login-card select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #dcdde1;
    border-radius: 6px;
    font-size: 18px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

#login-container input:focus, .login-card input:focus,
#login-container select:focus, .login-card select:focus {
    border-color: #3498db;
}

#login-container button, .login-card button {
    width: 100%;
    padding: 12px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#login-container button:hover, .login-card button:hover {
    background-color: #27ae60;
}

.question-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.question-title {
    font-size: 18px;
    font-weight: normal;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.5;
}

.question-prefix {
    font-weight: bold;
    color: #2980b9;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #dcdde1;
    border-radius: 6px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.answer-option:hover {
    background-color: #f1f2f6;
    border-color: #b2bec3;
}

.answer-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.option-badge {
    width: 34px;
    height: 34px;
    background-color: #dfe4ea;
    color: #2f3640;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 19px;
    margin-left: -5px; 
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.answer-text {
    flex-grow: 1;
    font-size: 18px;
    color: #333;
}

.status-icon {
    font-size: 18px;
    font-weight: bold;
    margin-left: 10px;
}

.answer-option input[type="radio"]:checked ~ .option-badge {
    background-color: #3498db;
    color: white;
}

.answers-ds {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.ds-content {
    flex-grow: 1;
    font-size: 18px;
    color: #34495e;
    padding: 0 !important;
    margin-left: 5px !important;  
}

.ds-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfdfd;
    border: 1px solid #e1e8ed;
    padding: 8px 10px !important; 
    border-radius: 6px;
    margin-bottom: 8px;
}

.ds-controls {
    display: flex;
    flex-direction: row !important; 
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ds-label-sai {
    font-size: 18px;
    font-weight: 600;
    color: #e74c3c !important; 
}

.ds-label-dung {
    font-size: 18px;
    font-weight: 600;
    color: #2ecc71 !important; 
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e74c3c;
    transition: .3s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2ecc71;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.answers-short {
    margin-top: 10px;
}

.answers-short input[type="text"] {
    width: 25%;
    padding: 10px 15px;
    border: 1px solid #dcdde1;
    border-radius: 6px;
    font-size: 18px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.answers-short input[type="text"]:focus {
    border-color: #3498db;
}

.solution {
    margin-top: 15px;
    padding: 12px;
    background-color: #f8f9fa;
    border-left: 4px solid #f39c12;
    border-radius: 0 6px 6px 0;
    font-size: 18px;
    color: #2c3e50;
    line-height: 1.4;
}

.btn-group {
    margin-top: 25px;
    text-align: center;
}

button {
    padding: 10px 24px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

#btn-submit {
    background-color: #2ecc71;
    color: white;
}

#btn-submit:hover {
    background-color: #27ae60;
}

#btn-new {
    background-color: #3498db;
    color: white;
}

#btn-new:hover {
    background-color: #2980b9;
}

#result {
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

#login-error {
    color: red;
    font-size: 18px; 
    font-weight: normal;
    margin-bottom: 12px;
}

#quiz-wrapper {
    display: none; 
}

#quiz-wrapper > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#student-info-display {
    font-weight: 600;
    color: #2c3e50;
    font-size: 18px;
}

#btn-thoat {
    background-color: #e74c3c;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

#btn-thoat:hover {
    background-color: #c0392b;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
}

.status-icon {
    font-size: 18px !important;
    vertical-align: middle;
    margin-left: 8px;
}

@media screen and (min-width: 768px) {
    .phan-tieu-de h3,
    .question-title,
    .answer-text,
    .ds-content,
    .answers-short input[type="text"],
    .status-icon,       
    [class*="result"],   
    [class*="feedback"], 
    #login-container input, .login-card input,
    .ds-label-sai, .ds-label-dung,
    .solution,
    #student-info-display,
    #result,
    #login-error,
    #btn-thoat,
    .action-buttons .btn,
    #btn-start {
        font-size: 24px !important;
    }

    .option-badge {
        width: 44px !important;
        height: 44px !important;
        font-size: 24px !important;
    }

    #login-container, .login-card {
        max-width: 500px !important;
        margin: 120px auto !important;
    }
    
    #quiz-wrapper {
        max-width: 1300px !important; 
        margin: 20px auto !important;
        padding: 20px !important;
        background: #ffffff;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    }
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
    box-sizing: border-box;
    margin: 0;
    padding: 8px;
}

@media screen and (max-width: 767px) {
    body {
        padding: 8px 4px !important;  
    }

    #login-container, .login-card {
        margin: 150px auto !important;
    }

    #quiz-wrapper {
        width: 100% !important;
        max-width: calc(100vw - 8px) !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
        padding-left: 2px !important;  
        padding-right: 2px !important; 
    }
}

@media screen and (max-width: 767px) {
    .ds-row {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    .ds-controls {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
        flex-shrink: 0 !important;
        margin-left: auto !important; 
        margin-right: 5px !important;
    }
    .ds-label-sai, .ds-label-dung {
        display: none !important;
    }
    .ds-controls::before {
        content: "Sai";
        font-size: 18px !important;
        color: #e74c3c;
        font-weight: 700;
        line-height: 1.1;
    }
    .ds-controls::after {
        content: "Đúng";
        font-size: 18px !important;
        color: #2ecc71;
        font-weight: 700;
        line-height: 1.1;
    }
    .switch {
        width: 44px !important;
        height: 22px !important;
    }
    
    .slider:before {
        height: 16px !important;
        width: 16px !important;
        left: 3px !important;
        bottom: 3px !important;
        transform: none !important;
    }

    input:checked + .slider:before {
        transform: translateX(22px) !important;
    }
    .status-icon {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 18px !important;
        font-weight: bold !important;
        margin-left: 6px !important;
        margin-right: 2px !important;
        flex-shrink: 0 !important;
    }
}

input, select, button, textarea, .answer-option, .ds-row {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.my-dothi-img {
    width: 32% !important; 
    height: auto !important;
    -webkit-user-select: none;  
    -webkit-touch-callout: none; 
    pointer-events: none;   
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
    .my-dothi-img {
        width: 45% !important; /* iPad cho to hơn chút (70%) */
        height: auto !important;
    }
}

@media screen and (max-width: 767px) {
    .my-dothi-img {
        width: 83% !important; 
        height: auto !important;
    }
}

.my-bbt-img {
    width: 43% !important; 
    height: auto !important;
    -webkit-user-select: none;  
    -webkit-touch-callout: none; 
    pointer-events: none;   
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
    .my-bbt-img {
        width: 65% !important; 
        height: auto !important;
    }
}

@media screen and (max-width: 767px) {
    .my-bbt-img {
        width: 100% !important; 
        height: auto !important;
    }
}