﻿/* General container styles */
.login-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    font-family: 'Vazirmatn', sans-serif;
}

/* Branding section (Right side) */
.branding-section {
    width: 45%;
    background: linear-gradient(60deg,#6d279b, #11307e );
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.branding-content img {
    width: 150px;
    margin-bottom: 2rem;
}

.branding-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.branding-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Form section (Left side) */
.form-section {
    width: 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
}

.form-content {
    width: 70%;
    max-width: 400px;
}

    .form-content h2 {
        font-weight: 800;
    }

.form-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Step management for transitions */
.login-step {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

    .login-step.active {
        display: block;
        opacity: 1;
    }

/* Floating label form inputs */
.form-group.floating-label {
    position: relative;
    margin-bottom: 1.75rem;
}

.floating-label .form-control {
    height: 50px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: #fff;
}

    .floating-label .form-control:focus {
        border-color: #112f7e;
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
    }

.floating-label label {
    position: absolute;
    top: 14px;
    right: 15px;
    color: #888;
    pointer-events: none;
    transition: all 0.2s ease;
    background-color: #fff;
    padding: 0 5px;
}

.form-control:focus + label, .form-control:not(:placeholder-shown) + label {
    top: -10px;
    right: 10px;
    font-size: 0.8rem;
    color: #112f7e;
}

.password-container {
    position: relative;
}

    .password-container .form-control {
        padding-left: 45px !important; /* Creates space for the icon on the left */
    }

.password-toggle {
    position: absolute;
    top: 50%;
    left: 15px; /* Position on the left for LTR input */
    transform: translateY(-50%);
    cursor: pointer;
    color: #888;
    line-height: 1;
}

    .password-toggle svg {
        width: 20px;
        height: 20px;
    }

/* OTP input styles */
.otp-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.otp-input {
    width: 45px;
    height: 50px;
    text-align: center;
    font-size: 1.5rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    transition: all 0.2s;
}

    .otp-input:focus {
        border-color: #112f7e;
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
        outline: none;
    }

/* Links below forms */
.form-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.9rem;
}

    .form-links a {
        color: #112f7e;
        text-decoration: none;
        transition: color 0.2s;
    }

        .form-links a:hover {
            color: #0a58ca;
        }

        .form-links a.disabled {
            color: #999;
            pointer-events: none;
        }

/* Password Strength Validator Styles */
#password-strength-validator {
    background-color: #f1f3f5;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

    #password-strength-validator p {
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

    #password-strength-validator ul {
        list-style-type: none;
        padding: 0;
        margin: 0;
    }

    #password-strength-validator li {
        color: #555;
        margin-bottom: 0.25rem;
        transition: color 0.3s;
    }

        #password-strength-validator li.valid {
            color: #198754; /* Green for valid */
        }

            #password-strength-validator li.valid::before {
                content: '✓ ';
                font-weight: bold;
                margin-left: 5px;
            }

        #password-strength-validator li.invalid::before {
            content: '○ ';
            margin-left: 5px;
        }


/* === REVISED & MORE SPECIFIC Button Styles === */
.form-section .btn-primary {
    background-color: #112f7e !important;
    border: 2px solid #112f7e !important;
    color: #ffffff !important;
    padding: 10px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease-in-out; /* Simplified transition */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

    /* ✅ Stronger hover selector to override other styles */
    .form-section .btn-primary:not(.loading):hover,
    .form-section .btn-primary:not(.loading):focus {
        background-color: #ffffff !important;
        color: #112f7e !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .form-section .btn-primary.loading {
        background-color: #0a58ca !important;
        border-color: #0a58ca !important;
        color: #ffffff !important;
        cursor: wait;
        opacity: 0.9;
        transform: translateY(0); /* Reset transform on loading */
        box-shadow: none; /* Reset shadow on loading */
    }

.form-section .btn .spinner {
    display: none;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.form-section .btn.loading .spinner {
    display: inline-block;
}

.form-section .btn.loading .btn-text {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === ✅ START: RESPONSIVE STYLES === */

/* For tablets and smaller devices (e.g., screen width less than 992px) */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column; /* Stack sections vertically instead of side-by-side */
    }

    .branding-section {
        display: none; /* Hide the branding section to save space */
    }

    .form-section {
        width: 100%; /* Make the form section take the full width */
        height: 100%;
        justify-content: center; /* Horizontally center the content */
        align-items: flex-start; /* Align form to the top on mobile */
        padding-top: 4rem; /* Add some space from the top of the screen */
    }
}

/* For small mobile devices (e.g., screen width less than 480px) */
@media (max-width: 480px) {
    .form-content {
        width: 90%; /* Use more of the screen width for the form itself */
    }

    .otp-input {
        width: 40px; /* Make OTP inputs slightly smaller to fit */
        height: 45px;
        font-size: 1.2rem;
    }

    .form-links {
        flex-direction: column; /* Stack links vertically */
        align-items: center;
        gap: 0.5rem; /* Add some space between stacked links */
    }
}
/* === ✅ END: RESPONSIVE STYLES === */