/* Base Reset and Variables */
:root {
  /* dynamic fonts */
  --font-latin: Inter;
  --font-arabic: Cairo;

  /* defaults (dark) - will be overridden by [data-theme] */
  --bg: #0f172a;        /* slate-900 */
  --bg-alt: #0b1327;    /* deep */
  --panel: #0b1222;     /* panel */
  --text: #e5e7eb;      /* gray-200 */
  --muted: #9ca3af;     /* gray-400 */
  --brand: #1fb6ff;     /* primary */
  --brand-2: #22d3ee;   /* gradient */
  --accent: #a78bfa;    /* accent */
  --success: #22c55e;
  --danger: #ef4444;
  --card: #0f1a33;
  --shadow: rgba(0,0,0,0.35);
  --border: rgba(255,255,255,0.06);
}
html { scroll-behavior: smooth; }

/* THEME MAPS */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #0b1327;
  --panel: #0b1222;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --brand: #1fb6ff;
  --brand-2: #22d3ee;
  --accent: #a78bfa;
  --card: #0f1a33;
  --border: rgba(255,255,255,0.06);
}

[data-theme="light"] {
  --bg: #f8fafc;        /* slate-50 */
  --bg-alt: #ffffff;
  --panel: #ffffff;
  --text: #0f172a;      /* slate-900 */
  --muted: #475569;     /* slate-600 */
  --brand: #2563eb;     /* blue-600 */
  --brand-2: #38bdf8;   /* sky-400 */
  --accent: #7c3aed;    /* violet-700 */
  --card: #ffffff;
  --shadow: rgba(2,6,23,0.15);
  --border: rgba(15,23,42,0.08);
}

[data-theme="corporate"] {
  --bg: #0b1020;
  --bg-alt: #0e1530;
  --panel: #101a3a;
  --text: #e6eef8;
  --muted: #9bb0c7;
  --brand: #0ea5e9;     /* corporate blue */
  --brand-2: #38bdf8;
  --accent: #60a5fa;    /* light blue */
  --card: #0f1a33;
  --border: rgba(255,255,255,0.08);
}

[data-theme="emerald"] {
  --bg: #061a14;
  --bg-alt: #07251b;
  --panel: #0a2a1f;
  --text: #e7fff6;
  --muted: #9ed6c0;
  --brand: #10b981;     /* emerald */
  --brand-2: #34d399;   /* green-400 */
  --accent: #22d3ee;    /* cyan */
  --card: #0c2f23;
  --border: rgba(255,255,255,0.08);
}

[data-theme="royal"] {
  --bg: #0e0a1f;
  --bg-alt: #140f2f;
  --panel: #18123d;
  --text: #efeafe;
  --muted: #beb3e7;
  --brand: #7c3aed;     /* violet */
  --brand-2: #a78bfa;   /* violet-300 */
  --accent: #22d3ee;    /* cyan */
  --card: #1b1650;
  --border: rgba(255,255,255,0.1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--text);
  font-family: var(--font-latin), system-ui, -apple-system, Segoe UI, Roboto, Arial, var(--font-arabic), sans-serif;
  line-height: 1.7;
}

/* Direction utilities */
body.ltr { direction: ltr; }
body.rtl { direction: rtl; }

.en { display: inline; }
.ar { display: none; }
body.rtl .en { display: none; }
body.rtl .ar { display: inline; }

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(120%) blur(10px);
  background: color-mix(in oklab, var(--panel) 70%, transparent);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.25rem;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
}
.logo { height: 36px; width: 36px; }
.brand-text { font-weight: 700; letter-spacing: .2px; }

.top-nav { display: none; gap: 1rem; }
.top-nav .nav-link { color: var(--muted); text-decoration: none; font-weight: 500; }
.top-nav .nav-link:hover { color: var(--text); }
.top-nav .nav-link.active { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }

.header-controls { display: flex; align-items: center; gap: .6rem; }
.theme-controls { display: none; gap: .4rem; align-items: center; }
.select { appearance: none; background: var(--panel); color: var(--text); border: 1px solid var(--border); padding: .4rem .6rem; border-radius: 8px; font: inherit; }
.select:focus { outline: 2px solid color-mix(in oklab, var(--brand) 60%, transparent); border-color: var(--brand-2); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.lang-toggle { display: flex; gap: 6px; background: color-mix(in oklab, var(--panel) 85%, transparent); padding: 4px; border-radius: 999px; border: 1px solid var(--border);} 
.toggle-btn { background: transparent; border: 0; color: var(--muted); padding: 6px 10px; border-radius: 999px; cursor: pointer; font-weight: 700; }
.toggle-btn.active { background: var(--brand); color: #00121d; }
.toggle-btn:hover { color: var(--text); }

/* Mobile menu button */
.mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font-size: 1rem; }
.mobile-menu-btn:hover { border-color: var(--brand-2); }

@media (min-width: 900px) { .top-nav { display: flex; } .theme-controls { display: flex; } }

/* Mobile dropdown nav */
@media (max-width: 899px) {
  .top-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--panel); border-bottom: 1px solid var(--border); padding: .6rem .5rem; display: none; z-index: 40; }
  .top-nav.open { display: grid; grid-auto-rows: minmax(32px, auto); }
  .top-nav .nav-link { padding: .4rem .5rem; border-radius: 8px; }
  .top-nav .nav-link:hover { background: color-mix(in oklab, var(--brand-2) 14%, transparent); }
}

/* Hero */
.hero { padding: 6rem 0 4rem; }
.hero-inner { display: grid; grid-template-columns: 1.1fr; gap: 2rem; align-items: center; }
.hero .title { font-size: clamp(1.8rem, 2.8vw + 1rem, 3rem); line-height: 1.15; margin: 0 0 0.5rem; }
.hero .subtitle { font-size: clamp(1rem, 0.6vw + 0.8rem, 1.25rem); color: var(--muted); margin: 0 0 1.25rem; }
.cta { display: inline-block; background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%); color: #00121d; font-weight: 800; text-decoration: none; padding: 0.8rem 1.2rem; border-radius: 10px; box-shadow: 0 10px 24px -8px rgba(34, 211, 238, .45); }
.cta:hover { transform: translateY(-1px) scale(1.01); box-shadow: 0 14px 30px -8px rgba(34, 211, 238, .6); }

.hero-visual { display: none; }
.pattern-card { height: 320px; border-radius: 16px; background: radial-gradient(120% 120% at 10% 10%, color-mix(in oklab, var(--accent) 40%, transparent) 0%, color-mix(in oklab, var(--brand) 35%, transparent) 42%, color-mix(in oklab, var(--success) 32%, transparent) 80%, transparent 100%), linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid var(--border); box-shadow: 0 20px 40px -20px var(--shadow); display: grid; place-items: center; overflow: hidden; }
.pattern-card img { width: 100%; height: 100%; object-fit: cover; opacity: .95; }
.hero-meta { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.badge { background: color-mix(in oklab, var(--brand-2) 14%, transparent); color: var(--text); border: 1px solid color-mix(in oklab, var(--brand-2) 30%, transparent); padding: .35rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 700; }

@media (min-width: 980px) {
  .hero-inner { grid-template-columns: 1.2fr 1fr; }
  .hero-visual { display: block; }
}

/* Responsive spacing tweaks */
@media (max-width: 480px) {
  .hero { padding: 5rem 0 3rem; }
  .cta { width: 100%; text-align: center; }
}

/* Sections */
.section { padding: 4rem 0; }
.section.alt { background: linear-gradient(180deg, color-mix(in oklab, var(--bg-alt) 96%, transparent), color-mix(in oklab, var(--bg-alt) 100%, transparent)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: 1.6rem; margin: 0 0 1rem; }
.section-subtitle { font-size: 1.2rem; margin: 0 0 0.75rem; color: var(--accent); }
.lead { color: var(--text); opacity: .9; }
.small { font-size: .9rem; color: var(--muted); }

.two-col { display: grid; gap: 1.5rem; }
@media (min-width: 820px) { .two-col { grid-template-columns: 1fr 1fr; gap: 2rem; } }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem; box-shadow: 0 10px 25px -18px var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--brand) 45%, var(--border)); box-shadow: 0 14px 30px -18px var(--shadow); }
.card h4 { margin: 0 0 .5rem; }
.card .small { color: var(--muted); margin: 0; }
.icon-circle { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in oklab, var(--brand) 20%, transparent); border: 1px solid color-mix(in oklab, var(--brand) 38%, transparent); margin-bottom: .6rem; }

.partner { background: transparent; }
.partner-header { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.partner-badge { background: color-mix(in oklab, var(--brand-2) 18%, transparent); color: color-mix(in oklab, var(--brand-2) 90%, white); border: 1px solid color-mix(in oklab, var(--brand-2) 35%, transparent); padding: .35rem .6rem; border-radius: 999px; font-size: .9rem; font-weight: 700; }

.checklist { list-style: none; margin: .5rem 0 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 1.2rem auto; gap: .5rem; align-items: start; padding: .35rem 0; }
.checklist li::before { content: "✔"; color: var(--success); }

.testimonials { display: grid; gap: 1rem; }
.testimonial { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; box-shadow: 0 10px 25px -18px var(--shadow); }
.quote { margin: 0 0 .5rem; font-style: italic; }
.author { color: var(--muted); font-weight: 600; }

/* Contact */
.contact-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.1fr .9fr; } }

.contact-form { display: grid; gap: 1rem; }
.form-field { display: grid; gap: .35rem; }
input, textarea { width: 100%; background: #0b1327; border: 1px solid rgba(255,255,255,0.08); color: var(--text); padding: .8rem .9rem; border-radius: 10px; font: inherit; }
input::placeholder, textarea::placeholder { color: #657089; }
input:focus, textarea:focus { outline: 2px solid rgba(34,211,238,.55); border-color: rgba(34,211,238,.65); }
.form-status { min-height: 1.1rem; color: var(--muted); }

.contact-info { display: grid; gap: 1rem; }
.info-row { display: grid; grid-template-columns: 2rem auto; gap: .75rem; align-items: start; background: var(--card); border: 1px solid var(--border); padding: .9rem; border-radius: 12px; }
.icon { font-size: 1.2rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 1.2rem 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }

/* RTL specific tweaks */
body.rtl .checklist li { grid-template-columns: auto 1.2rem; }
body.rtl .checklist li::before { order: 2; }

/* Utilities */
.alt-note { color: var(--muted); }

/* KPIs / Stats */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; text-align: center; box-shadow: 0 10px 25px -18px var(--shadow); }
.kpi .num { font-size: clamp(1.4rem, 1.4vw + 1rem, 2rem); font-weight: 800; color: var(--brand-2); }
.kpi .label { color: var(--muted); margin-top: .25rem; font-weight: 600; }

/* Timeline / Process */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.timeline li { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .9rem .9rem .9rem 2.6rem; }
.timeline li::before { content: ""; position: absolute; left: 1rem; top: 1.1rem; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 18%, transparent); }
.timeline li::after { content: ""; position: absolute; left: 1.44rem; top: 2rem; bottom: .8rem; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .step-title { margin: 0 0 .2rem; font-weight: 700; }
.timeline .step-desc { margin: 0; color: var(--muted); }

/* FAQ */
.faq { display: grid; gap: .6rem; }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] { border-color: color-mix(in oklab, var(--brand) 40%, var(--border)); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Scroll to top */
.scroll-top { position: fixed; right: 16px; bottom: 16px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel); color: var(--text); box-shadow: 0 8px 20px -12px var(--shadow); display: grid; place-items: center; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .25s ease, transform .25s ease, visibility .25s; z-index: 60; }
.scroll-top.show { opacity: 1; visibility: visible; transform: none; }
.scroll-top:hover { border-color: var(--brand-2); }

/* Menu overlay (mobile) */
.menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); backdrop-filter: blur(1px); z-index: 30; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s; }
.menu-overlay.show { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }

/* Compact header on scroll */
.site-header.compact .header-inner { padding: 0.35rem 0.25rem; }
.site-header.compact .logo { height: 30px; width: 30px; }
