.login-container {
    display: flex;
    min-height: 100vh;
    position: absolute; /* Change from fixed to absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: auto; /* Change from 100vh to auto */
    z-index: 999;
    background: transparent;
    overflow-y: auto;
}

.login-left {
    flex: 1;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 45%;
    background-size: cover;
    background-position: center;
    color: white;
    z-index: 998; /* Add z-index lower than container */
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 54, 95, 0.9), rgba(0, 54, 95, 0.7));
}

.left-content {
    position: relative;
    z-index: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    text-align: left;
}

.left-content h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.left-content p {
    font-size: 18px;
    line-height: 1.6;
    opacity: 0.9;
}

.auth-back-link {
    position: absolute;
    top: 24px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #00365f;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    z-index: 2;
}

.auth-back-link i {
    font-size: 14px;
}

.auth-back-link:hover {
    color: #d1641a;
}

.login-right {
    flex: 1;
    margin-left: 45%;
    width: 55%;
    min-height: 100vh;
    display: block; /* Change from flex to block */
    padding: 40px 0;
    position: relative; /* Add position relative */
    z-index: 1000; /* Add z-index higher than left side */
    background: #fff;
    overflow-y: auto; /* Add scroll for overflow */
    max-height: 100vh; /* Ensure it doesn't exceed viewport height */
}

.form-wrapper {
    width: 75%; /* Increased from default */
    max-width: 650px; /* Added max-width for larger screens */
    padding: 40px;
    margin: 0 auto; /* Center the form wrapper */
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h2 {
    color: #00365f;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
}

.login-header .sub-title {
    color: #6c757d;
    font-size: 16px;
    margin-bottom: 40px;
}

.login-logo {
    max-width: 200px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: #00365f;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}

.custom-input-group {
    position: relative;
    border: 2px solid #eef1f5;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.custom-input-group:focus-within {
    border-color: #00365f;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 54, 95, 0.1);
}

.custom-input-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #00365f;
    font-size: 18px;
}

.form-input {
    width: 100%;
    padding: 16px 16px 16px 50px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #00365f;
}

.form-input:focus {
    outline: none;
}

.form-input::placeholder {
    color: #a0a8b3;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    color: #666;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #00365f;
    border-radius: 4px;
    margin-right: 8px;
    position: relative;
}

.custom-checkbox input:checked ~ .checkmark:after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #00365f;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    color: #00365f;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #d1641a;
}

.theme-btn.btn-style-one:hover {
    background: #002341;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 54, 95, 0.2);
}

.register-link {
    text-align: center;
    margin-top: 25px;
    color: #666;
}

.theme-color {
    color: #00365f;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.theme-color:hover {
    color: #d1641a;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #0056b3;
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }
    
    .login-left {
        display: none;
    }
}

/* Add smooth sliding animation */
.slide-enter {
    transform: translateX(100%);
}

.slide-enter-active {
    transform: translateX(0);
    transition: transform 500ms ease;
}

.slide-exit {
    transform: translateX(0);
}

.slide-exit-active {
    transform: translateX(-100%);
    transition: transform 500ms ease;
}

/* Adjust spacing for the two-column layout */
.row .form-group {
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .login-left {
        width: 40%;
    }
    
    .login-right {
        margin-left: 40%;
        width: 60%;
    }
    
    .form-wrapper {
        width: 85%;
    }
}

@media (max-width: 992px) {
    .login-left {
        width: 35%;
    }
    
    .login-right {
        margin-left: 35%;
        width: 65%;
    }
    
    .form-wrapper {
        width: 90%;
        padding: 30px;
    }
    
    .left-content {
        padding: 40px;
    }
    
    .left-content h1 {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }
    
    .login-left {
        position: relative;
        width: 100%;
        height: 250px;
        min-height: auto;
    }
    
    .login-right {
        margin-left: 0;
        width: 100%;
        min-height: auto;
    }
    
    .form-wrapper {
        width: 90%;
        max-width: 500px;
        padding: 30px 20px;
    }
    
    .left-content {
        padding: 30px;
        text-align: center;
    }
    
    .left-content h1 {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .left-content p {
        font-size: 16px;
    }
    
    .login-header h2 {
        font-size: 26px;
    }

    .auth-back-link {
        top: 16px;
        left: 16px;
    }
    
    /* Adjust row layout in forms */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .row .col-md-6 {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 576px) {
    .login-left {
        display: block; /* Override the display: none */
        height: 200px;
    }
    
    .form-wrapper {
        width: 95%;
        padding: 20px 15px;
    }
    
    .login-header {
        margin-bottom: 30px;
    }
    
    .login-logo {
        max-width: 150px;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .custom-input-group i {
        left: 15px;
    }
    
    .form-input {
        padding: 14px 14px 14px 40px;
        font-size: 14px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .left-content {
        padding: 20px;
    }
    
    .left-content h1 {
        font-size: 24px;
    }
    
    .left-content p {
        font-size: 14px;
    }
    
    /* Make form elements in register page full width on mobile */
    .row .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 400px) {
    .login-left {
        height: 180px;
    }
    
    .login-header h2 {
        font-size: 22px;
    }
    
    .login-header .sub-title {
        font-size: 14px;
        margin-bottom: 30px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .terms-checkbox label {
        font-size: 13px;
    }
}

/* Fix for terms checkbox alignment on mobile */
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.terms-checkbox input[type="checkbox"] {
    margin-top: 3px;
}

/* Fix form layout in Register page */
@media (max-width: 768px) {
    .row {
        display: flex;
        flex-wrap: wrap;
    }
    
    .row .col-md-6 {
        width: 100%;
    }
}

/* Custom Select Styles */
.custom-select-container {
    position: relative;
}

.custom-select {
    width: 100%;
    position: relative;
}

.selected-option {
    width: 100%;
    padding: 16px 16px 16px 50px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #00365f;
    font-size: 15px;
}

.selected-option:empty::before {
    content: 'Sélectionnez votre wilaya';
    color: #a0a8b3;
}

.dropdown-icon {
    margin-left: 10px;
    transition: transform 0.3s ease;
    font-size: 12px;
    color: #00365f;
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    border: 2px solid #eef1f5;
    border-top: none;
}

.option {
    padding: 12px 16px 12px 50px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.option:hover {
    background-color: #f0f7ff;
    color: #00365f;
}

/* Scrollbar styles for dropdown */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #00365f;
    border-radius: 10px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #003050;
}

/* Add a nice animation for dropdown */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-options {
    animation: fadeIn 0.2s ease-out;
}

@media (max-width: 768px) {
    .dropdown-options {
        max-height: 200px;
    }
}
