/* =========================================================
   Floosio — customer site
   ========================================================= */
:root {
  --rail: #0E1726;
  --rail-2: #162236;
  --rail-text: #9AA7BD;
  --brand: #2F6BFF;
  --brand-2: #5B8CFF;
  --indigo: #4C3DF0;
  --mint: #10B981;
  --amber: #F59E0B;
  --violet: #8B5CF6;
  --rose: #F43F5E;
  --teal: #14B8A6;
  --ink: #0F172A;
  --muted: #64748B;
  --line: #E5E9F2;
  --bg: #F4F6FB;
  --card: #FFFFFF;
  --surface: #FFFFFF;          /* buttons, pills, strips on the page background */
  --field: #FAFBFD;            /* resting form inputs */
  --tint: #E8F0FF;             /* pale brand wash behind small icons/badges */
  --bar-soft: #DCE6FF;
  --line-strong: #CBD5E1;
  --ticker-text: #94A3B8;
  --panel-border: transparent;  /* edge for the always-dark panels */
  --topbar-bg: rgba(255, 255, 255, .78);
  --shadow: 0 20px 40px -24px rgba(15, 23, 42, .35);
  --shadow-strong: 0 30px 50px -28px rgba(15, 23, 42, .45);
  color-scheme: light;

  --rail-w: 92px;
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Dark theme: chosen via the top-bar toggle (data-theme), else follows the device */
:root[data-theme="dark"] {
  --rail: #060A14;
  --rail-2: #111A2C;
  --ink: #E6EBF5;
  --muted: #94A3B8;
  --line: #1F2A40;
  --bg: #0B1220;
  --card: #121B2D;
  --surface: #121B2D;
  --field: #0F1726;
  --tint: rgba(91, 140, 255, .16);
  --bar-soft: #26365A;
  --line-strong: #33415C;
  --ticker-text: #5B6B85;
  --panel-border: #1F2A40;
  --topbar-bg: rgba(11, 18, 32, .78);
  --shadow: 0 20px 40px -24px rgba(0, 0, 0, .7);
  --shadow-strong: 0 30px 50px -28px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --rail: #060A14;
    --rail-2: #111A2C;
    --ink: #E6EBF5;
    --muted: #94A3B8;
    --line: #1F2A40;
    --bg: #0B1220;
    --card: #121B2D;
    --surface: #121B2D;
    --field: #0F1726;
    --tint: rgba(91, 140, 255, .16);
    --bar-soft: #26365A;
    --line-strong: #33415C;
    --ticker-text: #5B6B85;
    --panel-border: #1F2A40;
    --topbar-bg: rgba(11, 18, 32, .78);
    --shadow: 0 20px 40px -24px rgba(0, 0, 0, .7);
    --shadow-strong: 0 30px 50px -28px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
/* Briefly animate colours when the visitor flips the theme */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color .35s ease, border-color .35s ease, color .35s ease !important;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
.sprite { position: absolute; }
.ic {
  width: 20px; height: 20px;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
}
.btn .ic { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:hover .ic { transform: translateX(3px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 12px 26px -12px rgba(47, 107, 255, .95); }
.btn-primary:hover { background: #1F5BF0; box-shadow: 0 16px 30px -12px rgba(47, 107, 255, 1); }
.btn-ghost { background: var(--surface); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.btn-light { background: #fff; color: var(--brand); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
:focus-visible { outline: 3px solid rgba(47, 107, 255, .45); outline-offset: 2px; }

/* ---------- Left rail ---------- */
.rail {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50;
  width: var(--rail-w);
  background: var(--rail);
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0 16px;
}
.rail-logo {
  width: 50px; height: 50px; border-radius: 14px; margin-bottom: 26px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 22px -8px rgba(47, 107, 255, .8);
  transition: transform .4s var(--ease);
}
.rail-logo .ic { width: 24px; height: 24px; stroke-width: 2.6; }
.rail-logo:hover { transform: rotate(-8deg) scale(1.06); }
.rail-links { list-style: none; padding: 0; display: grid; gap: 6px; }
.rail-item {
  position: relative;
  width: 76px; padding: 11px 4px 9px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--rail-text); font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2;
  transition: color .25s, background .25s;
}
.rail-item .ic { width: 21px; height: 21px; transition: transform .3s var(--ease); }
.rail-item::before {
  content: ""; position: absolute; inset-inline-start: -8px; top: 12px; bottom: 12px; width: 3px;
  border-radius: 3px; background: var(--brand-2);
  transform: scaleY(0); transition: transform .35s var(--ease);
}
.rail-item:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.rail-item:hover .ic { transform: translateY(-2px); }
.rail-item.active { color: #fff; background: rgba(255, 255, 255, .09); }
.rail-item.active::before { transform: scaleY(1); }
.rail-bottom { margin-top: auto; display: grid; gap: 6px; }
.lang-glyph {
  height: 21px; min-width: 21px; padding: 0 3px; border-radius: 6px;
  display: grid; place-items: center;
  border: 1.6px solid currentColor; font-size: 11px; font-weight: 800; line-height: 1;
  transition: transform .3s var(--ease);
}
.lang-glyph:lang(ar) { font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 13px; }
.lang-switch:hover .lang-glyph { transform: translateY(-2px); }
.lang-top { display: none; }

/* ---------- Page shell ---------- */
.page { margin-inline-start: var(--rail-w); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; overflow-x: clip; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 62px; padding: 0 clamp(20px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--topbar-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.brand b { font-size: 17px; }
.brand-mark { display: none; }
.brand-sub { color: var(--muted); padding-inline-start: 12px; border-inline-start: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* Theme toggle: a single icon button, moon in light mode / sun in dark mode */
.theme-toggle {
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  transition: color .25s, background .25s, border-color .25s;
}
.theme-toggle:hover { color: var(--ink); background: var(--surface); border-color: var(--line); }
.theme-toggle .ic { grid-area: 1 / 1; transition: transform .5s var(--ease), opacity .3s; }
.theme-toggle .i-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
:root[data-theme="dark"] .theme-toggle .i-sun { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
html:not(.js) .theme-toggle { display: none; }

.section { padding: clamp(56px, 8vw, 96px) clamp(20px, 4vw, 56px); }
.sec-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.eyebrow { color: var(--brand); font-weight: 800; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.sec-head h2 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.03em; line-height: 1.1; margin: 12px 0; }
.sec-head p { color: var(--muted); font-size: 16px; line-height: 1.65; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center;
  padding: clamp(48px, 7vw, 88px) clamp(20px, 4vw, 56px) clamp(56px, 7vw, 80px);
  overflow: hidden;
}
.blob { position: absolute; border-radius: 50%; filter: blur(10px); pointer-events: none; }
.blob-a {
  width: 640px; height: 640px; inset-inline-end: -140px; top: -200px;
  background: radial-gradient(circle, rgba(91, 140, 255, .38), transparent 65%);
  animation: drift 14s ease-in-out infinite alternate;
}
.blob-b {
  width: 420px; height: 420px; inset-inline-start: 30%; bottom: -260px;
  background: radial-gradient(circle, rgba(139, 92, 246, .22), transparent 65%);
  animation: drift 18s ease-in-out infinite alternate-reverse;
}
.hero-copy, .hero-visual { position: relative; }
.pill {
  display: inline-flex; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding-block: 6px; padding-inline: 6px 14px; font-size: 13px; font-weight: 600;
}
.pill span { background: var(--tint); color: var(--brand); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.hero h1 { font-size: clamp(42px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -.04em; margin: 22px 0 20px; }
.grad {
  background: linear-gradient(90deg, var(--brand), var(--violet), var(--brand));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
}
.lead { font-size: 18px; color: var(--muted); line-height: 1.65; max-width: 540px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 16px; }
.note { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.note .ic { width: 16px; height: 16px; color: var(--mint); stroke-width: 2.4; }
.stats { display: flex; flex-wrap: wrap; gap: 36px; margin-top: 38px; }
.stats div { font-size: 13px; color: var(--muted); }
.stats b { display: block; font-size: 26px; color: var(--ink); letter-spacing: -.02em; }

.hero-visual { height: 460px; }
.dash { position: absolute; inset-block: 24px 34px; inset-inline: 20px 44px; padding: 24px; display: flex; flex-direction: column; }
.dash-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.up { color: var(--mint); font-weight: 700; }
.dash-num { font-size: 36px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bars {
  flex: 1; display: flex; align-items: flex-end; gap: 14px;
  margin-top: 22px; padding-bottom: 6px; border-bottom: 1px dashed var(--line);
}
.bars i {
  flex: 1; height: var(--h); border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  transform-origin: bottom; transform: scaleY(0);
  animation: grow 1s var(--ease) forwards;
  animation-delay: calc(.6s + var(--i) * .08s);
  transition: filter .2s;
}
.bars i.soft { background: var(--bar-soft); }
.bars i:hover { filter: brightness(1.15); }
.months { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.months span { flex: 1; text-align: center; }

.float {
  position: absolute; display: flex; gap: 12px; align-items: center;
  padding: 14px 16px; font-size: 13px; color: var(--muted);
  opacity: 0;
  animation: pop .7s var(--ease) forwards, bob 5s ease-in-out infinite;
}
.float b { display: block; font-size: 15px; color: var(--ink); }
.chip {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, var(--card));
}
.f1 { inset-inline-end: 0; top: 0; animation-delay: 1.2s, 1.9s; }
.f2 { inset-inline-start: -8px; bottom: 0; animation-delay: 1.4s, 2.6s; }
.f3 { inset-inline-end: -6px; bottom: 80px; animation-delay: 1.6s, 3.3s; }

/* ---------- Ticker ---------- */
.ticker {
  overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); padding: 16px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.ticker-track span {
  display: flex; align-items: center; gap: 40px; padding-inline-end: 40px;
  font-weight: 700; font-size: 15px; color: var(--ticker-text); white-space: nowrap;
}
.ticker-track span::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); opacity: .5; }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1200px; margin: 0 auto; }
.feat {
  position: relative; padding: 26px; border-top: 4px solid var(--c); overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.feat::after {
  content: ""; position: absolute; inset-block-end: -60%; inset-inline-end: -40%; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%);
  opacity: 0; transition: opacity .4s;
}
.feat:hover { transform: translateY(-6px); box-shadow: var(--shadow-strong); }
.feat:hover::after { opacity: 1; }
.feat-ic {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 18px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--c);
  transition: transform .45s var(--ease);
}
.feat-ic .ic { width: 22px; height: 22px; }
.feat:hover .feat-ic { transform: rotate(-10deg) scale(1.1); }
.feat h3 { font-size: 18px; margin-bottom: 8px; }
.feat p { color: var(--muted); font-size: 14.5px; line-height: 1.65; }

.why {
  max-width: 1200px; margin: 28px auto 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.why div { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 6px 4px; }
.why-ic {
  grid-row: span 2; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--tint); color: var(--brand);
}
.why b { font-size: 15px; }
.why p { color: var(--muted); font-size: 14px; }

/* ---------- How it works ---------- */
.flow {
  position: relative; max-width: 1200px; margin: 0 auto;
  background: var(--rail); color: #fff; border-radius: 26px; border: 1px solid var(--panel-border);
  padding: clamp(36px, 5vw, 64px); overflow: hidden;
}
.flow::before {
  content: ""; position: absolute; width: 520px; height: 520px; inset-inline-end: -180px; top: -220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 107, 255, .35), transparent 65%);
  animation: drift 16s ease-in-out infinite alternate;
}
.flow .eyebrow { color: #8FB0FF; }
.flow .sec-head p { color: var(--rail-text); }
.steps { position: relative; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step {
  background: var(--rail-2); border: 1px solid rgba(255, 255, 255, .07); border-radius: 16px; padding: 24px;
  transition: transform .35s var(--ease), border-color .35s;
}
.step:hover { transform: translateY(-4px); border-color: rgba(143, 176, 255, .4); }
.step .n {
  width: 36px; height: 36px; border-radius: 10px; margin-bottom: 16px;
  display: grid; place-items: center; font-weight: 800; background: var(--brand);
  box-shadow: 0 0 0 0 rgba(47, 107, 255, .6);
}
.step.in .n { animation: ping 2.4s ease-out infinite; animation-delay: calc(var(--i) * .6s); }
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--rail-text); line-height: 1.6; }
.flow-line { position: relative; height: 4px; margin-top: 28px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.flow-line span {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--violet), var(--mint));
  transform: scaleX(0); transform-origin: left; transition: transform 1.8s var(--ease) .3s;
}
.flow.in .flow-line span { transform: scaleX(1); }

/* ---------- Walkthrough demo ---------- */
.demo { max-width: 1200px; margin: clamp(56px, 8vw, 96px) auto 0; }
.demo .sec-head { margin-bottom: 28px; }
.demo-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.demo-tab {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--muted);
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  transition: color .25s, background .25s, border-color .25s, box-shadow .25s;
}
.demo-tab .ic { width: 18px; height: 18px; }
.demo-tab:hover { color: var(--ink); border-color: var(--line-strong); }
.demo-tab[aria-selected="true"] { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 10px 22px -12px rgba(47, 107, 255, .9); }

.demo-stage { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
.demo-steps { list-style: none; padding: 0; display: grid; gap: 8px; }
.demo-steps li {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; color: var(--muted);
  transition: color .3s, background .3s, border-color .3s;
}
.demo-steps .num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  background: var(--surface); border: 1px solid var(--line); transition: background .3s, color .3s, border-color .3s;
}
.demo-steps .num .ic { width: 15px; height: 15px; stroke-width: 3; display: none; }
.demo-steps li.active { color: var(--ink); background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.demo-steps li.active .num { background: var(--brand); border-color: var(--brand); color: #fff; animation: ping 1.8s ease-out infinite; }
.demo-steps li.done { color: var(--ink); }
.demo-steps li.done .num { background: var(--mint); border-color: var(--mint); color: #fff; }
.demo-steps li.done .num .ic { display: block; }
.demo-steps li.done .num b { display: none; }

.demo-window { position: relative; overflow: hidden; min-height: 470px; }
.win-bar {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px;
  border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted);
}
.win-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.win-bar i:nth-child(1) { background: #FF6B6B; } .win-bar i:nth-child(2) { background: #FFC94D; } .win-bar i:nth-child(3) { background: #3DD68C; }
.win-bar span { flex: 1; text-align: center; margin-inline-end: 50px; }
.win-body { position: relative; padding: 20px; min-height: 430px; }
.win-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.win-toolbar b { font-size: 17px; }

.mock-btn {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: transform .15s, opacity .3s, box-shadow .2s;
}
.mock-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.mock-btn.pressed { transform: scale(.94); box-shadow: 0 0 0 5px rgba(47, 107, 255, .2); }
.mock-btn.hidden { opacity: 0; pointer-events: none; }

.doc {
  border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--card);
  opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.doc.show { opacity: 1; transform: none; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.doc-head b { font-size: 15px; }
.status {
  font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  color: var(--muted); background: var(--tint); transition: background .3s, color .3s; white-space: nowrap;
}
.status[data-state="sent"] { color: var(--brand); }
.status[data-state="accepted"], .status[data-state="converted"] { color: #fff; background: var(--mint); }
.status.bump { animation: pop .45s var(--ease); }

.doc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.mock-field { display: grid; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.mock-input {
  min-height: 36px; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--field);
  font-size: 13px; font-weight: 600; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.mock-input.focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .14); }
.mock-input.typing::after {
  content: ""; display: inline-block; width: 1.5px; height: 1em; margin-inline-start: 2px;
  background: var(--brand); vertical-align: -2px; animation: blink .8s steps(1) infinite;
}

.doc-items { border-top: 1px solid var(--line); font-size: 12.5px; }
.doc-row { display: grid; grid-template-columns: 1fr 52px 88px 96px; gap: 8px; padding: 9px 2px; border-bottom: 1px solid var(--line); align-items: center; }
.doc-row span:not(:first-child) { text-align: end; font-variant-numeric: tabular-nums; }
.doc-row.head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
html:lang(ar) .doc-row.head { letter-spacing: 0; }
.doc-row.item { animation: rowIn .45s var(--ease) both; font-weight: 600; }
.doc-add { margin: 10px 0 2px; font-size: 12px; padding: 6px 10px; }

.doc-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 12px; }
.doc-actions { display: flex; gap: 8px; }
.doc-totals { display: grid; gap: 4px; min-width: 210px; font-size: 13px; }
.doc-totals div { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s var(--ease); }
.doc-totals div.show { opacity: 1; transform: none; }
.doc-totals div b { color: var(--ink); font-variant-numeric: tabular-nums; }
.doc-totals .grand { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink); font-weight: 800; }
.doc-totals .grand b { color: var(--brand); font-size: 17px; }

.mock-cursor {
  position: absolute; top: 0; left: 0; z-index: 5; width: 22px; height: 22px; pointer-events: none;
  opacity: 0; transform: translate(60%, 70%); transition: transform .8s cubic-bezier(.45, .05, .25, 1), opacity .3s;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
}
.mock-cursor.on { opacity: 1; }
.mock-cursor svg { width: 22px; height: 22px; }
.mock-cursor::after {
  content: ""; position: absolute; left: -9px; top: -9px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--brand); opacity: 0;
}
.mock-cursor.click::after { animation: clickRing .45s ease-out; }

.mock-toast {
  position: absolute; inset-inline: 20px; bottom: 18px; z-index: 4;
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px;
  background: var(--rail); color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(16px); transition: opacity .35s, transform .45s var(--ease);
}
.mock-toast.show { opacity: 1; transform: none; }
.mock-toast .chip { width: 28px; height: 28px; border-radius: 8px; --c: var(--mint); }
.mock-toast .chip .ic { width: 16px; height: 16px; stroke-width: 2.6; }

.demo-controls { display: flex; align-items: center; gap: 12px; margin-top: 18px; margin-inline-start: 270px; }
.demo-btn {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: transform .2s var(--ease), background .25s, color .25s, border-color .25s;
}
.demo-btn:hover { transform: scale(1.06); }
.demo-btn .ic { grid-area: 1 / 1; display: none; }
.demo-play { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 10px 22px -10px rgba(47, 107, 255, .9); }
.demo-play[data-state="paused"] .i-play,
.demo-play[data-state="playing"] .i-pause,
.demo-play[data-state="ended"] .i-replay { display: block; }
.demo-sound .i-muted { display: block; color: var(--muted); }
.demo-sound[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }
.demo-sound[aria-pressed="true"] .i-muted { display: none; }
.demo-sound[aria-pressed="true"] .i-volume { display: block; }
.demo-sound:not([aria-pressed="true"]) { animation: nudge 2.4s ease-in-out 2s 3; }
.demo-caption { flex: 1; min-width: 0; }
.demo-count { font-size: 11.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; }
html:lang(ar) .demo-count { letter-spacing: 0; }
.demo-say { font-size: 15px; font-weight: 600; min-height: 1.5em; }
.demo-say.swap { animation: fadeUp .4s var(--ease); }
.demo-note { font-size: 12.5px; color: var(--muted); }
.demo-note:empty { display: none; }

/* Pause freezes CSS animations inside the player too */
.demo.is-paused * { animation-play-state: paused !important; }

@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); background: var(--tint); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes clickRing { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: scale(1.6); } }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 107, 255, 0); } 50% { box-shadow: 0 0 0 7px rgba(47, 107, 255, .18); } }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 20px; max-width: 1080px; margin: 0 auto; align-items: stretch; }
.plan { position: relative; padding: 30px; display: flex; flex-direction: column; transition: transform .35s var(--ease), box-shadow .35s; }
.plan:hover { transform: translateY(-6px); }
.plan h3 { font-size: 16px; }
.price { font-size: 46px; font-weight: 800; letter-spacing: -.03em; margin: 12px 0 2px; }
.price small { font-size: 14px; font-weight: 600; opacity: .6; letter-spacing: 0; }
.plan-sub { font-size: 14px; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 22px 0 26px; display: grid; gap: 12px; font-size: 14.5px; flex: 1; }
.plan li { display: flex; gap: 10px; }
.plan li::before { content: "✓"; color: var(--mint); font-weight: 800; }
.plan-pop {
  padding: 40px 30px; overflow: hidden; border: none; color: #fff;
  background: linear-gradient(160deg, var(--brand), var(--indigo));
  box-shadow: 0 30px 60px -24px rgba(76, 61, 240, .7);
}
.plan-pop::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 60%; left: -80%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent);
  transform: skewX(-18deg); animation: sweep 4.5s ease-in-out infinite 1s;
}
.plan-pop .plan-sub { color: #C7D6FF; }
.plan-pop li::before { color: #A7F3D0; }
.plans-more { text-align: center; margin-top: 22px; }
.plans-more .btn { display: inline-flex; }
/* Plan cards built from the database packages (Views/Home/_Packages.cshtml) */
.plan-pop { padding: 30px; } /* same box as the other cards */
.plans-1 { grid-template-columns: minmax(0, 380px); justify-content: center; }
.plans-2 { grid-template-columns: repeat(2, minmax(0, 380px)); justify-content: center; }
.plans-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1240px; }
.plan h3 { font-size: 18px; }
.plan ul { margin: 18px 0 24px; gap: 10px; align-content: start; }
.plan li.more::before { content: "+"; color: var(--brand); }
.plan li.more a { color: var(--brand); font-weight: 700; }
.plan-pop li.more::before, .plan-pop li.more a { color: #fff; }
.plan .btn { width: 100%; }
.plan-meter { height: 6px; border-radius: 99px; background: var(--line); margin-top: 14px; overflow: hidden; }
.plan-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--violet)); transform-origin: left; animation: grow-x 1s var(--ease) .6s both; }
.plan-pop .plan-meter { background: rgba(255, 255, 255, .2); }
.plan-pop .plan-meter i { background: #A7F3D0; }
@keyframes grow-x { from { transform: scaleX(0); } }
.pricing-empty { max-width: 560px; margin: 0 auto; padding: 36px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.pricing-empty p { color: var(--muted); }
[dir="rtl"] .plan-meter i { transform-origin: right; }
.badge {
  position: absolute; top: 18px; inset-inline-end: 18px; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; background: rgba(255, 255, 255, .18); padding: 5px 10px; border-radius: 999px;
}

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.25fr; gap: 24px; max-width: 1200px; margin: 0 auto; }
.info { padding: 36px; border-color: var(--panel-border); color: #fff; background: linear-gradient(160deg, #0E1726, #1B2A4A); }
.info .eyebrow { color: #8FB0FF; }
.info h2 { font-size: 32px; letter-spacing: -.02em; line-height: 1.15; margin: 12px 0; }
.info p { color: var(--rail-text); font-size: 15px; line-height: 1.65; margin-bottom: 10px; }
.info-line { display: flex; gap: 14px; align-items: center; margin-top: 16px; font-size: 15px; }
.info-line span {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .08); transition: background .25s, transform .25s var(--ease);
}
.info-line .ic { width: 18px; height: 18px; }
a.info-line:hover span { background: var(--brand); transform: scale(1.08); }

.form { padding: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit; font-weight: 500; font-size: 15px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: var(--field);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 4px rgba(47, 107, 255, .12);
}
.field .invalid { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(244, 63, 94, .1); animation: shake .35s; }
.wide { grid-column: 1 / -1; }
.form-status { font-size: 14px; font-weight: 600; min-height: 1.5em; }
.form-status.ok { color: var(--mint); }
.form-status.err { color: var(--rose); }

/* ---------- Footer ---------- */
.footer {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  padding: 26px clamp(20px, 4vw, 56px); border-top: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 14px;
}
.footer nav { display: flex; gap: 22px; }
.footer a:hover { color: var(--brand); }

/* ---------- Arabic / right-to-left ---------- */
:lang(ar) body,
html:lang(ar) .btn, html:lang(ar) .field input, html:lang(ar) .field select, html:lang(ar) .field textarea {
  font-family: "IBM Plex Sans Arabic", "Plus Jakarta Sans", system-ui, sans-serif;
}
/* Arabic letters join, so tracking (letter-spacing) breaks words apart */
html:lang(ar) h1, html:lang(ar) h2, html:lang(ar) h3, html:lang(ar) .eyebrow,
html:lang(ar) .price, html:lang(ar) .stats b, html:lang(ar) .dash-num { letter-spacing: 0; }
html:lang(ar) .hero h1 { line-height: 1.25; font-size: clamp(38px, 5vw, 64px); }
html:lang(ar) .sec-head h2, html:lang(ar) .info h2 { line-height: 1.35; }
html:lang(ar) .eyebrow { font-size: 14px; }
html:lang(ar) .lead, html:lang(ar) .feat p { line-height: 1.85; }
/* Mirror direction-bearing icons and motion */
[dir="rtl"] .ic.flip { scale: -1 1; }
[dir="rtl"] .btn:hover .ic { transform: translateX(-3px); }
[dir="rtl"] .ticker-track { animation-name: marquee-rtl; }
[dir="rtl"] .flow-line span { transform-origin: right; }

/* ---------- Motion ---------- */
.load { opacity: 0; animation: fadeUp .8s var(--ease) forwards; animation-delay: calc(var(--d) * .1s + .1s); }
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * .08s); }
.js .reveal.in { opacity: 1; transform: none; }
/* hover transforms on revealed cards should respond immediately */
.js .feat.reveal.in, .js .plan.reveal.in, .js .step.reveal.in { transition: opacity .8s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes grow { to { transform: scaleY(1); } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 40px) scale(1.12); } }
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes marquee-rtl { to { transform: translateX(50%); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(47, 107, 255, .6); } 70%, 100% { box-shadow: 0 0 0 14px rgba(47, 107, 255, 0); } }
@keyframes sweep { 0% { left: -80%; } 60%, 100% { left: 140%; } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 620px; width: 100%; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
  .demo-stage { grid-template-columns: 1fr; }
  .demo-controls { margin-inline-start: 0; }
  /* steps collapse to a row of numbered dots; the caption carries the text */
  .demo-steps { display: flex; justify-content: center; gap: 6px; }
  .demo-steps li { padding: 4px; font-size: 0; gap: 0; background: none !important; border: none !important; box-shadow: none !important; }
}
@media (max-width: 560px) {
  .win-body { padding: 14px; }
  .doc { padding: 13px; }
  .doc-fields { grid-template-columns: 1fr; gap: 9px; }
  .doc-row { grid-template-columns: 1fr 34px 64px 72px; gap: 6px; font-size: 11.5px; }
  .doc-bottom { flex-direction: column-reverse; align-items: stretch; }
  .doc-totals { min-width: 0; }
  .doc-actions { justify-content: flex-end; }
  .demo-window { min-height: 0; }
  .win-body { min-height: 520px; }
}

@media (max-width: 760px) {
  :root { --rail-w: 0px; }
  html { scroll-padding-top: 64px; }
  /* rail becomes a bottom tab bar */
  .rail {
    inset: auto 0 0 0; width: 100%; height: auto;
    flex-direction: row; justify-content: space-around; align-items: stretch;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .rail-logo { display: none; }
  .rail-links { display: contents; }
  .rail-links li { flex: 1; display: flex; justify-content: center; }
  .rail-item { width: auto; min-width: 0; flex: 1; padding: 8px 2px 6px; font-size: 10px; }
  .rail-bottom { display: contents; }
  .rail-login { flex: 1; }
  .lang-switch { display: none; }
  .lang-top { display: inline-flex; }
  .rail-item::before { inset-inline: 25%; top: -8px; bottom: auto; width: auto; height: 3px; transform: scaleX(0); }
  .rail-item.active::before { transform: scaleX(1); }
  .page { padding-bottom: 76px; }

  .brand-mark {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
  }
  .brand-mark .ic { width: 18px; height: 18px; stroke-width: 2.6; }
  .brand-sub, .hide-sm { display: none; }

  .hero-visual { height: 330px; }
  .dash { inset: 16px 12px 24px 0; padding: 18px; }
  .dash-num { font-size: 28px; }
  .bars, .months { gap: 8px; }
  .f1 { inset-inline-end: -4px; top: -6px; }
  .f2 { inset-inline-start: -4px; bottom: -8px; }
  .f3 { display: none; }
  .lead { font-size: 16px; }
  .stats { gap: 24px; }

  .features, .why, .plans, .steps { grid-template-columns: minmax(0, 1fr); }
  .form { grid-template-columns: 1fr; padding: 24px; }
  .info { padding: 28px; }
  .footer { justify-content: center; text-align: center; }
}
