/* =======================================================================
   Premium Login Styles - Experience Platform
   نظام تصميم احترافي متكامل لصفحة تسجيل الدخول
   ======================================================================= */

/* ===========================
   1. RESET & GLOBAL STYLES
   =========================== */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================
   2. CSS VARIABLES (DESIGN TOKENS)
   =========================== */
:root {
    /* Primary Colors - ألوان رئيسية جديدة */
    --primary-gradient-start: #FF6B6B;
    --primary-gradient-end: #FFD93D;
    --secondary-gradient-start: #6C5CE7;
    --secondary-gradient-end: #A29BFE;
    
    /* Brand Colors - ألوان العلامة التجارية */
    --brand-purple: #667eea;
    --brand-purple-dark: #764ba2;
    --brand-purple-light: #A29BFE;
    
    /* Accent Colors - ألوان تمييز */
    --accent-cyan: #00D2FF;
    --accent-pink: #FF4757;
    --accent-red: #FF6B6B;
    --accent-yellow: #FFD93D;
    --success-green: #2ECC71;
    --success-green-dark: #27AE60;
    
    /* Background Gradients - خلفيات متدرجة */
    --bg-premium: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-page: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-input: rgba(255, 255, 255, 0.9);
    --bg-footer: #F8F9FA;
    
    /* Text Colors - ألوان النصوص */
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
    --text-light: #ECF0F1;
    --text-white: #FFFFFF;
    
    /* Border Colors - ألوان الحدود */
    --border-light: #E8EAED;
    --border-focus: #667eea;
    --border-error: #FF4757;
    
    /* Shadow Styles - أنماط الظلال */
    --shadow-premium: 0 20px 60px rgba(102, 126, 234, 0.3);
    --shadow-hover: 0 30px 80px rgba(102, 126, 234, 0.5);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-button: 0 10px 30px rgba(102, 126, 234, 0.4);
    --shadow-button-hover: 0 15px 40px rgba(102, 126, 234, 0.6);
    --shadow-social: 0 8px 20px rgba(0, 0, 0, 0.1);
    
    /* Spacing - المسافات */
    --spacing-xs: 8px;
    --spacing-sm: 15px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;
    --spacing-xxl: 50px;
    
    /* Border Radius - استدارة الزوايا */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-xxl: 30px;
    
    /* Transitions - الانتقالات */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.4s ease;
    --transition-bounce: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-smooth: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===========================
   3. BODY & PAGE LAYOUT
   =========================== */
body {
    font-family: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    position: relative;
    overflow-x: hidden;
    color: var(--text-primary);
}

/* خلفية متحركة - Animated Background Blobs */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
    z-index: 0;
}

body::before {
    background: radial-gradient(circle, var(--accent-red), var(--accent-yellow));
    top: -200px;
    left: -200px;
    animation-delay: -5s;
}

body::after {
    background: radial-gradient(circle, var(--accent-cyan), var(--secondary-gradient-start));
    bottom: -200px;
    right: -200px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { 
        transform: translate(0, 0) scale(1); 
    }
    25% { 
        transform: translate(50px, 50px) scale(1.1); 
    }
    50% { 
        transform: translate(-30px, 80px) scale(0.9); 
    }
    75% { 
        transform: translate(80px, -50px) scale(1.05); 
    }
}

/* ===========================
   4. MAIN CONTAINER
   =========================== */
.login-container {
    position: relative;
    z-index: 1;
    max-width: 480px;
    width: 100%;
}

/* زر العودة للصفحة الرئيسية */
.back-to-home {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.back-to-home:hover {
    background: var(--text-white);
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: var(--brand-purple);
}

.back-to-home i {
    font-size: 1.1rem;
    transition: transform var(--transition-normal);
}

.back-to-home:hover i {
    transform: translateX(5px);
}

/* ===========================
   5. PREMIUM CARD
   =========================== */
.premium-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xxl);
    box-shadow: var(--shadow-premium);
    overflow: hidden;
    transform: translateY(0);
    transition: all var(--transition-bounce);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.premium-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

/* ===========================
   6. CARD HEADER
   =========================== */
.card-header-premium {
    background: var(--bg-premium);
    padding: var(--spacing-xxl) var(--spacing-xl) var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

/* شكل هندسي متحرك في الخلفية */
.card-header-premium::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 50%;
    top: -150px;
    right: -100px;
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.1; 
    }
    50% { 
        transform: scale(1.2); 
        opacity: 0.2; 
    }
}

/* الأيقونة الرئيسية */
.header-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-yellow));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
    position: relative;
    z-index: 2;
    animation: iconBounce 2s infinite ease-in-out;
}

@keyframes iconBounce {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    25% { 
        transform: translateY(-10px) rotate(-5deg); 
    }
    75% { 
        transform: translateY(-5px) rotate(5deg); 
    }
}

.header-icon i {
    font-size: 40px;
    color: var(--text-white);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.header-title {
    font-family: 'Tajawal', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-white);
    text-align: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-size: 1rem;
    position: relative;
    z-index: 2;
}

/* ===========================
   7. CARD BODY
   =========================== */
.card-body-premium {
    padding: var(--spacing-xl);
}

/* ===========================
   8. FORM INPUT GROUPS
   =========================== */
.input-group {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

/* Floating Label */
.floating-label {
    position: absolute;
    top: 50%;
    right: var(--spacing-md);
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-smooth);
    pointer-events: none;
    background: var(--bg-input);
    padding: 0 var(--spacing-xs);
}

/* Premium Input Field */
.premium-input {
    width: 100%;
    padding: 18px var(--spacing-md);
    padding-right: 50px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-input);
    transition: all var(--transition-normal);
    color: var(--text-primary);
}

.premium-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), var(--shadow-inner);
    background: var(--text-white);
}

/* Floating Label Animation */
.premium-input:focus + .floating-label,
.premium-input:not(:placeholder-shown) + .floating-label {
    top: -12px;
    font-size: 0.85rem;
    color: var(--border-focus);
    font-weight: 600;
}

/* Input Icon */
.input-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all var(--transition-normal);
    pointer-events: none;
}

.premium-input:focus ~ .input-icon {
    color: var(--border-focus);
    transform: translateY(-50%) scale(1.1);
}

/* ===========================
   9. PASSWORD TOGGLE
   =========================== */
.password-toggle {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition-normal);
    z-index: 2;
    padding: var(--spacing-xs);
}

.password-toggle:hover {
    color: var(--border-focus);
    transform: translateY(-50%) scale(1.2);
}

.password-toggle:focus {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===========================
   10. REMEMBER ME ROW
   =========================== */
.remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input {
    display: none;
}

.checkbox-box {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-left: 10px;
    position: relative;
    transition: all var(--transition-smooth);
    background: var(--text-white);
}

.custom-checkbox input:checked + .checkbox-box {
    background: var(--bg-premium);
    border-color: var(--brand-purple);
    transform: rotate(10deg) scale(1.1);
}

.checkbox-box::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: var(--text-white);
    font-size: 12px;
    transition: transform var(--transition-smooth);
}

.custom-checkbox input:checked + .checkbox-box::after {
    transform: translate(-50%, -50%) scale(1);
}

.checkbox-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===========================
   11. FORGOT PASSWORD LINK
   =========================== */
.forgot-link {
    color: var(--brand-purple);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
    position: relative;
}

.forgot-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-purple), var(--brand-purple-dark));
    transition: width var(--transition-normal);
}

.forgot-link:hover {
    color: var(--brand-purple-dark);
}

.forgot-link:hover::after {
    width: 100%;
}

.forgot-link:focus {
    outline: 2px solid var(--brand-purple);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ===========================
   12. PREMIUM BUTTON
   =========================== */
.premium-button {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--bg-premium);
    color: var(--text-white);
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-slow);
    box-shadow: var(--shadow-button);
}

/* Shine Effect */
.premium-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.premium-button:hover::before {
    left: 100%;
}

.premium-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-button-hover);
}

.premium-button:active {
    transform: translateY(-1px) scale(0.98);
}

.premium-button:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 3px;
}

/* Loading State */
.premium-button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.premium-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--text-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* Success State */
.premium-button.success {
    background: linear-gradient(135deg, var(--success-green), var(--success-green-dark));
}

/* ===========================
   13. DIVIDER
   =========================== */
.divider {
    display: flex;
    align-items: center;
    margin: var(--spacing-lg) 0;
    color: var(--text-secondary);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

.divider span {
    padding: 0 var(--spacing-sm);
    font-weight: 600;
}

/* ===========================
   14. SOCIAL BUTTONS
   =========================== */
.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.social-btn {
    padding: var(--spacing-sm);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--text-white);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-social);
}

.social-btn:focus {
    outline: 2px solid var(--brand-purple);
    outline-offset: 2px;
}

.social-btn.google:hover {
    border-color: #EA4335;
    color: #EA4335;
}

.social-btn.apple:hover {
    border-color: #000;
    color: #000;
}

/* ===========================
   15. CARD FOOTER
   =========================== */
.card-footer-premium {
    background: var(--bg-footer);
    padding: 25px var(--spacing-xl);
    text-align: center;
    border-top: 1px solid var(--border-light);
}

.register-link {
    color: var(--text-secondary);
}

.register-link a {
    color: var(--brand-purple);
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.register-link a:hover {
    color: var(--brand-purple-dark);
    text-decoration: underline;
}

.register-link a:focus {
    outline: 2px solid var(--brand-purple);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===========================
   16. ERROR STATES
   =========================== */
.premium-input.error {
    border-color: var(--border-error);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { 
        transform: translateX(0); 
    }
    10%, 30%, 50%, 70%, 90% { 
        transform: translateX(-5px); 
    }
    20%, 40%, 60%, 80% { 
        transform: translateX(5px); 
    }
}

.error-message {
    color: var(--border-error);
    font-size: 0.85rem;
    margin-top: var(--spacing-xs);
    display: none;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premium-input.error ~ .error-message {
    display: block;
}

/* ===========================
   17. RESPONSIVE DESIGN
   =========================== */

/* Tablets */
@media (max-width: 768px) {
    .card-header-premium {
        padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg);
    }
    
    .card-body-premium {
        padding: var(--spacing-lg);
    }
}

/* Mobile Devices */
@media (max-width: 576px) {
    body {
        padding: var(--spacing-sm);
    }
    
    .card-header-premium {
        padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg);
    }

    .header-icon {
        width: 60px;
        height: 60px;
    }

    .header-icon i {
        font-size: 30px;
    }

    .header-title {
        font-size: 1.6rem;
    }

    .card-body-premium {
        padding: var(--spacing-lg) 25px;
    }

    .social-buttons {
        grid-template-columns: 1fr;
    }
    
    .remember-row {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }
}

/* Small Mobile */
@media (max-width: 380px) {
    .header-title {
        font-size: 1.4rem;
    }
    
    .premium-button {
        font-size: 1rem;
        padding: 15px;
    }
}

/* ===========================
   18. ACCESSIBILITY
   =========================== */

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 2px solid var(--brand-purple);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .premium-card {
        border: 2px solid var(--text-primary);
    }
    
    .premium-input {
        border-width: 3px;
    }
}