/* Robust Role Switcher */
.auth-role-switcher-container {
    margin-bottom: 25px !important;
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
}

.auth-role-switcher {
    position: relative !important;
    display: inline-flex !important;
    background-color: #f1f3f5 !important; /* Light gray background */
    border-radius: 50px !important; /* Pill shape */
    padding: 5px !important;
    user-select: none !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05) !important;
    min-width: 280px !important; /* Ensure enough space */
}

.auth-role-switcher-wrapper {
    display: flex !important;
    width: 100% !important;
    position: relative !important;
    z-index: 2 !important;
}

.auth-role-slider {
    position: absolute !important;
    top: 5px !important;
    bottom: 5px !important;
    left: 5px !important;
    width: calc(50% - 5px) !important; /* Exact math for perfect fit */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 50px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1 !important;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3) !important;
}

.auth-role-option {
    flex: 1 !important;
    padding: 12px 0 !important;
    cursor: pointer !important;
    text-align: center !important;
    color: #777 !important;
    transition: color 0.3s ease !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 0 !important;
    z-index: 3 !important; /* Above the slider */
    background: transparent !important;
    border: none !important;
    outline: none !important;
}

.auth-role-option i {
    font-size: 16px !important;
    margin-top: -2px !important; /* Optical alignment */
}

.auth-role-option span {
    color: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: inherit !important;
}

/* --- Logic for Slider Movement --- */

/* Student Selected (Default) */
#authStudentRole:checked ~ .auth-role-switcher-wrapper .auth-role-slider {
    left: 5px !important;
}

/* Teacher Selected */
#authTeacherRole:checked ~ .auth-role-switcher-wrapper .auth-role-slider {
    left: 50% !important;
}

/* --- Logic for Text Color --- */

/* Default Hover */
.auth-role-option:hover {
    color: #555 !important;
}

/* Active Text Colors */
#authStudentRole:checked ~ .auth-role-switcher-wrapper #authStudentLabel {
    color: #ffffff !important;
}

#authTeacherRole:checked ~ .auth-role-switcher-wrapper #authTeacherLabel {
    color: #ffffff !important;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .auth-role-switcher {
        min-width: 100% !important;
    }
}
