﻿:root {
    --primary-color: #7c3aed;
    --primary-hover: #6d28d9;
    --background-start: #111827;
    --background-end: #1f2937;
    --form-bg: rgba(31, 41, 55, 0.6);
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: rgba(75, 85, 99, 0.5);
    --font-family: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: var(--text-primary);
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    width: 1000px;
    height: 650px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.image-panel {
    background: url('/images/Login-side.jpg') center/cover;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    color: white;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 1;
}

.image-panel h2, .image-panel p {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

.image-panel h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.form-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
    background-color: var(--form-bg);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
}

#login-form {
    width: 100%;
    max-width: 380px;
}

    #login-form h2 {
        margin-bottom: 30px;
        font-size: 2.2rem;
        font-weight: 600;
        text-align: center;
    }

.input-group {
    position: relative;
    margin-bottom: 30px;
}

    .input-group .form-control {
        width: 100%;
        padding: 14px 10px;
        background-color: transparent;
        border: none;
        border-bottom: 1px solid var(--border-color);
        font-size: 1rem;
        color: var(--text-primary);
        transition: border-color 0.3s;
    }

        .input-group .form-control:focus {
            outline: none;
            border-bottom-color: var(--primary-color);
        }

    .input-group label {
        position: absolute;
        top: 15px;
        left: 10px;
        color: var(--text-secondary);
        pointer-events: none;
        transition: all 0.3s ease;
    }

    .input-group .form-control:not(:placeholder-shown) + label,
    .input-group .form-control:focus + label {
        top: -10px;
        left: 5px;
        font-size: 0.8rem;
        color: var(--primary-color);
    }

.login-button {
    width: 100%;
    padding: 15px;
    border: none;
    background-image: linear-gradient(to right, #8b5cf6, #6366f1);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

    .login-button:hover {
        box-shadow: 0 10px 20px -10px rgba(124, 58, 237, 0.6);
        transform: translateY(-3px);
    }

    .login-button .button-text {
        transition: opacity 0.2s ease-out;
    }

    .login-button.loading .button-text {
        opacity: 0;
    }

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    position: absolute;
    opacity: 0;
    transition: opacity 0.2s ease-in;
    animation: spin 1s linear infinite;
}

.login-button.loading .loader {
    opacity: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    text-align: center;
    font-size: 0.9rem;
}


    .error-message:empty {
        display: none;
    }

@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
        width: 90%;
        max-width: 480px;
        height: auto;
        margin: 20px;
    }


    .image-panel {
        display: none;
    }

    .form-panel {
        border-left: none;
        border-radius: 20px;
    }
}

body {
    background-image: url("/images/Background.jpg");
    background-size: cover;
}
/* --- New Button Styles --- */

.btn-danger {
    color: #fff;
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

    .btn-danger:hover {
        background-color: #c53030; /* A darker red for hover */
        border-color: #c53030;
        transform: translateY(-2px);
    }

/* A smaller button, perfect for tables */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 0.2rem;
}
.error-message {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box; /* برای محاسبه صحیح عرض */
    text-align: left;
    list-style: none; /* حذف گلوله‌های لیست */
}

    /* 
  مهم: استایل کادر را فقط زمانی نمایش بده که خطا وجود دارد (کلاس .validation-summary-errors)
*/
    .error-message.validation-summary-errors {
        display: block; /* یا flex, grid بسته به نیاز */
        color: #a94442; /* رنگ متن خطا */
        background-color: #f2dede; /* پس‌زمینه قرمز روشن */
        border-color: #ebccd1; /* رنگ حاشیه */
    }

    /*
  مهم: کادر را زمانی که خطایی وجود ندارد (کلاس .validation-summary-valid) کاملا مخفی کن
*/
    .error-message.validation-summary-valid {
        display: none;
    }
/* login.css */

/*
  =======================================================================
  FIX FOR BROWSER AUTOFILL STYLES (WHITE/YELLOW BACKGROUND)
  =======================================================================
*/

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    /* ۱. تغییر رنگ متن */
    /* مرورگر رنگ متن را هم تغییر می‌دهد، با این خط آن را به سفید برمی‌گردانیم */
    -webkit-text-fill-color: #ffffff !important;
    /* ۲. ترفند اصلی: استفاده از box-shadow به جای background-color */
    /* یک سایه داخلی با رنگ پس‌زمینه دلخواه و اندازه بزرگ ایجاد می‌کنیم تا کل input را بپوشاند */
    /* رنگ #1f2a37 را با رنگ پس‌زمینه دقیق input های خود جایگزین کنید */
    box-shadow: 0 0 0 30px #1f2a37 inset !important;
    /* ۳. جلوگیری از انیمیشن تغییر رنگ پس‌زمینه مرورگر */
    /* این خط به مرورگر می‌گوید که تغییر رنگ پس‌زمینه را در یک بازه زمانی بسیار طولانی انجام دهد */
    /* که عملا باعث می‌شود هیچ تغییری دیده نشود */
    transition: background-color 5000s ease-in-out 0s;
    /* در صورت نیاز می‌توانید رنگ caret (مکان‌نما) را هم تغییر دهید */
    caret-color: #ffffff;
}
