/* Authentication Pages Styling (Login / Register) - Split Screen Design */

.login-container {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
    padding-top: 70px; /* Accounts for fixed header safely without exposing background */
    margin-top: 0;
    background: var(--light);
}

.dark-theme .login-container {
    background: #0f172a;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 0 40px 40px 0;
    overflow: hidden;
    padding: 0 10px;
    box-shadow: 4px 0 24px rgba(0, 102, 204, 0.15);
    z-index: 10;
}

.dark-theme .login-left {
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Support for Reverse Layout (Register facing Login) */
.login-container.reverse {
    flex-direction: row-reverse;
}

.login-container.reverse .login-left {
    border-radius: 40px 0 0 40px;
    box-shadow: -4px 0 24px rgba(0, 102, 204, 0.15);
}

.dark-theme .login-container.reverse .login-left {
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.login-watermark {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    max-width: 60vw;
    opacity: 0.04;
    z-index: 2;
    pointer-events: none;
}

.login-left::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('../images/logo/logo-white.svg') center/30% no-repeat;
    opacity: 0.03;
    z-index: 1;
}

.login-left .fa-microchip {
    position: absolute;
    font-size: 100px;
    color: #fff;
    opacity: 0.07;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
}

.login-left img.signup-watermark {
    max-width: 220px; 
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.08));
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    opacity: 0.13;
    z-index: 2;
    pointer-events: none;
}

/* Fallback for when the image is not full transparent watermark */
.login-left img.visual-logo {
    position: relative;
    max-width: 220px; 
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.08));
    display: block;
    margin: 0 auto 30px;
    z-index: 3;
}

.login-welcome {
    color: #fff;
    text-align: center;
    max-width: 320px;
    position: relative;
    z-index: 3;
    padding: 0 10px;
}

.login-welcome h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.login-welcome p {
    font-size: 1.1rem;
    font-weight: 400;
    color: #fff;
    opacity: 0.95;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    z-index: 5;
}

.dark-theme .login-box {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
    backdrop-filter: blur(20px);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
    color: var(--primary);
}

.dark-theme .login-title {
    color: var(--primary);
}

.form-label {
    font-weight: 500;
    color: var(--dark);
    font-size: 0.95rem;
}

.dark-theme .form-label {
    color: #f1f5f9;
}

.form-control {
    padding: 12px 15px;
    font-size: 1rem;
    border-radius: 6px;
}

.dark-theme .form-control {
    background-color: rgba(15, 23, 42, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.dark-theme .form-control::placeholder {
    color: #94a3b8 !important;
}

.dark-theme .form-control:focus {
    background-color: rgba(30, 41, 59, 1) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

/* Fix for browser autofill text color in dark mode */
.dark-theme input:-webkit-autofill,
.dark-theme input:-webkit-autofill:hover,
.dark-theme input:-webkit-autofill:focus,
.dark-theme input:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff !important;
    -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.login-btn {
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.3);
    color: #ffffff;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.95rem;
    color: var(--gray);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

.d-flex.justify-content-end a {
    color: var(--primary);
    text-decoration: none;
}

.d-flex.justify-content-end a:hover {
    text-decoration: underline;
}

/* Extra support padding for mobile-only logo fallback if added */
.mobile-only-logo {
    display: none;
}

/* Responsive constraints for Side Card Layout */
@media (max-width: 900px) {
    .login-container, .login-container.reverse {
        flex-direction: column;
    }
    
    .login-left {
        border-radius: 0;
        min-height: 250px;
        flex: unset;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .login-container.reverse .login-left {
        border-radius: 0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }
    
    .login-right {
        flex: unset;
        padding: 40px 20px;
        min-height: calc(100vh - 320px);
        align-items: flex-start;
    }
    
    .login-box {
        box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    }

    .mobile-only-logo {
        display: block;
        margin: 0 auto 20px;
        height: 45px;
    }
}