﻿/* --- Global Styles & Background --- */
body {
    position: relative;
    font-family: 'Cairo', sans-serif;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

* {
    font-family: 'Cairo', sans-serif;
}

    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('../img/LogInCover.Png');
        background-size: cover;
        background-position: center;
        filter: brightness(0.5) blur(2px);
        z-index: -1; /* يجعل الصورة خلف المحتوى */
    }

.login-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

/* --- Login Card Styling --- */
.login-card {
    border-radius: 15px; /* زوايا أكثر نعومة */
    background-color: rgba(255, 255, 255, 0.98); /* خلفية بيضاء شفافة قليلاً */
    backdrop-filter: blur(5px); /* تأثير بلور للخلفية (إذا كانت الخلفية صورة أو تدرج) */
    border: none;
}

/* --- Card Header --- */
.login-header {
    background-color: transparent; /* بدون لون خلفية للهيدر */
    padding: 30px 30px 20px 30px; /* تعديل الحشو */
    border-bottom: 1px solid #eee; /* خط فاصل ناعم */
}

.login-logo {
    max-width: 120px; /* تحكم بحجم الشعار */
    height: auto;
}

.login-title {
    font-weight: 600;
    color: #333;
    font-size: 1.8rem; /* حجم أكبر للعنوان */
}

    .login-title i {
        color: #764ba2; /* لون الأيقونة يتناسق مع التدرج */
    }

.login-subtitle {
    font-size: 0.95rem;
    color: #6c757d; /* لون أغمق قليلاً */
}

/* --- Card Body --- */
.login-body {
    padding: 40px 40px; /* زيادة الحشو */
}

/* --- Input Fields Styling --- */
.form-group {
    position: relative; /* لوضع الأيقونات */
}

.login-input {
    border-radius: 10px; /* زوايا أنعم للحقول */
    padding: 12px 15px 12px 45px; /* تعديل الحشو لإفساح المجال للأيقونة */
    border: 1px solid #ced4da;
    font-size: 1rem;
    background-color: #f8f9fa; /* خلفية فاتحة للحقل */
}

    .login-input:focus {
        background-color: #fff;
        border-color: #764ba2; /* لون الحدود عند التركيز */
        box-shadow: 0 0 0 0.25rem rgba(118, 75, 162, 0.2); /* ظل عند التركيز */
        outline: none;
    }

    /* Placeholder styling */
    .login-input::placeholder {
        color: #adb5bd;
        font-weight: 300;
    }

/* Icon inside input field */
.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd; /* لون الأيقونة */
    font-size: 1.1rem;
    pointer-events: none; /* لمنع التفاعل مع الأيقونة */
    z-index: 3;
}

.login-input:focus + .input-icon i,
.login-input:not(:placeholder-shown) + .input-icon i { /* تغيير لون الأيقونة عند التركيز أو الكتابة */
    /* This doesn't work because the icon span is *before* the input */
    /* We need to target the icon from the parent on input focus */
}

.form-group .input-icon i {
    transition: color 0.3s ease;
}

.login-input:focus ~ .input-icon i { /* استهداف الأيقونة عند التركيز على الحقل (باستخدام General Sibling Combinator) */
    color: #764ba2;
}
/* --- Validation Styling --- */
.invalid-feedback {
    display: block; /* تأكد من ظهور رسائل الخطأ */
    font-size: 0.85rem;
    margin-top: 5px;
}

.form-control.is-invalid { /* Bootstrap class */
    border-color: #dc3545; /* لون حدود الخطأ */
    padding-right: calc(1.5em + .75rem); /* مساحة لأيقونة الخطأ إن وجدت */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(.375em + .1875rem) center;
    background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

    .form-control.is-invalid:focus {
        box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
    }

/* --- Remember Me & Forgot Password --- */
.remember-me-label .form-check-input {
    border-radius: 4px; /* تعديل شكل الـ checkbox */
    border-color: #adb5bd;
}

    .remember-me-label .form-check-input:checked {
        background-color: #764ba2;
        border-color: #764ba2;
    }

.remember-me-label .form-check-label {
    font-size: 0.9rem;
    color: #555;
    padding-left: 5px; /* مسافة بين الـ checkbox والنص */
}

.forgot-password-link {
    font-size: 0.9rem;
    color: #764ba2;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .forgot-password-link:hover {
        color: #5a3782;
        text-decoration: underline;
    }


/* --- Login Button --- */
.btn-login {
    padding: 12px 20px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 10px;
    /* تدرج لوني للزر */
    background: linear-gradient(to right, #667eea, #764ba2);
    border: none;
    color: #fff;
}

    .btn-login:hover {
        background: linear-gradient(to right, #5a68d4, #643a8a); /* تغيير التدرج عند المرور */
        color: #fff;
    }

    .btn-login i {
        margin-right: 8px; /* مسافة بين الأيقونة والنص */
    }


/* --- Registration Link --- */
.registration-link {
    font-size: 0.95rem;
    color: #555;
}

    .registration-link a {
        color: #764ba2;
        font-weight: 500;
        text-decoration: none;
        transition: color 0.2s ease;
    }

        .registration-link a:hover {
            color: #5a3782;
            text-decoration: underline;
        }

/* --- Responsive Adjustments --- */
@media (max-width: 767px) {
    .login-card {
        margin-top: 30px; /* إضافة هامش علوي في الشاشات الصغيرة */
        margin-bottom: 30px;
    }

    .login-body {
        padding: 30px;
    }

    .login-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 575px) {
    .login-header {
        padding: 25px 20px 15px 20px;
    }

    .login-body {
        padding: 25px;
    }

    .login-input {
        padding: 10px 12px 10px 40px; /* تصغير الحشو */
        font-size: 0.9rem;
    }

    .input-icon {
        left: 12px;
        font-size: 1rem;
    }

    .btn-login {
        padding: 10px 15px;
        font-size: 1rem;
    }
}
