/* ============ LOGIN SCREEN STYLES ============ */
#login-screen {
    background: linear-gradient(135deg, #fef0f3 0%, #fff5f7 50%, #f8e8ec 100%);
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
}

#login-screen.active {
    display: flex;
}

.login-container {
    background: #ffffff;
    padding: 30px 40px;
    border-radius: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 420px;
    width: 100%;
    min-height: 620px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    animation: loginFadeIn 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    margin-bottom: 15px;
    flex-shrink: 0;
}

.login-brand-logo {
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.login-header .brand {
    color: var(--primary);
}

.login-header .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Role Selector Redesign - Based on User Screenshot */
.role-selector {
    display: flex;
    gap: 0;
    /* No gap for a continuous background */
    margin-bottom: 20px;
    justify-content: center;
    background: #f1f3f5;
    padding: 6px;
    border-radius: 18px;
    flex-shrink: 0;
}

.role-btn {
    flex: 1;
    padding: 8px 5px;
    border: none;
    background: transparent;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.role-btn .material-icons-round {
    font-size: 20px;
}

.role-btn span:not(.material-icons-round) {
    font-size: 10px;
    font-weight: 700;
    text-transform: none;
    /* Changed from uppercase to match image look more closely if needed, or keep for style */
    letter-spacing: 0.2px;
}

.role-btn:hover {
    color: var(--primary);
}

.role-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.role-btn.active .material-icons-round {
    color: var(--primary);
}

/* Mobile Adjustments for Role Selector */
@media (max-width: 480px) {
    /* Ô đăng nhập nhỏ lại, chừa viền hồng xung quanh (giống giao diện chào mừng) */
    .login-container {
        width: calc(100% - 44px);
        max-width: 380px;
        padding: 26px 22px;
        min-height: 0;
        border-radius: 28px;
    }

    .login-brand-logo {
        margin-bottom: 6px;
    }

    .login-brand-logo img {
        height: 120px !important;
        width: auto !important;
    }

    .login-header {
        margin-bottom: 10px;
    }

    .login-header h1 {
        font-size: 19px;
    }

    /* "Học Vật lý cùng" xuống dòng, "Thầy Phúc Võ" to hơn */
    .login-header h1 .brand {
        display: block;
        font-size: 25px;
        margin-top: 2px;
    }

    .login-form {
        min-height: 0;
    }

    .role-selector {
        padding: 4px;
        border-radius: 14px;
        margin-bottom: 15px;
    }

    .role-btn {
        padding: 6px 2px;
        border-radius: 10px;
        gap: 2px;
    }

    .role-btn .material-icons-round {
        font-size: 18px;
    }

    .role-btn span:not(.material-icons-round) {
        font-size: 9px;
        font-weight: 600;
    }
}

/* Form Styles refined */
.login-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 320px;
    /* Prevent collapsing when guest is selected */
}

.login-form .form-group {
    margin-bottom: 12px;
}

.login-form label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
    text-align: left;
    margin-left: 4px;
}

.login-form .input-wrapper input,
.login-form .input-wrapper select {
    background: #fdfdfd;
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    padding: 14px 14px 14px 48px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.login-form .input-wrapper .input-icon {
    left: 16px;
    color: #bdbdbd;
}

.login-form .input-wrapper input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(187, 38, 73, 0.08);
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 16px;
    margin-top: 10px;
    box-shadow: 0 10px 20px rgba(187, 38, 73, 0.2);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(187, 38, 73, 0.3);
}

.form-footer a {
    font-weight: 600;
    transition: color 0.2s;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Custom Checkbox Style */
#remember-me {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    display: inline-block;
    position: relative;
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.2s ease;
}

#remember-me:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

#remember-me:checked::after {
    content: '\e5ca';
    font-family: 'Material Icons Round';
    position: absolute;
    color: white;
    font-size: 16px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#remember-me:hover {
    border-color: var(--primary);
}