﻿/*
 * auth.css
 * أنماط موحدة لصفحات المصادقة (تسجيل الدخول والتسجيل)
 * يستخدم متغيرات الألوان والظلال من ملف CSS الأساسي.
 */

/* ----------------------------------------------------- */
/* 1. المتغيرات الأساسية (ضرورية لعمل الوضع الليلي) */
/* ----------------------------------------------------- */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --accent-primary: #0ea5e9;
    --accent-hover: #0284c7;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12);
    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Navbar variables (from navbar-unified.css) */
    --navbar-bg-light: rgba(255, 255, 255, 0.8);
    --navbar-bg-dark: rgba(15, 23, 42, 0.8);
    --navbar-border-light: #e2e8f0;
    --navbar-border-dark: #334155;
    --navbar-text-light: #0f172a;
    --navbar-text-dark: #f1f5f9;
    --navbar-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --navbar-shadow-dark: 0 4px 12px rgba(0, 0, 0, 0.4);
    
    /* Default to light mode for navbar */
    --current-navbar-bg: rgba(255, 255, 255, 0.8);
    --current-navbar-border: #e2e8f0;
    --current-navbar-text: #0f172a;
    --current-navbar-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --current-navbar-shadow-dark: 0 4px 12px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --accent-primary: #0ea5e9;
    --accent-hover: #38bdf8;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);
    
    /* Navbar dark mode variables */
    --current-navbar-bg: rgba(15, 23, 42, 0.8);
    --current-navbar-border: #334155;
    --current-navbar-text: #f1f5f9;
    --current-navbar-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ----------------------------------------------------- */
/* 2. الأنماط الأساسية لهيكل الصفحة */
/* ----------------------------------------------------- */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

.auth-page-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    margin-top: 70px;
    background-color: var(--bg-secondary);
}

/* ----------------------------------------------------- */
/* 3. بطاقة النموذج (Form Card) */
/* ----------------------------------------------------- */

.auth-card {
    width: 100%;
    max-width: 420px; /* يمكن زيادته للتسجيل إذا لزم الأمر */
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    /* استخدام keyframes من ملف landing.css */
    animation: fadeInUp 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .auth-header h2 {
        font-size: 2rem;
        font-weight: 800;
        margin: 0;
        /* تطبيق تدرج اللون على العنوان */
        background: var(--gradient-primary);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

/* ----------------------------------------------------- */
/* 4. تصميم حقول النموذج (Inputs, Select) */
/* ----------------------------------------------------- */

.form-group-custom {
    margin-bottom: 1.5rem;
}

    .form-group-custom input[type="text"],
    .form-group-custom input[type="password"],
    .form-group-custom input[type="email"],
    .form-group-custom input[type="tel"],
    .form-group-custom select {
        width: 100%;
        padding: 1rem 1.25rem;
        border: 2px solid var(--border-color);
        border-radius: 12px;
        background-color: var(--bg-primary);
        color: var(--text-primary);
        font-size: 1rem;
        font-family: 'Cairo', sans-serif;
        transition: var(--transition);
    }

        /* نمط التركيز المشترك */
        .form-group-custom input:focus,
        .form-group-custom select:focus {
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
            outline: none;
        }

    /* نمط عنصر Select لتحسين المظهر وإزالة مظهر المتصفح الافتراضي */
    .form-group-custom select {
        appearance: none;
        /* أيقونة سهم لأسفل - تم ترميزها كـ SVG بلون النص الثلاثي */
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3e%3cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.25 4.25a.75.75 0 01-1.06 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd' /%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: left 1.25rem center; /* وضع الأيقونة على اليسار */
        padding-left: 2.5rem; /* إزاحة النص لإفساح المجال للأيقونة */
    }

/* 5. الأخطاء والرسائل الإضافية */
.text-danger {
    font-size: 0.875rem;
    color: #ef4444; /* أحمر ثابت للأخطاء */
    display: block;
    margin-top: 0.5rem;
}

.form-options {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.checkbox-inline span {
    color: var(--text-secondary);
    font-weight: 500;
}

/* 6. تنبيهات الأخطاء (Alerts) */
.alert-custom {
    background-color: #fee2e2; /* light red/pink */
    color: #991b1b; /* dark red text */
    border: 1px solid #fca5a5;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

[data-theme="dark"] .alert-custom {
    background-color: #450a0a; /* dark red background */
    color: #fecaca; /* lighter red text */
    border-color: #7f1d1d;
}

/* 7. زر الإرسال */
.btn-auth-primary {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1.1rem;
    background: var(--gradient-primary); /* تدرج لوني */
    color: white;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
    display: block; /* لضمان أخذ العرض الكامل */
    font-family: 'Cairo', sans-serif;
}

    .btn-auth-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

/* 8. تذييل النموذج (Footer) */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

    .auth-footer a {
        color: var(--accent-primary);
        text-decoration: none;
        font-weight: 700;
        margin-right: 0.5rem;
        transition: var(--transition);
    }

        .auth-footer a:hover {
            color: var(--accent-hover);
            text-decoration: underline;
        }

/* 9. الأنميشن (يجب أن يكون في ملف CSS أساسي، لكن يتم تكراره هنا للكمال) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 10. الاستجابة (Responsive) */
@media (max-width: 500px) {
    .auth-card {
        padding: 1.5rem;
    }

    .auth-header h2 {
        font-size: 1.75rem;
    }

    .auth-page-container {
        margin-top: 60px;
        padding: 1rem;
    }
}


/* ----------------------------------------------------- */
/* 3. بطاقة النموذج (Form Card) */
/* ----------------------------------------------------- */

.auth-card {
    width: 100%;
    max-width: 420px; /* يمكن زيادته للتسجيل إذا لزم الأمر */
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    /* استخدام keyframes من ملف landing.css */
    animation: fadeInUp 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .auth-header h2 {
        font-size: 2rem;
        font-weight: 800;
        margin: 0;
        /* تطبيق تدرج اللون على العنوان */
        background: var(--gradient-primary);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

/* ----------------------------------------------------- */
/* 4. تصميم حقول النموذج (Inputs, Select) */
/* ----------------------------------------------------- */

.form-group-custom {
    margin-bottom: 1.5rem;
}

    .form-group-custom input[type="text"],
    .form-group-custom input[type="password"],
    .form-group-custom input[type="email"],
    .form-group-custom input[type="tel"],
    .form-group-custom select {
        width: 100%;
        padding: 1rem 1.25rem;
        border: 2px solid var(--border-color);
        border-radius: 12px;
        background-color: var(--bg-primary);
        color: var(--text-primary);
        font-size: 1rem;
        font-family: 'Cairo', sans-serif;
        transition: var(--transition);
    }

        /* نمط التركيز المشترك */
        .form-group-custom input:focus,
        .form-group-custom select:focus {
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
            outline: none;
        }

    /* نمط عنصر Select لتحسين المظهر وإزالة مظهر المتصفح الافتراضي */
    .form-group-custom select {
        appearance: none;
        /* أيقونة سهم لأسفل - تم ترميزها كـ SVG بلون النص الثلاثي */
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3e%3cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.25 4.25a.75.75 0 01-1.06 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd' /%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: left 1.25rem center; /* وضع الأيقونة على اليسار */
        padding-left: 2.5rem; /* إزاحة النص لإفساح المجال للأيقونة */
    }

/* 5. الأخطاء والرسائل الإضافية */
.text-danger {
    font-size: 0.875rem;
    color: #ef4444; /* أحمر ثابت للأخطاء */
    display: block;
    margin-top: 0.5rem;
}

.form-options {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.checkbox-inline span {
    color: var(--text-secondary);
    font-weight: 500;
}

/* 6. تنبيهات الأخطاء (Alerts) */
.alert-custom {
    background-color: #fee2e2; /* light red/pink */
    color: #991b1b; /* dark red text */
    border: 1px solid #fca5a5;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

[data-theme="dark"] .alert-custom {
    background-color: #450a0a; /* dark red background */
    color: #fecaca; /* lighter red text */
    border-color: #7f1d1d;
}

/* 7. زر الإرسال */
.btn-auth-primary {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1.1rem;
    background: var(--gradient-primary); /* تدرج لوني */
    color: white;
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
    display: block; /* لضمان أخذ العرض الكامل */
    font-family: 'Cairo', sans-serif;
}

    .btn-auth-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

/* 8. تذييل النموذج (Footer) */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

    .auth-footer a {
        color: var(--accent-primary);
        text-decoration: none;
        font-weight: 700;
        margin-right: 0.5rem;
        transition: var(--transition);
    }

        .auth-footer a:hover {
            color: var(--accent-hover);
            text-decoration: underline;
        }

/* 9. الأنميشن (يجب أن يكون في ملف CSS أساسي، لكن يتم تكراره هنا للكمال) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 10. الاستجابة (Responsive) */
@media (max-width: 500px) {
    .auth-card {
        padding: 1.5rem;
    }

    .auth-header h2 {
        font-size: 1.75rem;
    }
}
