/* stylecf.css - الإصدار الكامل المعدل */
:root {
    --bg0: #FFFFFF;
    --bg1: #F8FAFC;
    --stroke: rgba(30, 41, 59, 0.12);
    --text: #334155;
    --muted: #64748B;
    --primary: #0F172A;
    --primary-rgb: 15, 23, 42;
    --accent: #475569;
    --accent-light: rgba(71, 85, 105, 0.1);
    --whatsapp: #25d366;
    --shadow: 0 18px 60px rgba(15, 23, 42, 0.08);
    --radius: 16px;
    --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Tajawal", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: linear-gradient(180deg, var(--bg0), var(--bg1));
    color: var(--text);
    line-height: 1.9;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* تم تعديل الحاوية لدعم الحواف الآمنة */
.container { 
    max-width: var(--container); 
    margin: 0 auto; 
    padding: 0 18px;
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
}

.skip {
    position: absolute; right: 14px; top: 10px;
    background: var(--primary); color: #fff; padding: 10px 14px;
    border-radius: 12px; transform: translateY(-140%); transition: .2s; z-index: 9999;
}
.skip:focus { transform: translateY(0); outline: none; }

header {
    position: sticky; top: 0; z-index: 1000;
    backdrop-filter: blur(10px); background: rgba(255, 255, 255, .85);
    border-bottom: 1px solid var(--stroke);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 240px; }

.logo {
    width: auto; height: 46px; padding: 6px 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 14px; background: #fff;
    border: 1px solid var(--stroke);
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05);
}
.logo-img {
    height: 32px; width: auto; max-width: 220px;
    object-fit: contain; display: block;
}
.brand p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.2; font-weight: 700; }

nav ul { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; align-items: center; }
.link {
    color: var(--muted); padding: 10px 12px; border-radius: 12px;
    border: 1px solid transparent; transition: .2s; font-weight: 900; font-size: .95rem;
}
.link:hover { color: var(--text); background: rgba(15, 23, 42, .04); }
.link.active {
    color: var(--primary); background: var(--accent-light);
    border-color: rgba(71, 85, 105, 0.2);
}

.actions { display: flex; align-items: center; gap: 10px; }
.btn {
    border: 1px solid var(--stroke); background: #fff; color: var(--text);
    padding: 10px 14px; border-radius: 12px; font-weight: 900;
    cursor: pointer; transition: .2s; display: inline-flex; align-items: center;
    gap: 10px; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); background: rgba(15, 23, 42, .03); }
.btn.primary {
    background: linear-gradient(135deg, #334155, #0f172a);
    border: 1px solid #1e293b; color: #fff;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.2);
}
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 12px 35px rgba(15, 23, 42, 0.3); }

.hamburger {
    display: none; width: 46px; height: 46px; border-radius: 12px;
    border: 1px solid var(--stroke); background: #fff; cursor: pointer;
    align-items: center; justify-content: center;
}
.hamburger span { width: 18px; height: 2px; background: var(--text); display: block; position: relative; }
.hamburger span::before, .hamburger span::after {
    content: ""; position: absolute; right: 0; width: 18px; height: 2px; background: var(--text);
}
.hamburger span::before { top: -6px; } .hamburger span::after { top: 6px; }

/* تحسين القائمة المنسدلة */
.mobile { 
    display: none; 
    border-top: 1px solid var(--stroke); 
    padding: 10px 0 16px; 
    background-color: #fff; /* خلفية بيضاء واضحة */
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
}
.mobile a { 
    display: block; 
    padding: 12px 18px;
    border-bottom: 1px solid var(--bg1);
}

section { padding: 78px 0; }
.hero { padding: 72px 0 46px; }
.hero-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 22px; align-items: stretch; }

.hero-card {
    border: 1px solid #334155;
    background-color: #0f172a;
    background-image:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(255,255,255,0.05) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: animatedBackground 60s linear infinite;
    border-radius: calc(var(--radius) + 6px);
    box-shadow: var(--shadow);
    padding: 32px; position: relative; overflow: hidden; color: #fff;
}
@keyframes animatedBackground {
    from { background-position: 0 0; }
    to { background-position: 100% 100%; }
}

.kicker {
    display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(5px); border-radius: 999px; color: #e2e8f0; font-weight: 900; font-size: .9rem;
}
.kicker b { color: #fff; }
.hero h2 { margin: 18px 0 14px; font-size: 2.5rem; line-height: 1.25; font-weight: 1000; letter-spacing: .2px; color: #fff; }
.hero h2 span { color: #cbd5e1; text-decoration: underline; text-decoration-color: rgba(203, 213, 225, 0.3); }
.hero p { margin: 0 0 24px; color: #94a3b8; font-size: 1.1rem; max-width: 90%; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.stat {
    border: 1px solid rgba(255, 255, 255, .15); background: rgba(15, 23, 42, .3);
    backdrop-filter: blur(5px); border-radius: 16px; padding: 14px 16px;
}
.stat .n { font-size: 1.15rem; font-weight: 1000; color: #fff; margin-bottom: 4px; }
.stat .t { color: #94a3b8; font-weight: 800; font-size: .9rem; }

.hero-side {
    border: 1px solid var(--stroke); background: #fff;
    border-radius: calc(var(--radius) + 6px); padding: 22px; box-shadow: var(--shadow);
}
.badge-grid { display: grid; grid-template-columns: 1fr; gap: 10px; height: 100%; }
.badge {
    display: flex; gap: 12px; align-items: flex-start;
    border: 1px solid var(--stroke); background: var(--bg1);
    border-radius: 16px; padding: 14px;
}
.ico {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    border: 1px solid var(--stroke); background: #fff; flex: 0 0 auto; color: var(--text);
}
.ico svg { width: 22px; height: 22px; opacity: .8; }
.badge h3 { margin: 0; font-size: 1rem; font-weight: 1000; }
.badge p { margin: 4px 0 0; color: var(--muted); font-weight: 800; font-size: .95rem; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 1.85rem; font-weight: 1000; color: var(--primary); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.card {
    border: 1px solid var(--stroke); background: #fff; border-radius: var(--radius);
    padding: 20px; transition: .3s; box-shadow: 0 10px 30px rgba(0,0,0,.04);
    display: flex; flex-direction: column;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0,0,0,.08);
    border-color: var(--accent);
}

.card-anim-container {
    width: 100%;
    height: 180px;
    background: var(--bg1);
    border-radius: 14px;
    margin-bottom: 18px;
    border: 1px solid var(--stroke);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    color: var(--accent);
}
.card-anim-container svg {
    width: 100px; height: 100px; opacity: 0.8;
}

.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--stroke); background: var(--bg1);
    border-radius: 999px; padding: 6px 10px; font-weight: 1000;
    color: var(--muted); font-size: .85rem; white-space: nowrap;
}
.pill.ok {
    border-color: rgba(71, 85, 105, 0.3);
    background: rgba(71, 85, 105, 0.1);
    color: #334155;
}

.card h3 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 1000; color: var(--primary); }
.card p { margin: 0 0 12px; color: var(--muted); font-weight: 800; flex-grow: 1; }
.list { margin: 0; padding: 0 18px 0 0; }
.list li { color: var(--muted); font-weight: 800; margin: 6px 0; font-size: .95rem; }

.footer-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.mini {
    padding: 9px 12px; border-radius: 12px; border: 1px solid var(--stroke);
    background: #fff; font-weight: 1000; cursor: pointer; transition: .2s;
    display: inline-flex; gap: 8px; align-items: center; color: var(--muted);
}
.mini:hover { background: var(--bg1); color: var(--text); }
.mini.primary {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--primary);
}
.mini.primary:hover { background: rgba(71, 85, 105, 0.2); }

details {
    border: 1px solid var(--stroke); background: var(--bg1);
    border-radius: 14px; padding: 10px 12px; margin-top: 12px;
}
summary { cursor: pointer; font-weight: 1000; color: var(--text); list-style: none; }
summary::-webkit-details-marker { display: none; }

.partners { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 10px; }
.partner {
    border: 1px solid var(--stroke); background: #fff; border-radius: 16px;
    padding: 15px; text-align: center; transition: .2s; display: flex;
    align-items: center; justify-content: center; height: 85px;
}
.partner img {
    max-width: 80%; max-height: 45px; width: auto; height: auto;
    transition: .3s;
}
.partner:hover { transform: translateY(-3px); border-color: var(--accent); }
.partner:hover img { transform: scale(1.05); }

.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; align-items: stretch; }
.form { display: grid; gap: 12px; }
.input, textarea, select {
    width: 100%; border-radius: 14px; border: 1px solid var(--stroke);
    background: #fff; color: var(--text); padding: 14px; font-family: inherit;
    font-weight: 900; outline: none; transition: .2s;
}
.input:focus, textarea:focus, select:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
textarea { min-height: 140px; resize: vertical; }
.hint { color: var(--muted); font-weight: 800; font-size: .95rem; margin-top: 8px; }

/* === تحسين زر الواتساب === */
.wa-float {
    position: fixed;
    /* ضمان الظهور فوق شريط التنقل السفلي */
    bottom: max(25px, calc(env(safe-area-inset-bottom) + 25px));
    left: 25px;
    z-index: 2147483647; /* أقصى قيمة ممكنة */
    width: 60px;
    height: 60px;
    background: var(--whatsapp);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
    transition: .3s;
    -webkit-transform: translateZ(0); /* لإصلاح مشاكل العرض في بعض المتصفحات */
}
.wa-float:hover { transform: scale(1.05); }
.wa-float svg { width: 32px; height: 32px; fill: #fff; }

.site-footer { background: #fff; border-top: 1px solid var(--stroke); padding: 40px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.5fr; gap: 24px; align-items: start; }
.f-col h4 { margin: 0 0 16px; font-size: 1.1rem; font-weight: 1000; color: var(--primary); }
.footer-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.footer-brand img { height: 36px; width: auto; display: block; filter: grayscale(100%); opacity: 0.9; }
.footer-sub { color: var(--muted); font-weight: 800; font-size: .92rem; }
.footer-desc { margin: 0; color: var(--muted); font-weight: 800; font-size: .95rem; line-height: 1.8; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: var(--muted); font-weight: 900; transition: .2s; }
.footer-links a:hover { color: var(--primary); transform: translateX(-3px); }
.legal-box {
    border: 1px solid var(--stroke); background: var(--bg1); border-radius: 16px; padding: 18px;
}
.legal-badge {
    display: inline-block; padding: 6px 12px; border-radius: 999px;
    background: rgba(15, 23, 42, 0.08); border: 1px solid rgba(15, 23, 42, 0.1);
    color: var(--primary); font-weight: 1000; font-size: .85rem; margin-bottom: 12px;
}
.legal-list { margin: 0; padding: 0 18px 0 0; color: var(--muted); font-weight: 900; }
.legal-list li { margin: 8px 0; }
.footer-bottom {
    margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--stroke);
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    color: var(--muted); font-weight: 900; font-size: .9rem;
}

@keyframes spin-slow { 100% { transform: rotate(360deg); } }
@keyframes pulse-slow { 0%, 100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes scan-line { 0% { transform: translateY(-20%); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(120%); opacity: 0; } }
@keyframes dash-flow { to { stroke-dashoffset: 0; } }

.anim-spin { animation: spin-slow 10s linear infinite; transform-origin: center; }
.anim-pulse { animation: pulse-slow 3s ease-in-out infinite; }
.anim-float { animation: float-y 4s ease-in-out infinite; }
.anim-scan { animation: scan-line 3s linear infinite; }

@media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; }
    .grid { grid-template-columns: 1fr 1fr; }
    .partners { grid-template-columns: repeat(3, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    nav ul { display: none; }
    .hamburger { display: flex; }
    .brand { min-width: auto; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

/* تنسيق خاص للشاشات الصغيرة جداً لضمان عدم تغطية المحتوى */
@media (max-width: 560px) {
    .grid { grid-template-columns: 1fr; }
    .hero h2 { font-size: 2rem; }
    .stats { grid-template-columns: 1fr; }
    .footer-brand img, .logo-img { max-width: 160px; }
    
    /* تحسين الشركاء */
    .partners { grid-template-columns: repeat(2, 1fr); }
    
    /* تحسين أيقونة الواتساب */
    .wa-float { 
        width: 55px; 
        height: 55px; 
        left: 20px;
        bottom: max(20px, calc(env(safe-area-inset-bottom) + 20px));
    }
    .wa-float svg { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .card:hover, .btn:hover, .partner:hover, .wa-float:hover { transform: none; }
    .hero-card, .anim-spin, .anim-pulse, .anim-float, .anim-scan { animation: none !important; }
}