/**
 * Core Engine — ce-style.css
 * أنماط الواجهة الأمامية: نماذج الدخول والتسجيل والاستعادة.
 */

/* ── المتغيرات ─────────────────────────────────────────────────────────────── */
:root {
    --ce-primary:     #2563eb;
    --ce-primary-h:   #1d4ed8;
    --ce-danger:      #dc2626;
    --ce-success:     #16a34a;
    --ce-border:      #e2e8f0;
    --ce-bg:          #f8fafc;
    --ce-text:        #1e293b;
    --ce-muted:       #64748b;
    --ce-radius:      10px;
    --ce-shadow:      0 4px 24px rgba(0,0,0,.08);
}

/* ── الحاوية ────────────────────────────────────────────────────────────────── */
.ce-form-wrap {
    max-width: 460px;
    margin: 40px auto;
    direction: rtl;
}

.ce-form {
    background: #fff;
    border: 1px solid var(--ce-border);
    border-radius: var(--ce-radius);
    padding: 36px 32px;
    box-shadow: var(--ce-shadow);
}

.ce-form-title {
    margin: 0 0 24px;
    font-size: 22px;
    font-weight: 700;
    color: var(--ce-text);
}

/* ── الحقول ─────────────────────────────────────────────────────────────────── */
.ce-field {
    margin-bottom: 18px;
}

.ce-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ce-text);
}

.ce-field input[type="text"],
.ce-field input[type="email"],
.ce-field input[type="password"],
.ce-field input[type="tel"],
.ce-field input[type="url"],
.ce-field input[type="number"],
.ce-field select,
.ce-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ce-border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--ce-text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    direction: rtl;
}

.ce-field input:focus,
.ce-field select:focus,
.ce-field textarea:focus {
    outline: none;
    border-color: var(--ce-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.ce-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ce-field-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ce-required {
    color: var(--ce-danger);
}

/* ── الأزرار ────────────────────────────────────────────────────────────────── */
.ce-btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .1s;
    text-decoration: none;
    text-align: center;
}

.ce-btn-primary {
    background: var(--ce-primary);
    color: #fff;
    width: 100%;
    margin-top: 8px;
}

.ce-btn-primary:hover {
    background: var(--ce-primary-h);
}

.ce-btn-primary:active {
    transform: scale(.98);
}

.ce-btn-outline {
    background: transparent;
    border: 1px solid var(--ce-border);
    color: var(--ce-muted);
}

.ce-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ── التنبيهات والرسائل ─────────────────────────────────────────────────────── */
.ce-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.ce-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.ce-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.ce-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.ce-messages {
    margin-top: 12px;
}

.ce-messages:empty {
    display: none;
}

/* ── التذييل ────────────────────────────────────────────────────────────────── */
.ce-form-footer {
    text-align: center;
    margin: 16px 0 0;
    font-size: 14px;
    color: var(--ce-muted);
}

.ce-link {
    color: var(--ce-primary);
    text-decoration: none;
    font-weight: 600;
}

.ce-link:hover {
    text-decoration: underline;
}

.ce-form-desc {
    color: var(--ce-muted);
    font-size: 14px;
    margin-top: -12px;
    margin-bottom: 20px;
}

/* ── الملف الشخصي ────────────────────────────────────────────────────────────── */
.ce-profile-wrap,
.ce-dashboard-wrap {
    max-width: 800px;
    margin: 0 auto;
    direction: rtl;
}

/* ── الاستجابة ─────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .ce-form {
        padding: 24px 16px;
    }
    .ce-fields-row {
        grid-template-columns: 1fr;
    }
    .ce-field-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ── زر Google ───────────────────────────────────────────────────────────── */
.ce-btn-google {
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    width: 100%;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    transition: background .2s, box-shadow .2s;
}

.ce-btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* ── الفاصل ─────────────────────────────────────────────────────────────── */
.ce-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--ce-muted);
    font-size: 13px;
}

.ce-divider::before,
.ce-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ce-border);
}


/* ════════════════════════════════════════════════════════════════════════════
   الملف الشخصي — ce_profile
   ════════════════════════════════════════════════════════════════════════════ */

.ce-profile-wrap,
.ce-dashboard-wrap {
    max-width: 800px;
    margin: 0 auto;
    direction: rtl;
}

.ce-profile-card {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--ce-border);
    border-radius: var(--ce-radius);
    padding: 28px;
    box-shadow: var(--ce-shadow);
    margin-bottom: 24px;
}

.ce-profile-avatar-wrap {
    flex-shrink: 0;
}

.ce-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ce-border);
    display: block;
}

.ce-profile-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--ce-text);
    margin: 0 0 8px;
}

.ce-profile-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ce-profile-role {
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.ce-profile-status {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.ce-profile-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 16px;
}

.ce-profile-detail {
    font-size: 14px;
    color: var(--ce-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 480px) {
    .ce-profile-card { flex-direction: column; align-items: center; text-align: center; }
    .ce-profile-details { align-items: center; }
}

/* ════════════════════════════════════════════════════════════════════════════
   تعديل الملف الشخصي — ce_edit_profile
   ════════════════════════════════════════════════════════════════════════════ */

.ce-edit-profile-wrap { max-width: 560px; }

.ce-avatar-upload { margin-bottom: 24px; }

/* مؤشر قوة كلمة المرور */
.ce-password-strength {
    margin: 8px 0 12px;
}
.ce-strength-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-bottom: 4px;
    overflow: hidden;
}
.ce-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .3s ease, background .3s ease;
    width: 0;
}
.ce-strength-label {
    font-size: 12px;
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════════════════
   نظام التسجيل المزدوج — Tabs + نموذج المنشأة
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tabs ── */
.ce-reg-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e2e8f0;
}

.ce-reg-tab {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    background: transparent;
}

.ce-reg-tab:hover {
    color: #2563eb;
    background: #f1f5f9;
    text-decoration: none;
}

.ce-reg-tab--active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: transparent;
    cursor: default;
}

/* ── تسمية القسم داخل النموذج ── */
.ce-section-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

/* ── select field ── */
.ce-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat left 14px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    direction: rtl;
}

.ce-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* ── زر كامل العرض ── */
.ce-btn-full {
    width: 100%;
    justify-content: center;
}

/* ── وصف النموذج ── */
.ce-form-desc {
    color: #64748b;
    font-size: 14px;
    margin: -8px 0 20px;
    line-height: 1.6;
}

/* ── نموذج المنشأة — لون مميز للـ header ── */
.ce-business-register-wrap .ce-form-title::before {
    content: '';
}

.ce-business-register-wrap .ce-btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #7c3aed);
}

.ce-business-register-wrap .ce-btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #6d28d9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}
