/* استيراد خطوط عصرية */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Tajawal:wght@300;400;500;600;700;800&display=swap');

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: linear-gradient(135deg, var(--tina-primary) 0%, var(--header-gradient-end) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background pattern overlay */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Login Container */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Login Card */
.login-card {
    background: var(--card-background);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px var(--border-color);
    backdrop-filter: blur(10px);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease;
}

.login-card.animate-in {
    transform: translateY(0);
    opacity: 1;
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px var(--card-shadow);
    transition: transform 0.3s ease;
}

.logo-circle:hover {
    transform: scale(1.05);
}

.logo-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.project-title {
    color: var(--tina-primary);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.project-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 0;
}

/* Form Styles */
.login-form {
    direction: rtl;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-label i {
    color: var(--tina-primary);
    font-size: 16px;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    background: #FAFAFA;
    transition: all 0.3s ease;
    direction: rtl;
}

.form-control:focus {
    border-color: var(--tina-primary);
    box-shadow: 0 0 0 3px rgba(160, 96, 78, 0.1);
    background: white;
    outline: none;
}

/* Password Input */
.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--tina-primary);
}

/* Login Button */
.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--tina-primary) 0%, var(--tina-primary-light) 100%);
    border: none;
    border-radius: 12px;
    padding: 16px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.login-btn::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: left 0.5s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(160, 96, 78, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

/* Spinning animation for loading */
.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
        margin: 10px;
        border-radius: 16px;
    }

    .project-title {
        font-size: 24px;
    }

    .logo-circle {
        width: 70px;
        height: 70px;
    }
}

/* Focus styles for better accessibility */
.login-btn:focus,
.form-control:focus,
.password-toggle:focus {
    outline: 2px solid var(--tina-primary);
    outline-offset: 2px;
}


/* إضافة تأثير لمحاولات الدخول الفاشلة */
        .error-message {
            background-color: #f8d7da;
            border: 1px solid #f5c6cb;
            color: #721c24;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            text-align: center;
            font-weight: bold;
        }
        
        .success-message {
            background-color: #d4edda;
            border: 1px solid #c3e6cb;
            color: #155724;
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            text-align: center;
            font-weight: bold;
        }
        
        /* تأثير الاهتزاز للأخطاء */
        .shake {
            animation: shake 0.5s;
        }
        
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }
        
        /* تحسينات إضافية للأمان البصري */
        .login-card.error {
            border: 2px solid #dc3545;
        }

        .spinning {
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        /* تحسين مظهر الأخطاء */
        .form-control.error {
            border-color: #dc3545;
            box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
        }
        
        /* تأثير التركيز المحسن */
        .form-control:focus {
            box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        }