/* ===== إصلاح السكرول الكامل ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'Cairo', sans-serif;
    background: #050505;
    color: white;
    min-height: 100vh;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;

    display: flex;
    align-items: center;
    justify-content: center;
}


/* ===== الخلفيات المتحركة ===== */
.glow1, .glow2 {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    animation: pulse 6s infinite;
    pointer-events: none;
    z-index: -2;
}

.glow1 {
    top: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: rgba(147, 51, 234, 0.2);
}

.glow2 {
    bottom: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: rgba(0, 243, 255, 0.2);
    animation-delay: 3s;
}

.grid-bg {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 60%, transparent 100%);
    z-index: -1;
}

/* ===== البطاقة الرئيسية ===== */
.login-card {
    max-width: 420px;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: slideUp 0.6s ease-out;
    margin: auto;
}

/* ===== باقي الكود بدون تغيير ===== */
.card-header {
    text-align: center;
    padding: 2.5rem 2rem 1.5rem;
}

.logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, #bc13fe, #00f3ff);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 32px rgba(188, 19, 254, 0.4);
    transition: all 0.4s ease;
    transform: rotate(3deg);
}

.logo:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 20px 40px rgba(188, 19, 254, 0.6);
}

.logo span {
    font-size: 2.5rem;
    animation: pulse 2s infinite;
}

.title {
    font-size: 2.25rem;
    font-weight: 900;
    background: linear-gradient(to left, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    font-weight: 400;
}

/* ===== التبويبات ===== */
.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab {
    flex: 1;
    padding: 1.25rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: none;
    border: none;
    font-family: inherit;
}

.tab:hover {
    color: #00f3ff;
}

.tab.active {
    color: #00f3ff;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00f3ff, transparent);
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.6);
}

/* ===== النموذج ===== */
.form-container {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    
}

.form-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-align: right;
}


/* ===== مجموعة كلمة المرور (معدلة) ===== */
.password-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7); /* ✅ لون أوضح */
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10; /* ✅ فوق الـ input */
}

.password-toggle:hover {
    color: #00f3ff;
    transform: translateY(-50%) scale(1.1);
}

/* مساحة للعين داخل الـ input */
.password-group .form-input {
    padding-left: 3.5rem;
}

.eye-icon {
    font-size: 1.2rem;
    display: inline-block;
}

/* ===== خيارات التذكر والنسيان ===== */
.checkbox-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color 0.3s;
}

.checkbox-label:hover {
    color: white;
}

.checkbox-input {
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    accent-color: #00f3ff;
    cursor: pointer;
}

.forgot-link {
    color: #00f3ff;
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    padding: 0;
}

.forgot-link:hover {
    text-decoration: underline;
    color: #bc13fe;
}

/* ===== أزرار الإرسال ===== */
.submit-btn {
    width: 100%;
    padding: 1rem;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1.5rem;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-login {
    background: linear-gradient(135deg, #00f3ff 0%, #0061ff 100%);
    color: #000;
    box-shadow: 0 8px 25px rgba(0, 243, 255, 0.3);
}

.submit-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 243, 255, 0.5);
}

.submit-signup {
    background: linear-gradient(135deg, #bc13fe 0%, #8a2be2 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(188, 19, 254, 0.3);
}

.submit-signup:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(188, 19, 254, 0.5);
}

/* ===== الخط الفاصل ===== */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.divider span {
    padding: 0 1rem;
}

/* ===== زر Google ===== */
.google-btn {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
}

.google-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.google-icon {
    font-size: 1.25rem;
    font-weight: bold;
    background: white;
    color: #4285f4;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== نافذة الاستعادة ===== */
.forgot-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.forgot-modal.hidden {
    display: none;
}

.forgot-card {
    background: rgba(17, 17, 17, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: slideUp 0.4s ease;
}

.close-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.75rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ===== رابط العودة ===== */
.back-link {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s;
    z-index: 1000;
}

.back-link:hover {
    color: #00f3ff;
}

.back-icon {
    width: 20px;
    height: 20px;
}

/* ===== الأنيميشن ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== كلاسات مساعدة ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    body {
        padding: 1rem;
    }
    
    .login-card {
        margin: 1rem auto;
    }
    
    .form-container {
        padding: 1.5rem;
    }
    
    .card-header {
        padding: 2rem 1.5rem 1rem;
    }
    
    .back-link {
        top: 1rem;
        left: 1rem;
    }
}

/* ===== تحسينات إضافية للموبايل ===== */
@media (max-width: 768px) {
    .form-input {
        font-size: 16px; /* يمنع auto-zoom على iOS */
        padding: 0.9rem;
    }
    
    .submit-btn,
    .google-btn {
        min-height: 48px;
        font-size: 0.95rem;
    }
}


/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 350px;
    pointer-events: none;
}

.toast {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    animation: toastSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
}

/* الألوان حسب النوع */
.toast.success {
    background: rgba(74, 222, 128, 0.95);
    color: #064e3b;
    border-color: rgba(74, 222, 128, 0.3);
}

.toast.error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border-color: rgba(239, 68, 68, 0.3);
}

.toast.info {
    background: rgba(0, 243, 255, 0.95);
    color: #000;
    border-color: rgba(0, 243, 255, 0.3);
}

.toast.warning {
    background: rgba(251, 191, 36, 0.95);
    color: #000;
    border-color: rgba(251, 191, 36, 0.3);
}

/* الأنيميشن */
@keyframes toastSlideIn {
    to {
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.exit {
    animation: toastSlideOut 0.3s ease forwards;
}

/* موبايل */
@media (max-width: 480px) {
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-height: 700px) {
    body {
        align-items: flex-start;
    }

    .login-card {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

.login-button {
    transition: all 0.3s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
}

/* ===== Input Base Style ===== */
.form-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
    transition: all 0.25s ease;
}

/* ===== Input Focus Effect ===== */
.form-group input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

/* العبارة كاملة بتدرج وتوهج */
.gradient-text {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInUp 1s ease 0.2s both;
    letter-spacing: 0.5px;
    
    /* التدرج للعبارة كلها */
    background: linear-gradient(
        90deg,
        #667eea 0%,
        #764ba2 50%,
        #6b8cff 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    /* التوهج للعبارة كلها */
    animation: softGlow 3s ease-in-out infinite, fadeInUp 1s ease 0.2s both;
}

/* توهج ناعم */
@keyframes softGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(102, 126, 234, 0.6),
                     0 0 30px rgba(139, 92, 246, 0.4);
    }
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(
        135deg,
        #D4AF37 0%,        /* ذهبي غامق */
        #F1C40F 30%,       /* ذهبي فاتح */
        #9B59B6 60%,       /* بنفسجي ساحر */
        #6A0DAD 80%,       /* بنفسجي غامق */
        #4B0082 100%       /* نيلي غامق */
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 300% 300%;
    animation: royalMysticFlow 6s ease infinite, royalGlow 3s ease-in-out infinite;
}

/* حركة التدرج */
@keyframes royalMysticFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* التوهج الملكي */
@keyframes royalGlow {
    0%, 100% {
        filter: brightness(1);
        text-shadow: 
            0 0 20px rgba(212, 175, 55, 0.5),
            0 0 40px rgba(155, 89, 182, 0.3),
            0 0 60px rgba(106, 13, 173, 0.2);
    }
    50% {
        filter: brightness(1.2);
        text-shadow: 
            0 0 30px rgba(212, 175, 55, 0.8),
            0 0 60px rgba(155, 89, 182, 0.6),
            0 0 90px rgba(106, 13, 173, 0.4);
    }
}

