/* استایل اصلی کانتینر */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    position: relative;
    overflow: hidden;
}

/* کارت لاگین */
.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* هدر لاگین */
.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    margin-bottom: 20px;
}

.logo img {
    max-width: 120px;
    height: auto;
    border-radius: 10px;
}

.login-header h2 {
    color: #333;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 1.1rem;
}

/* فرم لاگین */
.login-form .alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

.login-form .alert i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.alert-error {
    background: #fdf2f2;
    border: 1px solid #f8d7da;
    color: #721c24;
}

.alert-error ul {
    margin: 8px 0 0 0;
    padding-right: 20px;
}

.alert-error li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.alert-success {
    background: #f0f9f4;
    border: 1px solid #d1f0db;
    color: #155724;
}

/* گروه‌های فرم */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group.focused .form-label {
    color: #667eea;
}

.form-group.focused .form-input {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.form-label i {
    font-size: 1.1rem;
    color: #666;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
    border-color: #e74c3c;
    background: #fdf2f2;
}

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

/* بخش پسورد */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: #333;
}

.password-toggle i {
    font-size: 1.1rem;
}

.error-message {
    display: flex;
    align-items: center;
    margin-top: 8px;
    color: #e74c3c;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

.error-message i {
    margin-left: 5px;
    font-size: 0.8rem;
}

/* گزینه‌های فرم */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #555;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.checkbox-wrapper:hover {
    color: #333;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.forgot-password {
    color: #667eea;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* دکمه ارسال */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.submit-btn.loading i {
    animation: spin 1s linear infinite;
}

.submit-btn i {
    font-size: 1.2rem;
}

/* فوتر لاگین */
.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.login-footer p {
    color: #666;
    font-size: 1rem;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* دکوریشن‌ها */
.login-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.decoration-item {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.decoration-item:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.decoration-item:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.decoration-item:nth-child(3) {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

/* انیمیشن‌ها */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* رسپانسیو برای تبلت و موبایل */
@media (max-width: 768px) {
    .login-container {
        padding: 15px;
    }

    .login-card {
        padding: 30px 25px;
        margin: 10px;
    }

    .login-header h2 {
        font-size: 1.7rem;
    }

    .login-header p {
        font-size: 1rem;
    }

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

    .form-input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .password-wrapper .password-toggle {
        left: 12px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .submit-btn {
        padding: 12px;
        font-size: 1rem;
    }

    .login-decoration {
        display: none;
    }
}

/* رسپانسیو برای موبایل‌های کوچک */
@media (max-width: 480px) {
    .login-card {
        padding: 25px 20px;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }

    .logo img {
        max-width: 100px;
    }

    .form-label {
        font-size: 0.95rem;
    }

    .form-input {
        font-size: 0.9rem;
    }

    .submit-btn {
        font-size: 0.95rem;
        padding: 10px;
    }
}

/* رسپانسیو برای دسکتاپ‌های بزرگ */
@media (min-width: 1200px) {
    .login-card {
        max-width: 500px;
        padding: 50px;
    }

    .login-header h2 {
        font-size: 2.2rem;
    }

    .form-input {
        padding: 15px 20px;
        font-size: 1.1rem;
    }

    .submit-btn {
        padding: 18px;
        font-size: 1.2rem;
    }
}

/* حالت تاریک */
@media (prefers-color-scheme: dark) {
    .login-container {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }

    .login-card {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .login-header h2 {
        color: #ecf0f1;
    }

    .login-header p {
        color: #bdc3c7;
    }

    .alert-error {
        background: #4a2c2c;
        border-color: #6b3a3a;
        color: #f8d7da;
    }

    .alert-success {
        background: #2d4a2d;
        border-color: #3a6b3a;
        color: #d1f0db;
    }

    .form-label {
        color: #ecf0f1;
    }

    .form-label i {
        color: #bdc3c7;
    }

    .form-input {
        background: #34495e;
        border-color: #4a6278;
        color: #ecf0f1;
    }

    .form-input:focus {
        background: #2c3e50;
        border-color: #667eea;
    }

    .form-input::placeholder {
        color: #95a5a6;
    }

    .checkbox-wrapper {
        color: #bdc3c7;
    }

    .checkbox-wrapper:hover {
        color: #ecf0f1;
    }

    .forgot-password {
        color: #667eea;
    }

    .forgot-password:hover {
        color: #8a9eff;
    }

    .login-footer {
        border-color: #4a6278;
    }

    .login-footer p {
        color: #bdc3c7;
    }

    .login-footer a {
        color: #667eea;
    }

    .login-footer a:hover {
        color: #8a9eff;
    }
}

/* پشتیبانی از مرورگرهای قدیمی */
@supports not (backdrop-filter: blur(10px)) {
    .login-card {
        background: white;
    }
}

/* بهبود عملکرد انیمیشن‌ها */
@media (prefers-reduced-motion: reduce) {
    .login-card,
    .submit-btn,
    .form-input,
    .decoration-item {
        transition: none;
        animation: none;
    }
}
