/* =====================================================
   NEXT — DECORATIVE BACKGROUNDS
   خلفيات بصرية احترافية — بدون صور، بدون مكتبات
   متوافق مع tokens.css و landing.css
   ===================================================== */


/* ═══════════════════════════════════════════════════
   1) DOTS PATTERN — نقاط خفيفة (قابلة لإعادة الاستخدام)
   ═══════════════════════════════════════════════════ */

.bg-dots {
    position: relative;
    isolation: isolate;
}

.bg-dots::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(
        circle at 1px 1px,
        rgba(17, 24, 39, 0.07) 1px,
        transparent 0
    );
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(
        ellipse 75% 65% at 50% 35%,
        #000 35%,
        transparent 100%
    );
    mask-image: radial-gradient(
        ellipse 75% 65% at 50% 35%,
        #000 35%,
        transparent 100%
    );
}


/* ═══════════════════════════════════════════════════
   2) GRID LINES — شبكة رقيقة (بديل dots)
   ═══════════════════════════════════════════════════ */

.bg-grid {
    position: relative;
    isolation: isolate;
}

.bg-grid::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(17, 24, 39, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(17, 24, 39, 0.05) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(
        ellipse 80% 70% at 50% 50%,
        #000 30%,
        transparent 100%
    );
    mask-image: radial-gradient(
        ellipse 80% 70% at 50% 50%,
        #000 30%,
        transparent 100%
    );
}


/* ═══════════════════════════════════════════════════
   3) RADIAL GLOW — هالة زرقاء (قابلة لإعادة الاستخدام)
   ═══════════════════════════════════════════════════ */

.bg-glow-blue {
    position: relative;
    isolation: isolate;
}

.bg-glow-blue::before {
    content: "";
    position: absolute;
    top: -180px;
    right: -120px;
    width: 620px;
    height: 620px;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(29, 78, 216, 0.18) 0%,
        rgba(37, 99, 235, 0.05) 45%,
        transparent 70%
    );
    filter: blur(55px);
    pointer-events: none;
}

/* نسخة معكوسة (على اليسار) */
.bg-glow-blue.bg-glow-left::before {
    right: auto;
    left: -120px;
}

/* نسخة متمركزة (خلف بطاقة) */
.bg-glow-blue.bg-glow-center::before {
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    width: 520px;
    height: 520px;
}


/* ═══════════════════════════════════════════════════
   4) HERO BACKGROUND — dots + توهج ثلاثي الطبقات
   ═══════════════════════════════════════════════════ */

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

/* ─── النقاط ─── */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image: radial-gradient(
        circle at 1px 1px,
        rgba(17, 24, 39, 0.06) 1px,
        transparent 0
    );
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(
        ellipse 70% 55% at 50% 30%,
        #000 30%,
        transparent 100%
    );
    mask-image: radial-gradient(
        ellipse 70% 55% at 50% 30%,
        #000 30%,
        transparent 100%
    );
}

/* ─── التوهج ثلاثي الطبقات ─── */
.hero::after {
    content: "";
    position: absolute;
    top: -260px;
    right: -140px;
    width: 720px;
    height: 720px;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    background:
        radial-gradient(
            circle at 65% 35%,
            rgba(29, 78, 216, 0.22) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 35% 65%,
            rgba(96, 165, 250, 0.12) 0%,
            transparent 55%
        ),
        radial-gradient(
            circle at 50% 50%,
            rgba(37, 99, 235, 0.08) 0%,
            transparent 70%
        );
    filter: blur(55px);
}


/* ═══════════════════════════════════════════════════
   5) ASSESSMENT — glow خلف البطاقة
   ═══════════════════════════════════════════════════ */

.assessment-visual {
    position: relative;
    isolation: isolate;
}

.assessment-visual::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    width: 115%;
    height: 115%;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        rgba(37, 99, 235, 0.12) 0%,
        rgba(37, 99, 235, 0.03) 45%,
        transparent 70%
    );
    filter: blur(45px);
}


/* ═══════════════════════════════════════════════════
   6) TRUST SECTION — توهجات أزرق على خلفية داكنة
   ═══════════════════════════════════════════════════ */

.trust-section {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.trust-section::before {
    content: "";
    position: absolute;
    top: -200px;
    left: -150px;
    width: 780px;
    height: 780px;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(
        circle,
        rgba(37, 99, 235, 0.24) 0%,
        rgba(37, 99, 235, 0.06) 40%,
        transparent 70%
    );
    filter: blur(70px);
}

.trust-section::after {
    content: "";
    position: absolute;
    bottom: -240px;
    right: -180px;
    width: 620px;
    height: 620px;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(
        circle,
        rgba(37, 99, 235, 0.16) 0%,
        rgba(37, 99, 235, 0.03) 40%,
        transparent 70%
    );
    filter: blur(65px);
}


/* ═══════════════════════════════════════════════════
   7) CTA SECTION — glow خلف البطاقة النهائية
   ═══════════════════════════════════════════════════ */

.cta-section {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.cta-section::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    width: 900px;
    height: 500px;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        rgba(37, 99, 235, 0.12) 0%,
        rgba(37, 99, 235, 0.03) 40%,
        transparent 70%
    );
    filter: blur(60px);
}


/* ═══════════════════════════════════════════════════
   8) SECTION HEADING — خط علوي متدرج (اختياري)
   ═══════════════════════════════════════════════════ */

.section-border-glow {
    position: relative;
}

.section-border-glow::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(65%, 900px);
    height: 1px;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(37, 99, 235, 0.35),
        transparent
    );
}


/* ═══════════════════════════════════════════════════
   9) FIXES — ضمان تطبيق الخلفيات على كل الأقسام
   ═══════════════════════════════════════════════════ */

.section,
.assessment-section,
.cta-section,
.trust-section,
.hero {
    position: relative;
}


/* ═══════════════════════════════════════════════════
   10) RESPONSIVE — تصغير الأحجام على الشاشات الصغيرة
   ═══════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .hero::after {
        width: 520px;
        height: 520px;
        top: -180px;
        right: -100px;
    }

    .trust-section::before,
    .trust-section::after {
        opacity: 0.7;
    }

    .cta-section::before {
        width: 640px;
        height: 380px;
    }

    .bg-glow-blue::before {
        width: 480px;
        height: 480px;
    }
}

@media (max-width: 640px) {
    .hero::after {
        width: 400px;
        height: 400px;
        top: -140px;
        right: -80px;
        opacity: 0.9;
    }

    .hero::before {
        background-size: 22px 22px;
    }

    .cta-section::before {
        width: 460px;
        height: 280px;
        opacity: 0.75;
    }

    .trust-section::before,
    .trust-section::after {
        opacity: 0.5;
    }

    .bg-dots::before,
    .bg-grid::before {
        opacity: 0.65;
    }

    .assessment-visual::before {
        filter: blur(35px);
    }
}


/* ═══════════════════════════════════════════════════
   11) REDUCED MOTION — احترام تفضيل المستخدم
   ═══════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    /* الخلفيات ثابتة أصلًا — لا حركة فيها.
       نحتفظ بها لكن بشفافية أعلى قليلاً للتقليل البصري. */
    .hero::after,
    .trust-section::before,
    .trust-section::after,
    .cta-section::before,
    .assessment-visual::before {
        opacity: 0.85;
    }
}