/* Modern Auth Layout */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body,
html {
    height: 100%;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
}

.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: #fff;
}

/* Left Side - Branding & Welcome */
.auth-left {
    flex: 1;
    background: #2a28b0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMiIgY3k9IjIiIHI9IjIiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4xKSIvPjwvc3ZnPg==');
    opacity: 0.4;
}

.auth-branding {
    position: relative;
    z-index: 2;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.auth-branding h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-branding p {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 450px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 300;
}

/* Right Side - Form */
.auth-right {
    flex: 1;
    display: flex;
    /* justify-content: center; REMOVED to allow margin:auto to handle centering safely */
    /* align-items: center; REMOVED */
    padding: 2rem;
    background-color: #ffffff;
    height: 100vh;
    overflow-y: auto;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    animation: fadeInUp 0.6s ease-out;
    margin: auto;
    /* Handle centering safely with overflow */
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #666;
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-control-custom {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #eef0f5;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    color: #333;
}

.form-control-custom:focus {
    border-color: #3c3adf;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(60, 58, 223, 0.1);
}

.form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.form-control-custom:focus+.form-icon,
.form-control-custom:focus~.form-icon {
    color: #3c3adf;
}

.btn-auth {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff751f 0%, #e66a1b 100%);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 117, 31, 0.3);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 117, 31, 0.4);
    background: linear-gradient(135deg, #e66a1b 0%, #d85c10 100%);
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    color: #666;
}

.auth-footer a {
    color: #3c3adf;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: #2a28b0;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 991px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-left {
        padding: 3rem 2rem;
        flex: 0 0 auto;
        text-align: center;
    }

    .auth-branding h1 {
        font-size: 2.5rem;
    }

    .auth-right {
        flex: 1;
        padding: 2rem;
        height: auto;
        overflow-y: auto;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alerts */
.alert-custom {
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.alert-custom i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.alert-danger-custom {
    background-color: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-success-custom {
    background-color: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
}

/* Loading Overlay */
#loading_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    /* Always display flex but hide with opacity */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
}

#loading_overlay.visible {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 117, 31, 0.1);
    border-top: 3px solid #ff751f;
    /* Use theme orange */
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 117, 31, 0.1);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #555;
    letter-spacing: 0.5px;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.5s ease 0.2s;
}

#loading_overlay.visible .loading-text {
    transform: translateY(0);
    opacity: 1;
}