/*
 * التنسيق كله بخصائص منطقية (inline-start/end) لا يمين ويسار: ملف واحد يخدم العربية
 * والإنجليزية، ولا ملف rtl ثانٍ ينسى أحدٌ تحديثه مع الأول.
 */

:root {
    --teal: #2f8fd3;
    --purple: #0a2d53;
    --amber: #ffac00;
    --rose: #d6336c;

    --bg: #ffffff;
    --bg-alt: #f6f7fb;
    --surface: #ffffff;
    --text: #222b3c;
    --muted: #57647c;
    --border: #e6e9f0;
    --shadow: 0 10px 30px rgba(34, 43, 60, .08);
    --grad: linear-gradient(135deg, var(--purple), #5ca9df);
    --radius: 14px;
}

/* الداكن يأتي من تفضيل النظام ما لم يختر الزائر صراحةً، واختياره يغلب في الاتجاهين. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1420;
        --bg-alt: #151b2b;
        --surface: #1a2135;
        --text: #eef1f7;
        --muted: #a3aec4;
        --border: #28314a;
        --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    }
}
:root[data-theme="dark"] {
    --bg: #0f1420;
    --bg-alt: #151b2b;
    --surface: #1a2135;
    --text: #eef1f7;
    --muted: #a3aec4;
    --border: #28314a;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
    margin: 0;
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.35; font-weight: 800; }
h1 b, h2 b, h3 b {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
p { margin: 0 0 1em; color: var(--muted); }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.ico { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 28px; border-radius: 999px; border: 2px solid transparent;
    font: inherit; font-weight: 700; cursor: pointer;
    transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(10, 45, 83, .25); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- الترويسة ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); box-shadow: 0 1px 0 var(--border); }
.topbar { background: var(--grad); color: #fff; font-size: 14px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 6px; }
.topbar a { text-decoration: underline; }
.topbar-info { display: flex; gap: 22px; }
.topbar-info li { display: flex; align-items: center; gap: 6px; }
.topbar-info a { text-decoration: none; }

.navbar-inner { display: flex; align-items: center; gap: 24px; padding-block: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; }
/* خلفية الشعار بيضاء في ملفه، فيوضع على رقعة بيضاء أينما كان السطح داكناً بدل مربع أبيض حادّ. */
.logo img { display: block; height: 48px; width: auto; background: #fff; border-radius: 10px; padding: 2px 8px; }
.nav-links { display: flex; gap: 26px; margin-inline: auto; font-weight: 600; }
.nav-links a { position: relative; padding-block: 6px; }
.nav-links a::after {
    content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px;
    background: var(--teal); transform: scaleX(0); transition: transform .2s;
}
.nav-links a:hover { color: var(--teal); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 42px; min-width: 42px; padding: 0 12px;
    justify-content: center; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
}
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin-block: 4px; }

/* ---------- الواجهة ---------- */
.hero { position: relative; padding-block: 80px 40px; background: var(--bg-alt); overflow: hidden; }
.hero-shape { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .28; pointer-events: none; }
.hero-shape-1 { width: 420px; height: 420px; background: var(--purple); top: -140px; inset-inline-end: -100px; }
.hero-shape-2 { width: 340px; height: 340px; background: var(--teal); bottom: -120px; inset-inline-start: -80px; }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4.2vw, 52px); }
.hero-content p { font-size: 18px; max-width: 560px; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

.hero-art { position: relative; min-height: 400px; }
.mock { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.mock-main { inset-block-start: 20px; inset-inline-start: 8%; width: 68%; padding: 18px; animation: float 6s ease-in-out infinite; }
.mock-head { display: flex; gap: 6px; margin-bottom: 14px; }
.mock-head i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock-head i:first-child { background: var(--rose); }
.mock-head i:nth-child(2) { background: var(--amber); }
.mock-head i:nth-child(3) { background: var(--teal); }
.mock-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.mock-pill { background: var(--grad); color: #fff; padding: 2px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.mock-num { color: var(--muted); font-size: 13px; }
.mock-lines i { display: block; height: 10px; width: var(--w); border-radius: 6px; background: var(--bg-alt); margin-bottom: 10px; }
.mock-total { display: flex; justify-content: space-between; border-top: 1px dashed var(--border); padding-top: 12px; font-weight: 700; }
.mock-total b { color: var(--teal); font-size: 20px; }
.mock-status { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--teal); font-size: 14px; font-weight: 700; }
.mock-chat { inset-block-end: 10px; inset-inline-end: 0; width: 58%; padding: 14px; animation: float 7s ease-in-out -2s infinite; }
.bubble { padding: 8px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6; margin-bottom: 8px; width: fit-content; max-width: 92%; }
.bubble-in { background: var(--bg-alt); }
.bubble-out { background: var(--grad); color: #fff; margin-inline-start: auto; margin-bottom: 0; }
.mock-chip { inset-block-start: 0; inset-inline-end: 4%; display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-weight: 700; font-size: 14px; color: var(--amber); animation: float 5s ease-in-out -1s infinite; }
.mock-chip span { color: var(--text); }
@keyframes float { 50% { transform: translateY(-10px); } }

.hero-strip { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 36px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); color: var(--muted); font-weight: 700; font-size: 17px; }

/* ---------- الأقسام ---------- */
.section { padding-block: 90px; }
.section-alt { background: var(--bg-alt); }
.section-title { max-width: 720px; margin: 0 auto 50px; text-align: center; }
.section-title h2 { font-size: clamp(24px, 3vw, 36px); }
.grid { display: grid; gap: 26px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.icon-box { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; margin-bottom: 20px; }
.feature-card, .service-card, .step-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 30px 26px; transition: transform .25s, box-shadow .25s;
}
.feature-card:hover, .service-card:hover, .step-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.feature-card h3, .service-card h3, .step-card h3 { font-size: 19px; }
.feature-card p, .service-card p, .step-card p { margin: 0; font-size: 15px; }
.feature-card { text-align: center; }
.feature-card .icon-box { margin-inline: auto; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.c-teal { --c: var(--teal); } .c-amber { --c: var(--amber); } .c-purple { --c: #5ca9df; } .c-rose { --c: var(--rose); }

.service-card { position: relative; overflow: hidden; }
.service-card::before { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--grad); transform: scaleX(0); transition: transform .3s; }
.service-card:hover::before { transform: scaleX(1); }
.service-card .icon-box { background: var(--grad); color: #fff; }

.feat-list { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 14px; }
.feat-list li { position: relative; padding-inline-start: 18px; margin-bottom: 6px; line-height: 1.6; }
.feat-list li::before { content: ""; position: absolute; inset-inline-start: 0; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.split-content h3 { font-size: clamp(22px, 2.6vw, 32px); }
.eyebrow { display: inline-block; color: var(--teal); font-weight: 700; margin-bottom: 10px; }
.check-list { margin-block: 20px 28px; }
.check-list li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; font-weight: 600; }
.check-list .ico { margin-top: 6px; padding: 3px; border-radius: 50%; background: var(--teal); color: #fff; stroke-width: 3; }

.orbit { position: relative; width: min(100%, 400px); aspect-ratio: 1; margin-inline: auto; border: 2px dashed var(--border); border-radius: 50%; }
.orbit-core { position: absolute; inset: 30%; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; box-shadow: 0 0 0 14px color-mix(in srgb, #5ca9df 22%, transparent); }
.orbit-node { position: absolute; width: 58px; height: 58px; margin: -29px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 22px; color: var(--teal); }
.orbit-node.n1 { top: 0; left: 50%; }
.orbit-node.n2 { top: 25%; left: 93.3%; color: var(--teal); }
.orbit-node.n3 { top: 75%; left: 93.3%; color: var(--amber); }
.orbit-node.n4 { top: 100%; left: 50%; color: var(--teal); }
.orbit-node.n5 { top: 75%; left: 6.7%; }
.orbit-node.n6 { top: 25%; left: 6.7%; color: var(--amber); }

.stack { display: grid; gap: 18px; max-width: 360px; margin-inline: auto; }
.stack-card { display: flex; align-items: center; gap: 14px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); font-weight: 700; }
.stack-card .ico { font-size: 26px; color: var(--teal); }
.stack-card.s2 { margin-inline-start: 40px; }
.stack-card.s2 .ico { color: var(--rose); }
.stack-card.s3 { margin-inline-start: 80px; }
.stack-card.s3 .ico { color: var(--amber); }

.facts { background: var(--grad); color: #fff; padding-block: 56px; text-align: center; }
.fact b { display: block; font-size: 52px; font-weight: 800; line-height: 1.1; }
.fact span { font-weight: 600; opacity: .92; }

.step-card { text-align: center; }
.step-no { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 22px; font-weight: 800; }

.industry { display: flex; align-items: center; gap: 16px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .2s, transform .2s; }
.industry:hover { border-color: var(--teal); transform: translateY(-4px); }
.industry .ico { font-size: 30px; color: var(--teal); }
.industry h3 { margin: 0; font-size: 18px; }

/* خلفية البلاطة بيضاء حتى في المظهر الداكن: الشعارات ملفات بخلفية بيضاء، وعلى سطح داكن تظهر مربعات. */
.clients { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.clients li { display: grid; place-items: center; height: 110px; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); transition: transform .2s, box-shadow .2s; }
/* شعارٌ أبيض الحروف لا يُرى على البلاطة البيضاء، فبلاطته وحدها كحلية. */
.clients li.on-dark { background: #0a2d53; }
.clients li:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.clients img { max-width: 100%; max-height: 78px; object-fit: contain; }
.clients-more { margin: 28px 0 0; text-align: center; color: var(--text); font-weight: 800; font-size: 22px; }

/* ---------- التواصل ---------- */
.cta-inner { max-width: 760px; }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form input, .contact-form select, .contact-form textarea {
    width: 100%; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--surface); color: var(--text); font: inherit;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--teal); border-color: transparent; }
.contact-form .invalid { border-color: var(--rose); }
.contact-form textarea, .contact-form button, .form-note { grid-column: 1 / -1; }
.contact-form button { justify-self: center; }
.form-note { margin: 0; text-align: center; min-height: 1.8em; font-weight: 600; }

/* ---------- زر واتساب ---------- */
.wa-float {
    position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 60;
    display: inline-flex; align-items: center; gap: 10px; height: 56px; padding-inline: 16px 20px;
    border-radius: 999px; background: #25d366; color: #fff; font-weight: 700; font-size: 15px;
    box-shadow: 0 8px 24px rgba(37, 211, 102, .4); transition: transform .2s;
}
.wa-float[hidden] { display: none; }
.wa-float:hover { transform: translateY(-3px); }
.wa-float svg { width: 28px; height: 28px; fill: currentColor; flex: none; }

/* ---------- مساعد المحادثة ---------- */
.chat-demo { max-width: 400px; margin-inline: auto; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.chat-demo .bubble { font-size: 15px; margin-bottom: 12px; }
.chat-demo .bubble:last-child { margin-bottom: 0; }

/* زر المحادثة في الطرف المقابل لزر واتساب: زرّان متراكبان في ركن واحد يحجب أحدهما الآخر على الجوال. */
.chat-fab {
    position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 60;
    display: inline-flex; align-items: center; gap: 10px; height: 56px; padding-inline: 18px 22px;
    border: 0; border-radius: 999px; background: var(--grad); color: #fff; font: inherit; font-weight: 700; font-size: 15px;
    cursor: pointer; box-shadow: 0 8px 24px rgba(10, 45, 83, .35); transition: transform .2s;
}
.chat-fab:hover { transform: translateY(-3px); }
.chat-fab .ico { font-size: 22px; }
.chat-fab[aria-expanded="true"] { display: none; }

.chat-panel {
    position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 70;
    display: flex; flex-direction: column; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 44px));
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--grad); color: #fff; }
.chat-head .ico { font-size: 24px; }
.chat-head div { flex: 1; line-height: 1.4; }
.chat-head small { display: block; font-size: 12px; opacity: .85; }
.chat-head button { border: 0; background: none; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 6px; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-log .bubble { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-log .bubble-error { background: color-mix(in srgb, var(--rose) 12%, transparent); color: var(--rose); }
.chat-log .bubble.typing::after { content: "…"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-form input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; }
.chat-form input:focus { outline: 2px solid var(--teal); border-color: transparent; }
.chat-form .btn { padding: 8px 18px; }
.chat-form .btn:disabled { opacity: .5; cursor: default; transform: none; }

/* ---------- التذييل ---------- */
.site-footer { background: #0f1420; color: #c9d1e3; padding-top: 70px; }
.site-footer p { color: #a3aec4; margin-top: 16px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 40px; }
.site-footer h3 { color: #fff; font-size: 18px; margin-bottom: 18px; }
.site-footer li { margin-bottom: 10px; }
.site-footer a:hover { color: var(--teal); }
.footer-contact li { display: flex; align-items: center; gap: 10px; }
.footer-contact .ico { color: var(--teal); }
.footer-bottom { margin-top: 50px; padding-block: 22px; border-top: 1px solid #28314a; text-align: center; font-size: 14px; }

/* العنصر الخالي من بيانات التواصل يُخفى مع سطره: سطر بأيقونة ولا نص بعدها يبدو عطلاً. */
li:has(> [data-contact]:empty) { display: none; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .mock { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- الشاشات الأصغر ---------- */
@media (max-width: 1100px) {
    .topbar-info { display: none; }
    .topbar-inner { justify-content: center; }
    .nav-toggle { display: block; margin-inline-start: auto; }
    .nav-links {
        display: none; position: absolute; top: 100%; inset-inline: 0; flex-direction: column; gap: 0;
        background: var(--bg); border-top: 1px solid var(--border); box-shadow: var(--shadow); padding: 8px 16px;
    }
    .nav-links.open { display: flex; }
    .nav-links a { display: block; padding-block: 12px; }
    .navbar { position: relative; }
    .nav-actions .btn { display: none; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .clients { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .hero-inner, .split { grid-template-columns: 1fr; }
    .split-reverse .split-art { order: -1; }
    .hero { padding-block: 50px 30px; }
    .hero-art { min-height: 360px; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .section { padding-block: 60px; }
}
@media (max-width: 600px) {
    .grid-4, .grid-3, .grid-2, .contact-form, .footer-grid { grid-template-columns: 1fr; }
    .facts .grid-4 { grid-template-columns: 1fr 1fr; }
    .hero-art { min-height: 430px; }
    .wa-float { width: 56px; padding: 0; justify-content: center; }
    .wa-float span { display: none; }
    .chat-fab { width: 56px; padding: 0; justify-content: center; }
    .chat-fab span { display: none; }
    .chat-panel { bottom: 0; inset-inline: 0; width: 100%; height: min(600px, 100vh); border-radius: 18px 18px 0 0; }
    .clients { grid-template-columns: repeat(2, 1fr); }
    .mock-main { width: 84%; inset-inline-start: 0; }
    .mock-chat { width: 72%; }
    .stack-card.s2 { margin-inline-start: 20px; }
    .stack-card.s3 { margin-inline-start: 40px; }
    .logo img { height: 40px; }
}
