/* ============================================
   تصميم صفحة تسجيل الدخول - Material Admin Pro Style
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   صفحة تسجيل الدخول الكاملة
   ============================================ */

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4c1d95 60%, #5b21b6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    font-family: 'Cairo', 'Tajawal', 'Roboto', sans-serif;
}

/* تأثير الخلفية المزخرفة */
.login-page::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse-bg 6s ease-in-out infinite;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(109, 40, 217, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse-bg 8s ease-in-out infinite reverse;
}

@keyframes pulse-bg {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* ============================================
   بطاقة تسجيل الدخول
   ============================================ */

.login-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    position: relative;
    z-index: 10;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* رأس البطاقة */
.login-card-header {
    background: linear-gradient(135deg, #5b21b6, #6d28d9);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.login-card-header::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.login-logo {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: #ffffff;
    position: relative;
    z-index: 1;
    animation: float-icon 3s ease-in-out infinite;
}

@keyframes float-icon {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

.login-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.login-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75);
    position: relative;
    z-index: 1;
    margin: 0;
}

/* جسم بطاقة تسجيل الدخول */
.login-card-body {
    padding: 2rem;
}

/* تنبيهات داخل نموذج تسجيل الدخول */
.login-card-body .alert {
    border-radius: 8px !important;
    font-size: 0.875rem;
    padding: 0.75rem 1rem !important;
    border: none !important;
    border-right: 3px solid !important;
    margin-bottom: 1.5rem;
}

.login-card-body .alert-success {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    border-right-color: #059669 !important;
}

.login-card-body .alert-danger {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-right-color: #dc2626 !important;
}

/* ============================================
   حقول النموذج - Material Style
   ============================================ */

.mat-form-field {
    position: relative;
    margin-bottom: 1.25rem;
}

.mat-form-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mat-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.mat-input-icon {
    position: absolute;
    right: 1rem;
    color: #94a3b8;
    font-size: 1rem;
    z-index: 2;
    transition: color 0.2s;
}

.mat-input {
    width: 100%;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem 0.75rem 1rem;
    padding-right: 2.75rem;
    font-size: 0.9375rem;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    color: #1e293b;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
}

.mat-input:hover {
    border-color: #8b5cf6;
    background-color: #ffffff;
}

.mat-input:focus {
    outline: none;
    border-color: #6d28d9;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}

.mat-input:focus ~ .mat-input-icon,
.mat-input-wrapper:focus-within .mat-input-icon {
    color: #6d28d9;
}

.mat-input::placeholder {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* زر تسجيل الدخول */
.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.4);
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
}

.btn-login::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    left: 50%;
    top: 50%;
    margin-left: -50px;
    margin-top: -50px;
}

.btn-login:active::after {
    transform: scale(3);
    opacity: 0;
    transition: transform 0.4s, opacity 0.4s;
}

.btn-login:hover {
    background: linear-gradient(135deg, #5b21b6, #4c1d95);
    box-shadow: 0 6px 20px rgba(109, 40, 217, 0.5);
    transform: translateY(-1px);
}

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

/* تذييل بطاقة تسجيل الدخول */
.login-card-footer {
    padding: 1rem 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid #f1f5f9;
}

.login-card-footer p {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0;
}

/* ============================================
   تصميم الجانب الأيمن (للشاشات الكبيرة)
   ============================================ */

.login-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    width: 100%;
    max-width: 1100px;
    align-items: center;
    position: relative;
    z-index: 10;
}

.login-branding {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    color: #ffffff;
}

.login-branding-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.login-branding-desc {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
}

.login-feature-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
    .login-split-layout {
        grid-template-columns: 1fr;
        max-width: 440px;
    }

    .login-branding {
        display: none;
    }

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

@media (max-width: 480px) {
    .login-card-header {
        padding: 1.75rem 1.5rem;
    }

    .login-card-body {
        padding: 1.5rem;
    }

    .login-title {
        font-size: 1.125rem;
    }
}

/* ============================================
   التوافق - للاحتفاظ بالواجهة القديمة
   ============================================ */

.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4c1d95 60%, #5b21b6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    font-family: 'Cairo', 'Tajawal', 'Roboto', sans-serif;
}

.gradient-background {
    display: none;
}

.login-content {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    width: 100%;
    max-width: 1000px;
    align-items: center;
}

.login-form-section {
    display: flex;
    justify-content: center;
}

.glass-morphism {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: none;
    backdrop-filter: none;
}

.form-wrapper {
    padding: 2rem;
    width: 100%;
    max-width: 420px;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(109, 40, 217, 0.4);
    animation: float-icon 3s ease-in-out infinite;
}

.form-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.form-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 1rem;
    transition: all 0.2s;
}

.input-wrapper:hover {
    border-color: #8b5cf6;
    background: #ffffff;
}

.input-wrapper.focused {
    border-color: #6d28d9;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.12);
}

.input-icon {
    color: #94a3b8;
    font-size: 1rem;
    margin-left: 0.75rem;
    transition: color 0.2s;
}

.input-wrapper.focused .input-icon {
    color: #6d28d9;
}

.glass-input {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    color: #1e293b !important;
    font-size: 0.9375rem !important;
    padding: 0.75rem 0 !important;
    flex: 1;
    outline: none;
    box-shadow: none !important;
    font-family: 'Cairo', 'Tajawal', sans-serif !important;
}

.glass-input::placeholder {
    color: #94a3b8 !important;
}

.glass-input:focus {
    background: transparent !important;
    color: #1e293b !important;
    box-shadow: none !important;
}

.glass-input:-webkit-autofill,
.glass-input:-webkit-autofill:hover,
.glass-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #1e293b !important;
}

.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.4);
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.btn-submit::before {
    display: none;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #5b21b6, #4c1d95);
    box-shadow: 0 6px 20px rgba(109, 40, 217, 0.5);
    transform: translateY(-1px);
    color: #ffffff;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
}

.footer-text {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0;
}

.alert {
    border-radius: 8px !important;
    border: none !important;
    border-right: 3px solid !important;
    font-size: 0.875rem;
    padding: 0.75rem 1rem !important;
}

.alert-success {
    background: #d1fae5 !important;
    color: #065f46 !important;
    border-right-color: #059669 !important;
}

.alert-danger {
    background: #fee2e2 !important;
    color: #991b1b !important;
    border-right-color: #dc2626 !important;
}

.alert .btn-close {
    filter: none;
}

/* قسم الصورة الجانبية */
.animation-section {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: right;
    color: #ffffff;
    padding: 2rem;
}

.ac-unit-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ac-gif-image {
    max-width: 300px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-password-toggle {
    flex-shrink: 0;
    padding: 0 0 0 0.5rem;
    border: 0;
    background: none;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.login-password-toggle.is-visible {
    color: #6d28d9;
}

@media (max-width: 768px) {
    .login-content {
        grid-template-columns: 1fr;
        max-width: 440px;
    }

    .animation-section {
        display: none;
    }
}
