/* New /css/login.css */

/* General Body and Page Container */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5; /* Light grey background */
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

#page-container {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Padding around the whole login module */
}

/* Loading Spinner */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: #d9e0e7;
    z-index: 9999;
    display: none;
}
.loading-spinner {
    height: 36px;
    width: 36px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -18px 0 0 -18px;
    border: 2px solid rgba(45,53,60,.85);
    border-top: 2px solid #fff;
    -webkit-border-radius: 36px;
    border-radius: 36px;
    -webkit-animation: rotation .6s infinite linear;
    -moz-animation: rotation .6s infinite linear;
    -ms-animation: rotation .6s infinite linear;
    -o-animation: rotation .6s infinite linear;
    animation: rotation .6s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Cover (Background) */
.login-cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Send it behind other content */
    overflow: hidden;
}

.login-cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.6); /* Slightly darken the background image */
    transform: scale(1.05); /* Slight zoom for better background fill */
    animation: zoomEffect 20s infinite alternate; /* Gentle zoom animation */
}

@keyframes zoomEffect {
    0% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.login-cover-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3)); /* Gradient overlay */
    z-index: 0;
}

/* Login Card/Module */
.login {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    width: 100%;
    max-width: 900px; /* Max width for the entire login module */
    overflow: hidden; /* Ensure rounded corners work */
    min-height: 500px; /* Minimum height for the login card */
    animation: fadeIn 0.8s ease-out; /* Fade in animation for the login module */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Left Section (Image/SVG/Marketing) */
.login-left-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #007bff; /* Primary color background */
    color: #fff;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Optional: Add a pattern or SVG background */
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="15" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="50" r="10" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="90" r="12" fill="rgba(255,255,255,0.1)"/></svg>');
    background-repeat: repeat;
    background-size: 80px;
    flex-direction: column;
}

.login-left-panel h2 {
    font-size: 2.2em;
    margin-bottom: 20px;
    line-height: 1.3;
}

.login-left-panel p {
    font-size: 1.1em;
    opacity: 0.8;
}

/* Right Section (Login Form) */
.login-form-panel {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 350px; /* Ensures login form has a reasonable width */
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .brand {
    display: block; /* Remove flex here, done by parent now */
    margin-bottom: 20px;
}

.login-header .brand img {
    max-width: 220px; /* Larger logo for login page */
    height: auto;
    display: block; /* Ensures centering */
    margin: 0 auto; /* Center the logo */
}

.login-content {
    /* Flexbox on the parent makes this fill space */
}

/* Form Group Styling */
.form-group.m-b-20 { /* Use margin-bottom utilities instead of custom classes if possible with Bootstrap 5 */
    margin-bottom: 20px;
}

.form-control-lg {
    height: calc(2.875rem + 2px); /* Bootstrap 4's form-control-lg height */
    padding: .5rem 1rem;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: .3rem;
}

.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* Focus shadow for inputs */
    border-color: #80bdff;
}

/* Password Eye Icon */
.showHidePw {
    position: absolute;
    right: 15px; /* Adjust based on padding of input */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
}

.showHidePw:hover {
    color: #343a40;
}

/* Checkbox */
.checkbox-css {
    margin-top: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.checkbox-css input[type="checkbox"] {
    margin-right: 8px;
    width: 18px; /* Custom size for checkbox */
    height: 18px;
    cursor: pointer;
}

.checkbox-css label {
    cursor: pointer;
    font-size: 1em;
    color: #555;
    margin-bottom: 0; /* Remove default label margin */
}

/* Login Buttons */
.login-buttons {
    margin-top: 25px;
}

.btn-lg {
    padding: .75rem 1.25rem;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: .3rem;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Footer Links and Copyright */
.m-t-5 {
    margin-top: 5px;
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
}

.m-t-5 a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.m-t-5 a:hover {
    text-decoration: underline;
}

.m-t-10 {
    margin-top: 10px;
    font-size: 0.85em;
    color: #6c757d;
    text-align: center; /* Center the copyright text */
}

/* Responsive Adjustments */
@media (max-width: 991.98px) { /* Medium devices and down */
    .login {
        flex-direction: column; /* Stack panels vertically */
        max-width: 500px; /* Smaller max width for stacked layout */
        min-height: auto; /* Allow height to adjust */
    }

    .login-left-panel {
        display: none; /* Hide left panel on smaller screens for simplicity */
        /* Alternatively, you could display it with reduced padding/font-size */
    }

    .login-form-panel {
        padding: 30px; /* Reduce padding on smaller screens */
        min-width: unset; /* Remove min-width constraint */
    }

    .login-header .brand img {
        max-width: 180px; /* Smaller logo on smaller screens */
    }
}

@media (max-width: 575.98px) { /* Small devices (phones) */
    #page-container {
        padding: 10px;
    }

    .login {
        border-radius: 5px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .login-form-panel {
        padding: 20px;
    }

    .form-control-lg {
        font-size: 1rem;
        height: calc(2.25rem + 2px);
    }

    .btn-lg {
        font-size: 1rem;
        padding: .5rem 1rem;
    }

    .showHidePw {
        right: 10px;
    }
}