* { 
    font-family: 'Poppins', sans-serif; 
}

body {
    margin: 0;
    height: 100vh;
    overflow: hidden; 
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--charcoal-black);
}

/* 1. BACKGROUND & OVERLAY */
.bg-layer {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: -1;
    background-image: url('../images/login_bg.webp'); 
    background-size: cover;
    background-position: center;
}

.bg-layer::after {
    content: '';
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 50, 20, 0.7), rgba(0, 0, 0, 0.9));
    backdrop-filter: blur(3px); 
}

/* 2. GLASS CARD LAYOUT */
.main-wrapper {
    width: 900px;
    max-width: 95%;
    height: 550px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-card {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(15px); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    display: flex;
    overflow: hidden;
}

/* 3. LEFT SIDE: BRANDING */
.brand-side {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 40px;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-animate {
    width: 100px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

.brand-side h1 { 
    font-size: 2rem; 
    margin: 0; 
}

.brand-side p { 
    opacity: 0.8; 
    font-weight: 300; 
    letter-spacing: 1px; 
}

/* 4. RIGHT SIDE: FORMS */
.form-side {
    flex: 1.2;
    background: rgba(255, 255, 255, 0.95); 
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.auth-box {
    width: 100%;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Role Selection Grid */
.role-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.role-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.role-card:hover {
    border-color: var(--student-green);
    background: #f1f8e9;
    transform: translateY(-3px);
}

.role-icon {
    width: 45px;          
    height: 45px;
    margin-bottom: 10px;  
    opacity: 0.85;        
    transition: 0.2s;     
}

.role-card:hover .role-icon {
    opacity: 1;
    filter: invert(34%) sepia(35%) saturate(795%) hue-rotate(76deg) brightness(98%) contrast(89%); 
}

/* Inputs with Floating Labels Look */
.input-group { 
    position: relative; 
    margin-bottom: 20px; 
}

.input-group input, 
.input-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--student-green);
    background: white;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.input-group label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: #999;
    font-size: 0.9rem;
    pointer-events: none;
    transition: 0.2s;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: 0;
    left: 10px;
    font-size: 0.75rem;
    background: white;
    padding: 0 5px;
    color: var(--student-green);
    font-weight: bold;
}

/* Password Toggle Icon */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%); 
    cursor: pointer;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    z-index: 10; 
    user-select: none;           
    -webkit-user-select: none;   
    -moz-user-select: none;      
    -ms-user-select: none;       
}

.password-toggle:hover {
    color: var(--student-green); 
}

.input-group input[type="password"],
.input-group input[type="text"] {
    padding-right: 45px; 
}

/* Buttons */
.primary-btn, 
.secondary-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.primary-btn {
    background: linear-gradient(135deg, var(--student-green), var(--login-dark-green));
    color: white;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.primary-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4); 
}

.secondary-btn {
    background: #333;
    color: white;
}

/* Utilities */
.role-tag {
    display: inline-block;
    background: #e8f5e9;
    color: var(--student-green);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.form-footer {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

.highlight-link { 
    color: var(--student-green); 
    text-decoration: none; 
    font-weight: bold; 
}

.back-link { 
    color: #666; 
    text-decoration: none; 
    font-size: 0.85rem; 
}

.back-link:hover { 
    text-decoration: underline; 
}

/* Scrollable Register Form */
.scrollable-box {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 5px; 
}

/* =========================================
   MOBILE RESPONSIVE FIX (GRADIENT BACKGROUND)
   ========================================= */
@media (max-width: 768px) {
    
    /* 1. ALLOW SCROLLING */
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        display: block;
    }

    /* 2. THE NEW GRADIENT BACKGROUND (No Image) */
    .bg-layer {
        position: fixed; /* Locks it to the screen */
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 100vh; /* Full height */
        z-index: -1;
        
        /* Remove the image and use a Premium Gradient instead */
        background-image: none; 
        background: linear-gradient(135deg, #1a1a1a 30%, #145a32 100%);
    }

    /* 3. ADJUST MAIN WRAPPER */
    .main-wrapper {
        width: 90%;
        max-width: 400px;
        height: auto;
        margin: 40px auto; 
        padding-bottom: 40px;
        display: block; 
    }

    /* 4. STACK THE GLASS CARD */
    .glass-card {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        border-radius: 20px;
        overflow: hidden;
        /* Make the card solid white so it pops against the gradient */
        background: white; 
        backdrop-filter: none; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }

    /* 5. FIX THE BRAND SIDE (TOP) */
    .brand-side {
        width: 100%;
        height: 160px; 
        flex: none;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #eee;
        
        /* Invert colors: Dark text on White background */
        background: white; 
        color: #333;
    }

    .brand-side h1 { 
        font-size: 1.4rem; 
        color: #1a1a1a; 
        margin-top: 5px; 
    } 

    .brand-side p { 
        color: #666; 
        font-size: 0.9rem; 
    }

    .logo-animate { 
        width: 50px; 
        margin-bottom: 5px; 
    } 

    /* 6. FIX THE FORM SIDE (BOTTOM) */
    .form-side {
        width: 100%;
        flex: 1;
        height: auto;
        padding: 20px;
        background: white; 
    }

    /* 7. UTILITIES */
    .role-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .role-card { 
        padding: 10px 5px; 
        border: 1px solid #ddd; 
    }

    .role-card span { 
        font-size: 0.75rem; 
    } 

    .role-icon { 
        width: 30px; 
        height: 30px; 
        margin-bottom: 5px; 
    }
}