﻿/* =========================================
   VARIABLES & RESET
========================================= */
:root {
    --primary-color: #4F46E5;
    --primary-light: #EEF2FF;
    --primary-dark: #4338CA;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --bg-white: #FFFFFF;
    --bg-gray: #F9FAFB;
    --border-color: #E5E7EB;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(79, 70, 229, 0.15);
    --radius-lg: 24px;
    --radius-md: 16px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   MAIN CONTAINER
========================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #C7D2FE 100%);
    padding: 20px;
    font-family: 'Segoe UI', 'Vazir', Tahoma, sans-serif;
    direction: ltr;
    position: relative;
    overflow: hidden;
}

    /* Animated background circles */
    .login-page::before {
        content: '';
        position: absolute;
        width: 600px;
        height: 600px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
        top: -200px;
        right: -200px;
        animation: floatCircle 20s ease-in-out infinite;
    }

    .login-page::after {
        content: '';
        position: absolute;
        width: 400px;
        height: 400px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(79, 70, 229, 0.06) 0%, transparent 70%);
        bottom: -100px;
        left: -100px;
        animation: floatCircle 25s ease-in-out infinite reverse;
    }

@keyframes floatCircle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* =========================================
   LOGIN WRAPPER
========================================= */
.login-wrapper {
    display: flex;
    width: 100%;
    max-width: 1100px;
    min-height: 620px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================
   RIGHT SIDE - BRANDING (RTL)
========================================= */
.login-right-brand {
    flex: 1.1;
    background: linear-gradient(145deg, #1E1B4B 0%, #312E81 50%, #4F46E5 100%);
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
    order: 2;
    direction: rtl; /* اضافه شد - راست به چپ */
    text-align: right; /* اضافه شد - تراز راست */
}

    /* Background Logo - Zoom In/Out Animation */
    .login-right-brand .bg-logo {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 280px;
        height: 280px;
        opacity: 0.06;
        pointer-events: none;
        animation: logoZoom 6s ease-in-out infinite;
        z-index: 0;
    }

        .login-right-brand .bg-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            filter: brightness(0) invert(1);
        }

@keyframes logoZoom {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.04;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.08;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.04;
    }
}

/* Glow effects */
.login-right-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    animation: pulseGlow 8s ease-in-out infinite;
    z-index: 0;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.6;
    }
}

.login-right-brand .brand-content {
    position: relative;
    z-index: 1;
}

.login-right-brand .brand-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    animation: fadeInRight 1s ease;
    direction: rtl; /* اضافه شد */
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-right-brand .brand-logo {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: var(--transition);
    flex-shrink: 0;
}

    .login-right-brand .brand-logo:hover {
        transform: scale(1.05);
    }

    .login-right-brand .brand-logo img {
        width: 50px;
        height: 50px;
        object-fit: contain;
        filter: brightness(0) invert(1);
    }

.login-right-brand .brand-title-main {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #FFFFFF 0%, #C7D2FE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: right; /* اضافه شد */
}

.login-right-brand .brand-subtitle {
    font-size: 1rem;
    opacity: 0.7;
    font-weight: 300;
    margin: 4px 0 0 0;
    text-align: right; /* اضافه شد */
}

.login-right-brand .brand-tagline {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 30px 0 12px 0;
    line-height: 1.4;
    animation: fadeInUp 1.2s ease;
    text-align: right; /* اضافه شد */
}

    .login-right-brand .brand-tagline span {
        background: linear-gradient(135deg, #FCD34D, #F59E0B);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

.login-right-brand .brand-description {
    font-size: 0.95rem;
    opacity: 0.6;
    max-width: 320px;
    line-height: 1.8;
    animation: fadeInUp 1.4s ease;
    text-align: right; /* اضافه شد */
    margin-right: 0; /* اضافه شد */
    margin-left: auto; /* اضافه شد - برای راست‌چین شدن */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-right-brand .brand-features {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    animation: fadeInUp 1.6s ease;
    justify-content: flex-start; /* اضافه شد */
    flex-wrap: wrap; /* اضافه شد */
}

.login-right-brand .feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    opacity: 0.8;
    direction: rtl; /* اضافه شد */
}

    .login-right-brand .feature-item .bi {
        font-size: 1.2rem;
        color: #FCD34D;
    }

/* =========================================
   LEFT SIDE - FORM WITH BACKGROUND LOGO
========================================= */
.login-left-form {
    flex: 1;
    padding: 45px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    position: relative;
    overflow: hidden;
    order: 1;
}

    /* Background Logo for Left Side */
    .login-left-form .bg-logo-left {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 250px;
        height: 250px;
        opacity: 0.04;
        pointer-events: none;
        animation: logoZoomLeft 7s ease-in-out infinite;
        z-index: 0;
    }

        .login-left-form .bg-logo-left img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            filter: grayscale(100%) brightness(0.3);
        }

@keyframes logoZoomLeft {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.03;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.06;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.03;
    }
}

.login-left-form .login-form-container {
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
}

/* =========================================
   MODERN LOGIN BOX
========================================= */
.form-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 40px 38px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

    .form-box:hover {
        box-shadow: 0 8px 40px rgba(79, 70, 229, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }

.form-header {
    margin-bottom: 32px;
    animation: fadeInDown 0.8s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-text {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .welcome-text::before {
        content: '';
        width: 20px;
        height: 2px;
        background: var(--primary-color);
        border-radius: 2px;
    }

.form-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.form-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* =========================================
   FORM FIELDS - MODERN STYLE
========================================= */
.form-group {
    margin-bottom: 20px;
    animation: fadeInUp 0.9s ease;
}

    .form-group:nth-child(2) {
        animation-delay: 0.1s;
    }

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.input-group-modern {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

    .input-group-modern:focus-within {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
        transform: translateY(-1px);
    }

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 0 14px;
    color: var(--text-muted);
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: var(--transition);
    width: 40px;
}

.input-group-modern:focus-within .input-icon {
    color: var(--primary-color);
}

.input-icon i {
    font-size: 1.2rem;
}

.form-control-modern {
    flex: 1;
    border: none;
    padding: 13px 12px 13px 0;
    font-size: 0.9rem;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    transition: var(--transition);
}

    .form-control-modern::placeholder {
        color: var(--text-muted);
        font-size: 0.85rem;
    }

.toggle-password {
    border: none;
    background: transparent;
    padding: 0 14px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 48px;
    z-index: 2;
    position: relative;
}

    .toggle-password:hover {
        color: var(--primary-color);
    }

    .toggle-password:focus {
        outline: none;
    }

    .toggle-password i {
        pointer-events: none;
        font-size: 1.2rem;
    }

/* =========================================
   FORM OPTIONS
========================================= */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 24px 0;
    animation: fadeInUp 1s ease;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    accent-color: var(--primary-color);
    transition: var(--transition);
    margin: 0;
    flex-shrink: 0;
}

    .form-check-input:checked {
        border-color: var(--primary-color);
        background-color: var(--primary-color);
    }

    .form-check-input:hover {
        border-color: var(--primary-color);
    }

.form-check-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

    .forgot-link:hover {
        color: var(--primary-dark);
        text-decoration: underline;
    }

/* =========================================
   SIGN IN BUTTON - MODERN
========================================= */
.btn-signin {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1.1s ease;
}

    .btn-signin::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: 0.6s;
    }

    .btn-signin:hover:not(:disabled)::before {
        left: 100%;
    }

    .btn-signin:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(79, 70, 229, 0.35);
    }

    .btn-signin:active:not(:disabled) {
        transform: translateY(0);
    }

    .btn-signin:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

    .btn-signin i {
        font-size: 1.1rem;
        transition: var(--transition);
    }

    .btn-signin:hover:not(:disabled) i {
        transform: translateX(-4px);
    }

/* =========================================
   ALERT STYLES
========================================= */
.alert {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: none;
    animation: fadeIn 0.5s ease;
}

.alert-danger {
    background: #FEF2F2;
    color: #991B1B;
    border-right: 4px solid #EF4444;
}

.alert .btn-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
    padding: 0 4px;
}

    .alert .btn-close:hover {
        opacity: 1;
    }

.text-danger {
    color: #DC2626;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 992px) {
    .login-wrapper {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
    }

    .login-right-brand {
        padding: 35px 30px;
        min-height: 240px;
        order: 1;
    }

        .login-right-brand .bg-logo {
            width: 180px;
            height: 180px;
        }

    .login-left-form {
        padding: 30px 28px;
        order: 2;
    }

        .login-left-form .bg-logo-left {
            width: 180px;
            height: 180px;
        }

    .form-box {
        padding: 30px 28px;
    }

    .login-right-brand .brand-tagline {
        font-size: 1.4rem;
        margin-top: 16px;
    }

    .login-right-brand .brand-features {
        margin-top: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .login-right-brand .brand-title-main {
        font-size: 1.6rem;
    }

    .login-right-brand .brand-logo {
        width: 56px;
        height: 56px;
    }

        .login-right-brand .brand-logo img {
            width: 38px;
            height: 38px;
        }

    .form-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .login-page {
        padding: 10px;
    }

    .login-right-brand {
        padding: 24px 20px;
        min-height: 180px;
    }

        .login-right-brand .bg-logo {
            width: 120px;
            height: 120px;
        }

    .login-left-form {
        padding: 16px;
    }

        .login-left-form .bg-logo-left {
            width: 120px;
            height: 120px;
        }

    .form-box {
        padding: 24px 18px;
        border-radius: var(--radius-md);
    }

    .login-right-brand .brand-tagline {
        font-size: 1.2rem;
        margin-top: 12px;
    }

    .login-right-brand .brand-description {
        font-size: 0.8rem;
        max-width: 100%;
    }

    .login-right-brand .brand-features {
        flex-direction: column;
        gap: 6px;
        margin-top: 12px;
    }

    .login-right-brand .feature-item {
        font-size: 0.75rem;
    }

    .login-right-brand .brand-title-main {
        font-size: 1.3rem;
    }

    .login-right-brand .brand-subtitle {
        font-size: 0.8rem;
    }

    .login-right-brand .brand-logo {
        width: 44px;
        height: 44px;
    }

        .login-right-brand .brand-logo img {
            width: 30px;
            height: 30px;
        }

    .form-title {
        font-size: 1.3rem;
    }

    .form-subtitle {
        font-size: 0.8rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .input-group-modern {
        border-radius: 12px;
    }

    .form-control-modern {
        padding: 11px 10px 11px 0;
        font-size: 0.85rem;
    }

    .btn-signin {
        padding: 12px;
        font-size: 0.9rem;
    }

    .form-box {
        padding: 20px 16px;
    }

    .welcome-text {
        font-size: 0.65rem;
    }

        .welcome-text::before {
            width: 14px;
        }

    .login-right-brand .brand-logo-wrapper {
        margin-bottom: 16px;
        gap: 12px;
    }

    .login-right-brand .brand-description {
        display: none;
    }

    .input-icon {
        padding: 0 0 0 10px;
        width: 34px;
    }

        .input-icon i {
            font-size: 1rem;
        }

    .toggle-password {
        padding: 0 10px;
        min-height: 44px;
    }

        .toggle-password i {
            font-size: 1rem;
        }
}




/* =========================================
    FORGOT PASSWORD
========================================= */

/* Success Alert */
.alert-success-custom {
    padding: 12px 16px;
    border-radius: var(--radius-md, 12px);
    background: #D1FAE5;
    color: #065F46;
    border-right: 4px solid #10B981;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    animation: fadeIn 0.5s ease;
}

    .alert-success-custom i {
        font-size: 1.2rem;
        color: #10B981;
    }

/* Back Link */
.back-link {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary, #6B7280);
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #E5E7EB);
}

    .back-link a {
        color: var(--primary-color, #4F46E5);
        text-decoration: none;
        font-weight: 700;
        transition: var(--transition, all 0.3s ease);
    }

        .back-link a:hover {
            color: var(--primary-dark, #4338CA);
            text-decoration: underline;
        }

/* Error state for input */
.input-group-modern.error {
    border-color: #EF4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}

    .input-group-modern.error .input-icon {
        color: #EF4444;
    }

/* Validation message styling */
.validation-message {
    color: #DC2626;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

/* Responsive adjustments for ForgotPassword */
@media (max-width: 576px) {
    .back-link {
        font-size: 0.75rem;
        margin-top: 16px;
        padding-top: 12px;
    }

    .alert-success-custom {
        font-size: 0.75rem;
        padding: 10px 12px;
    }

        .alert-success-custom i {
            font-size: 1rem;
        }
}