/* SF Control — Smart Financial Control.
   Design system (ui-ux-pro-max, fintech trust): light by default, deep trust blue for action,
   one warm accent for the figure that matters, quiet glass panels, IBM Plex Sans Arabic.
   Contrast (checked): ink #0f1b2d on #f6f8fc 16.4:1 · muted #475569 on #fff 7.6:1 ·
   white on primary #1d4ed8 6.7:1 · accent text #c2410c on #fff 5.2:1 · dark theme ink 15:1.
   Motion tokens follow animation-systems / animate-ui: transform + opacity only,
   ease-out-fluid for entrances, faster exits, reduced motion = final state at once. */

:root {
  --bg: #f6f8fc;
  --bg-alt: #eef2f9;
  --surface: #ffffff;
  --glass: rgb(255 255 255 / 0.72);
  --ink: #0f1b2d;
  --muted: #475569;
  --line: #dfe6f1;
  --line-strong: #c9d4e5;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --on-primary: #ffffff;
  --primary-soft: rgb(29 78 216 / 0.08);
  --accent: #c2410c;
  --accent-soft: rgb(234 88 12 / 0.12);
  --ok: #15803d;
  --ok-soft: rgb(21 128 61 / 0.1);
  --musanad: #a16207;
  --mowtary: #c81e2b;
  --ring: #1d4ed8;
  --shadow: 0 1px 2px rgb(15 27 45 / 0.06), 0 12px 32px -12px rgb(15 27 45 / 0.18);
  --shadow-lift: 0 2px 4px rgb(15 27 45 / 0.06), 0 22px 44px -16px rgb(29 78 216 / 0.28);
  --radius: 18px;
  --radius-sm: 12px;

  --ease-out-fluid: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22);
  --dur-micro: 150ms;
  --dur-section: 700ms;
  --rise: 24px;
  --stagger: 70ms;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1120;
    --bg-alt: #0e1729;
    --surface: #111c31;
    --glass: rgb(17 28 49 / 0.72);
    --ink: #eef3fb;
    --muted: #a3b1c7;
    --line: #1f2c45;
    --line-strong: #2c3c5c;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --on-primary: #06101f;
    --primary-soft: rgb(59 130 246 / 0.14);
    --accent: #fb923c;
    --accent-soft: rgb(251 146 60 / 0.14);
    --ok: #4ade80;
    --ok-soft: rgb(74 222 128 / 0.12);
    --musanad: #e0b354;
    --mowtary: #f0444f;
    --ring: #60a5fa;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -12px rgb(0 0 0 / 0.6);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.4), 0 22px 44px -16px rgb(59 130 246 / 0.35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 50; background: var(--surface); padding: .6rem 1rem; border-radius: 10px; }
.skip:focus { top: 1rem; }
.wrap { width: min(1160px, 100% - 2rem); margin-inline: auto; }

/* ── Header ── */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-micro) var(--ease-smooth), box-shadow var(--dur-micro) var(--ease-smooth);
}
.site-head.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgb(15 27 45 / 0.4); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 1.1rem; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: .72rem; letter-spacing: .04em; }
.head-nav { display: flex; align-items: center; gap: .25rem; }
.head-nav a:not(.btn) {
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: .95rem;
  padding: .55rem .8rem; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center;
  transition: color var(--dur-micro) var(--ease-smooth), background-color var(--dur-micro) var(--ease-smooth);
}
.head-nav a:not(.btn):hover { color: var(--ink); background: var(--primary-soft); }
@media (max-width: 720px) { .head-nav a:not(.btn) { display: none; } .brand-text small { display: none; } }

/* ── Buttons (animate-ui: state 150ms ease-smooth, press 0.97 motion-safe) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.25rem; border-radius: 12px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: background-color var(--dur-micro) var(--ease-smooth), border-color var(--dur-micro) var(--ease-smooth),
              color var(--dur-micro) var(--ease-smooth), box-shadow var(--dur-micro) var(--ease-smooth), transform 200ms var(--ease-out-fluid);
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 10px 24px -12px rgb(29 78 216 / 0.7); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-light { background: #fff; border-color: #fff; color: #0f1b2d; }
.btn-light:hover { background: #eaf0ff; }
.btn-sm { min-height: 40px; padding: .45rem .9rem; font-size: .92rem; }
@media (prefers-reduced-motion: no-preference) {
  .btn:active { transform: scale(0.97); transition-duration: 70ms; }
  .btn:hover svg { transform: translateX(-3px); }
  .btn svg { transition: transform 200ms var(--ease-out-fluid); }
}

/* ── Shared bits ── */
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .85rem; color: var(--primary); letter-spacing: .02em; }
.trial { margin-inline-start: .35rem; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); letter-spacing: 0; white-space: nowrap; }
@media (max-width: 420px) { .eyebrow { flex-wrap: wrap; } .trial { margin-inline-start: 0; } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px var(--primary-soft); }
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-top: .75rem; }
.section-lead { color: var(--muted); margin-top: .9rem; font-size: 1.08rem; }

/* ── Hero ── */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3.5rem, 8vw, 6rem); }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.g1 { width: 520px; height: 520px; background: radial-gradient(circle, rgb(59 130 246 / 0.35), transparent 70%); top: -180px; inset-inline-start: -120px; }
.g2 { width: 420px; height: 420px; background: radial-gradient(circle, rgb(234 88 12 / 0.18), transparent 70%); bottom: -200px; inset-inline-end: 10%; }
.grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 60% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 30%, #000 0%, transparent 70%);
  opacity: .55;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-title { font-size: clamp(2.2rem, 5.4vw, 3.9rem); font-weight: 700; letter-spacing: -.01em; margin-top: 1rem; }
.hero-title em { font-style: normal; color: var(--primary); position: relative; white-space: nowrap; }
.hero-title em::after {
  content: ""; position: absolute; inset-inline: 0; bottom: .08em; height: .18em; border-radius: 6px;
  background: var(--accent-soft); z-index: -1;
  transform-origin: right; transform: scaleX(var(--mark, 1));
}
.lead { color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.2rem); margin-top: 1.25rem; max-width: 36em; }
.lead-en { color: var(--muted); font-size: .92rem; margin-top: .5rem; text-align: right; }
.ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* Control panel (illustrative). */
.panel {
  margin: 0; position: relative;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--line); border-radius: 22px; padding: 1.4rem; box-shadow: var(--shadow);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.panel-title { font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; white-space: nowrap; }
.chip-ok { color: var(--ok); background: var(--ok-soft); }
.chip-ok .dot { box-shadow: none; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 1.1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem .85rem; min-width: 0; }
.kpi-label { display: block; color: var(--muted); font-size: .78rem; }
.kpi-value { display: block; font-weight: 700; font-size: clamp(1rem, 2vw, 1.25rem); font-variant-numeric: tabular-nums; margin-top: .2rem; text-align: right; white-space: nowrap; }
.kpi-value small { font-size: .65em; color: var(--muted); font-weight: 600; }
.kpi-value.accent { color: var(--accent); }
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi:last-child { grid-column: span 2; } }
.chart { width: 100%; height: auto; margin-top: 1.1rem; color: var(--primary); overflow: visible; }
.chart .limit { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 5; }
.chart .limit-label { fill: var(--accent); font-size: 10px; font-weight: 600; font-family: inherit; }
.chart .area { fill: url(#fill); }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.chart .pin { fill: var(--surface); stroke: var(--primary); stroke-width: 3; }
.meter { margin-top: 1rem; }
.meter-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; color: var(--muted); }
.meter-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter-track { position: relative; height: 10px; border-radius: 999px; background: var(--line); margin-top: .45rem; overflow: hidden; }
.meter-fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 100%; border-radius: inherit;
  background: linear-gradient(270deg, var(--primary), #60a5fa); transform-origin: right; transform: scaleX(.65); }
.meter-mark { position: absolute; top: -3px; bottom: -3px; inset-inline-start: 80%; width: 2px; background: var(--accent); }
.panel-cap { margin-top: .9rem; font-size: .75rem; color: var(--muted); }

/* ── Trust pillars ── */
.strip { padding: 2.5rem 0; border-block: 1px solid var(--line); background: var(--surface); }
.pillars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (max-width: 960px) { .pillars { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pillars { grid-template-columns: 1fr; } }
.pillar { display: grid; grid-template-columns: auto 1fr; column-gap: .85rem; align-items: start; }
.pillar svg { grid-row: span 2; width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--primary-soft);
  fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pillar b { font-size: 1rem; }
.pillar span { color: var(--muted); font-size: .9rem; line-height: 1.6; }

/* ── Products (hover: lift + glow, animation-systems) ── */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 860px) { .products { grid-template-columns: 1fr; } }
.product {
  --brand: var(--primary);
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem); display: flex; flex-direction: column; gap: 1rem; box-shadow: var(--shadow);
  transition: transform 300ms var(--ease-out-fluid), box-shadow 300ms var(--ease-out-fluid), border-color var(--dur-micro) var(--ease-smooth);
}
.product::before { content: ""; position: absolute; inset-inline: 1.5rem; top: 0; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand); }
.product-musanad { --brand: var(--musanad); }
.product-mowtary { --brand: var(--mowtary); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .product:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
}
.product-top { display: flex; align-items: center; gap: 1rem; }
.product-top img { width: 56px; height: 56px; border-radius: 14px; }
.product h3 { font-size: 1.5rem; }
.product-kind { color: var(--muted); font-size: .9rem; }
.product > p { color: var(--muted); }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.ticks li { position: relative; padding-inline-start: 1.8rem; font-size: .95rem; }
.ticks li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 14%, transparent);
}
.ticks li::after {
  content: ""; position: absolute; inset-inline-start: .36rem; top: .72em; width: .38rem; height: .22rem;
  border-inline-start: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg);
}
.product-link { margin-top: auto; display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--brand); text-decoration: none; min-height: 44px; align-self: flex-start; }
.product-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 200ms var(--ease-out-fluid); }
.product-link:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) { .product-link:hover svg { transform: translateX(-4px); } }

/* ── Steps ── */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; counter-reset: s; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.step-n { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 1.15rem; }
.step h3 { font-size: 1.2rem; margin-top: 1rem; }
.step p { color: var(--muted); margin-top: .5rem; }

/* ── CTA band ── */
.cta-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: clamp(1.75rem, 4vw, 2.75rem); border-radius: 24px; color: #fff;
  background: radial-gradient(circle at 15% 120%, rgb(234 88 12 / 0.45), transparent 45%), linear-gradient(135deg, #1e3a8a, #1d4ed8 60%, #2563eb);
  box-shadow: 0 24px 48px -24px rgb(29 78 216 / 0.7);
}
.cta-band h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.cta-band p { opacity: .9; margin-top: .4rem; }

/* ── Footer ── */
.site-foot { border-top: 1px solid var(--line); padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom)); color: var(--muted); font-size: .9rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.foot-row nav { display: flex; gap: .25rem; }
.foot-row a { text-decoration: none; padding: .5rem .7rem; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
.foot-row a:hover { color: var(--ink); background: var(--primary-soft); }

/* ── Privacy page ── */
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.prose h2 { font-size: 1.25rem; margin-top: 2rem; }
.prose p, .prose li { color: var(--muted); margin-top: .75rem; }

/* ── Motion (animation-on-scroll + animation-systems) ──
   Content is visible without JS; motion.js adds .js-motion to <html> and then hides only what
   it will reveal. Entrance = fade + rise + small blur, 700ms ease-out-fluid, once. */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(var(--rise)); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes pin-pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: no-preference) {
  .js-motion [data-reveal], .js-motion [data-hero], .js-motion .word { opacity: 0; }
  .js-motion [data-reveal].in { animation: rise-in var(--dur-section) var(--ease-out-fluid) var(--delay, 0ms) both; }
  .js-motion [data-hero].in { animation: rise-in 800ms var(--ease-out-fluid) var(--delay, 0ms) both; }
  .js-motion .panel[data-hero].in { animation-name: panel-in; animation-duration: 900ms; }
  .js-motion .word { display: inline-block; }
  .js-motion .word.in { animation: rise-in 700ms var(--ease-out-fluid) var(--delay, 0ms) both; }
  .js-motion .panel.in .chart .line { animation: draw 1400ms var(--ease-out-fluid) 350ms both; }
  .js-motion .panel.in .chart .area { animation: fade 900ms var(--ease-smooth) 900ms both; }
  .js-motion .panel.in .chart .pin { transform-box: fill-box; transform-origin: center; animation: pin-pop 450ms var(--ease-out-fluid) 1600ms both; }
  .js-motion .panel.in .meter-fill { animation: grow-x 1100ms var(--ease-out-fluid) 700ms both; }
  .js-motion .hero-title.in em::after { animation: grow-x 700ms var(--ease-out-fluid) 900ms both; }
}
