/* loginStyles.css - طراحی حرفه‌ای و مینیمال صفحه ورود - نسخه فشرده */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 10px 30px -5px rgba(99, 102, 241, 0.3);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset و تنظیمات پایه */
.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: auto;
    direction: rtl;
}

/* افکت‌های پس‌زمینه */
.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    z-index: 1;
}

/* کانتینر اصلی */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* کارت فرم ورود */
.login-form {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow:
        var(--shadow-xl),
        0 15px 30px rgba(0, 0, 0, 0.1),
        0 0 80px rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

/* نوار رنگی بالای فرم */
.login-form::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to left, var(--primary-color), var(--primary-light));
}

/* بخش لوگو */
.logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-container > div {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
    box-shadow: var(--shadow-md);
}

.logo-container h2 {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-container p {
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    opacity: 0.8;
}

/* گروه‌های فرم */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* استایل inputها */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--gray-800);
    background: var(--light-color);
    transition: var(--transition);
    font-family: inherit;
    height: 44px;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: white;
}

.input-with-icon input:hover {
    border-color: var(--gray-300);
}

.input-with-icon input::placeholder {
    color: var(--gray-400);
    font-size: 0.85rem;
}

/* آیکون‌های input */
.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.1rem;
    transition: var(--transition);
    pointer-events: none;
}

.input-with-icon input:focus ~ .input-icon {
    color: var(--primary-color);
}

/* دکمه نمایش رمز عبور */
.password-toggle {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    transition: var(--transition);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.password-toggle:hover {
    color: var(--gray-600);
    background: rgba(0, 0, 0, 0.05);
}

/* دکمه ورود */
.login-form button[type="submit"] {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.75rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    height: 46px;
}

.login-form button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), var(--shadow-primary);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.login-form button[type="submit"]:active {
    transform: translateY(0);
}

.login-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* لودر دکمه */
.btn-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

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

/* گزینه‌های اضافی */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0 1.25rem;
    font-size: 0.85rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--gray-600);
}

.checkbox-container input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.85rem;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* پیام‌های سیستم */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    animation: slideIn 0.3s ease-out;
    border-right: 3px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.4;
    font-size: 0.85rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-color: var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-color: var(--danger-color);
}

.alert span:first-child {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* ورود با شبکه‌های اجتماعی */
.social-login {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.social-login p {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.social-login p::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 1px;
    background: var(--gray-200);
    z-index: -1;
}

.social-login p span {
    background: white;
    padding: 0 0.75rem;
}

.social-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.social-btn {
    flex: 1;
    padding: 0.625rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--gray-700);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 38px;
}

.social-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.social-btn.google:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.social-btn.github:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

/* لینک ثبت‌نام */
.signup-link {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 0.9rem;
}

.signup-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    margin-right: 0.5rem;
}

.signup-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* واکنش‌گرایی */
@media (max-width: 480px) {
    .login-container {
        padding: 1rem;
    }

    .login-form {
        padding: 1.5rem;
    }

    .logo-container {
        margin-bottom: 1.25rem;
    }

    .logo-container > div {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .logo-container h2 {
        font-size: 1.3rem;
    }

    .social-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .social-btn {
        min-height: 36px;
        padding: 0.5rem;
    }
}

@media (max-height: 700px) {
    .login-page {
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1rem;
        min-height: 100vh;
        overflow-y: auto;
    }

    .login-container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .login-form {
        padding: 1.5rem;
    }
}

/* استایل‌های سفارشی برای حالت focus */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px white inset !important;
    box-shadow: 0 0 0px 1000px white inset !important;
    -webkit-text-fill-color: var(--gray-800) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* استایل برای ارتفاع کم */
@media (max-height: 600px) {
    .login-page {
        align-items: flex-start;
        padding: 0.5rem 0;
    }

    .login-container {
        max-width: 380px;
        padding: 0.75rem;
    }

    .login-form {
        padding: 1.25rem;
    }

    .logo-container {
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .social-login {
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .signup-link {
        margin-top: 1rem;
        padding-top: 1rem;
    }
}

/* برای صفحات با عرض کم و ارتفاع زیاد */
@media (max-height: 800px) and (min-width: 768px) {
    .login-page {
        padding: 2rem 0;
    }
}

/* حذف انیمیشن‌های اضافی برای عملکرد بهتر */
@media (prefers-reduced-motion: reduce) {
    .login-container,
    .alert,
    .login-form button[type="submit"] {
        animation: none;
        transition: none;
    }
}
