/**
 * 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);
}
