﻿/* ========================================
   🔐 صفحات المصادقة - Auth Pages
   تنسيق عصري بتقنية الزجاج المصنفر
======================================== */

:root {
    --auth-primary: #6C3CE1;
    --auth-secondary: #00D4FF;
    --auth-accent: #FF6B6B;
    --auth-gold: #FFD93D;
    --auth-gradient: linear-gradient(135deg, #6C3CE1 0%, #00D4FF 50%, #FF6B6B 100%);
    --auth-glass-bg: rgba(255, 255, 255, 0.12);
    --auth-glass-border: rgba(255, 255, 255, 0.18);
    --auth-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    --auth-radius: 24px;
    --auth-transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========================================
   خلفية الصفحة المتحركة
======================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    position: relative;
    overflow: hidden;
    padding: 20px;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
}

/* خلفية متحركة بالتدرجات */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background: linear-gradient(135deg, #6C3CE1, #00D4FF, #FF6B6B, #6C3CE1);
    background-size: 400% 400%;
    animation: gradientMove 15s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* دوائر زخرفية متحركة */
.auth-circle {
    position: fixed;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
    z-index: 0;
}

.auth-circle-1 {
    width: 500px;
    height: 500px;
    top: -200px;
    right: -200px;
    animation: floatCircle 20s ease-in-out infinite;
}

.auth-circle-2 {
    width: 300px;
    height: 300px;
    bottom: -100px;
    left: -100px;
    animation: floatCircle 15s ease-in-out infinite reverse;
}

.auth-circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatCircle 25s ease-in-out infinite;
    background: rgba(108, 60, 225, 0.1);
}

@keyframes floatCircle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* ========================================
   بطاقة الزجاج المصنفر
======================================== */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: var(--auth-glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--auth-glass-border);
    border-radius: var(--auth-radius);
    padding: 48px 40px 40px;
    box-shadow: var(--auth-shadow);
    animation: cardSlideUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes cardSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   الشعار والعنوان
======================================== */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    font-size: 48px;
    background: var(--auth-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulseLogo 2s ease-in-out infinite;
}

@keyframes pulseLogo {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.05) rotate(-5deg);
    }
}

.auth-logo h3 {
    color: #fff;
    font-weight: 800;
    font-size: 24px;
    margin-top: 8px;
    letter-spacing: -0.5px;
}

    .auth-logo h3 span {
        background: var(--auth-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

.auth-title {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-size: 14px;
    margin-bottom: 28px;
}

/* ========================================
   الحقول - Two-Step Flow
======================================== */
.auth-step {
    display: none;
    animation: stepFade 0.5s ease forwards;
}

    .auth-step.active {
        display: block;
    }

@keyframes stepFade {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   المدخلات
======================================== */
.auth-input-group {
    position: relative;
    margin-bottom: 20px;
}

    .auth-input-group .form-control {
        width: 100%;
        padding: 14px 20px 14px 48px;
        background: rgba(255, 255, 255, 0.08);
        border: 2px solid rgba(255, 255, 255, 0.1);
        border-radius: 14px;
        color: #fff;
        font-size: 15px;
        transition: all var(--auth-transition);
        direction: ltr;
    }

        .auth-input-group .form-control:focus {
            background: rgba(255, 255, 255, 0.12);
            border-color: var(--auth-secondary);
            box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.15);
            outline: none;
        }

        .auth-input-group .form-control::placeholder {
            color: rgba(255, 255, 255, 0.35);
        }

        .auth-input-group .form-control.is-invalid {
            border-color: var(--auth-accent);
            box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15);
        }

/* أيقونات الحقول */
.auth-input-icon {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    transition: color var(--auth-transition);
    pointer-events: none;
}

.auth-input-group:focus-within .auth-input-icon {
    color: var(--auth-secondary);
}

/* زر إظهار كلمة المرور */
.auth-password-toggle {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 5px;
    transition: color var(--auth-transition);
    font-size: 16px;
}

    .auth-password-toggle:hover {
        color: rgba(255, 255, 255, 0.7);
    }

/* ========================================
   الأزرار
======================================== */
.auth-btn {
    width: 100%;
    padding: 15px 30px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: var(--auth-gradient);
    background-size: 200% 200%;
    transition: all var(--auth-transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(108, 60, 225, 0.3);
}

    .auth-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 35px rgba(108, 60, 225, 0.5);
        background-position: 100% 100%;
    }

    .auth-btn:active {
        transform: scale(0.97);
    }

    .auth-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none !important;
    }

    /* تأثير تعبئة الزر عند الضغط */
    .auth-btn .btn-fill {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.1);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.6s ease;
        border-radius: 14px;
    }

    .auth-btn:active .btn-fill {
        transform: scaleX(1);
    }

/* ========================================
   الخيارات الإضافية
======================================== */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
}

    .auth-remember input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: var(--auth-secondary);
        cursor: pointer;
        border-radius: 6px;
    }

.auth-forgot {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--auth-transition);
}

    .auth-forgot:hover {
        color: var(--auth-secondary);
    }

/* ========================================
   الروابط السفلية
======================================== */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

    .auth-footer p {
        color: rgba(255, 255, 255, 0.5);
        font-size: 14px;
        margin: 0;
    }

    .auth-footer a {
        color: #fff;
        text-decoration: none;
        font-weight: 600;
        background: var(--auth-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        transition: all var(--auth-transition);
    }

        .auth-footer a:hover {
            opacity: 0.8;
            filter: brightness(1.2);
        }

/* ========================================
   التحقق من صحة الحقول
======================================== */
.auth-validation {
    color: var(--auth-accent);
    font-size: 13px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .auth-validation i {
        font-size: 14px;
    }

/* ========================================
   رسائل التنبيه
======================================== */
.auth-alert {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.auth-alert-danger {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: #ffb3b3;
}

.auth-alert-success {
    background: rgba(0, 210, 160, 0.15);
    border: 1px solid rgba(0, 210, 160, 0.2);
    color: #7ddfc4;
}

.auth-alert i {
    font-size: 18px;
}

/* ========================================
   التقدم (Loading)
======================================== */
.auth-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   تسجيل الدخول بالوسائل الاجتماعية
======================================== */
.auth-social {
    text-align: center;
    margin: 20px 0;
}

.auth-social-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 13px;
}

    .auth-social-divider::before,
    .auth-social-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: rgba(255, 255, 255, 0.06);
    }

.auth-social-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.auth-social-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--auth-transition);
    text-decoration: none;
}

    .auth-social-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-3px);
        color: #fff;
        border-color: rgba(255, 255, 255, 0.15);
    }

/* ========================================
   Responsive
======================================== */
@media (max-width: 576px) {
    .auth-card {
        padding: 32px 20px 28px;
    }

    .auth-title {
        font-size: 22px;
    }

    .auth-logo-icon {
        font-size: 36px;
    }

    .auth-input-group .form-control {
        padding: 12px 16px 12px 40px;
        font-size: 14px;
    }

    .auth-btn {
        padding: 13px 20px;
        font-size: 15px;
    }

    .auth-social-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .auth-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   تنسيق القائمة المنسدلة (Select)
======================================== */
.auth-select {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    transition: all var(--auth-transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.3)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    cursor: pointer;
}

    .auth-select:focus {
        background-color: rgba(255, 255, 255, 0.12);
        border-color: var(--auth-secondary);
        box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.15);
        outline: none;
    }

    .auth-select option {
        background: #1a1a2e;
        color: #fff;
    }

/* ========================================
   رسالة "مرحباً" في Step 2
======================================== */
.auth-welcome {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-align: center;
    margin-bottom: 20px;
}

    .auth-welcome strong {
        color: #fff;
    }
