:root {
  --accent: #C8161F;
  --accent-soft: #C8161F14;
  --accent-line: #C8161F33;
  --bg: #FBF7F5;
  --card: #FFFFFF;
  --ink: #1C1F23;
  --muted: #5B616B;
  --line: #ECE6E2;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(28, 31, 35, .04), 0 8px 28px rgba(28, 31, 35, .06);
  color-scheme: light;
}
* { 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, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px; line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.hidden { display: none !important; }

/* ترويسة */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 20px; min-width: 0; }
.brand img { width: 30px; height: 34px; object-fit: contain; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.lang, .chip-link {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: none;
}
.lang svg, .chip-link svg { width: 17px; height: 17px; }
.lang:hover, .chip-link:hover { border-color: var(--accent-line); }

/* أقسام */
section { padding: 72px 0; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; margin-bottom: 32px; }
.lead { color: var(--muted); font-size: 18px; max-width: 60ch; }

/* بطل الصفحة */
.hero { padding: 56px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.app-id { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.app-id img { width: 64px; height: 72px; object-fit: contain; }
.app-id b { display: block; font-size: 40px; line-height: 1.1; color: var(--accent); }
.app-id small { font-size: 18px; color: var(--muted); font-weight: 600; }
.hero h1 { font-size: clamp(34px, 5.4vw, 58px); font-weight: 700; margin-bottom: 18px; text-wrap: balance; }
.hero .lead { margin: 0 0 28px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding: 0; list-style: none; }
.pills li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; }
.pills li::before { content: '✓'; color: var(--accent); margin-inline-end: 6px; font-weight: 700; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; min-width: 176px; padding: 10px 18px; border-radius: 14px;
  background: #111; color: #fff; text-decoration: none; transition: transform .15s ease;
}
.store:hover { transform: translateY(-2px); }
.store svg { width: 26px; height: 26px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.2; text-align: start; }
.store small { font-size: 11px; opacity: .8; }
.store b { font-size: 18px; font-weight: 700; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
html[dir=rtl] .store b { text-align: right; }
.store.off { background: var(--card); color: var(--muted); border: 1px dashed #D8D0CB; cursor: default; }
.store.off:hover { transform: none; }
.store.ghost { background: var(--accent-soft); color: var(--accent); }

.phone {
  justify-self: center; width: min(320px, 100%); aspect-ratio: 9 / 18.5; border-radius: 44px; padding: 12px; background: #16181B;
  box-shadow: 0 30px 60px -20px rgba(28, 31, 35, .35);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 34px; }

/* بطاقات المميزات */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feat .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; font-size: 24px; margin-bottom: 14px; }
.feat h3 { font-size: 19px; margin-bottom: 6px; }
.feat p { margin: 0; color: var(--muted); font-size: 15px; }

/* الخطوات */
.how-grid { display: grid; grid-template-columns: 1fr .9fr; gap: 48px; align-items: center; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: flex; gap: 16px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.steps li::before {
  counter-increment: s; content: counter(s); flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
html[lang=ar] .steps li::before { content: counter(s, arabic-indic); }
.steps h3 { font-size: 18px; margin-bottom: 2px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; }
.shot { border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); padding: 10px; box-shadow: var(--shadow); }
.shot img { border-radius: 14px; width: 100%; }

/* النشرة */
.brochure { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.brochure button { all: unset; cursor: zoom-in; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--card); }
.brochure button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.brochure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .25s ease; }
.brochure button:hover img { transform: scale(1.02); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 14px; padding: 12px 20px; font: inherit; font-weight: 700;
  background: var(--accent); color: #fff; text-decoration: none; border: 0; cursor: pointer;
}
.btn svg { width: 20px; height: 20px; }
.btn.light { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.row-between { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.row-between .h2 { margin: 0; }

/* دعوة التحميل */
.cta { background: var(--accent); color: #fff; border-radius: 28px; padding: 36px; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.cta h2 { font-size: clamp(26px, 3.6vw, 36px); margin-bottom: 8px; }
.cta p { margin: 0 0 20px; opacity: .92; }
.cta .link { direction: ltr; unicode-bidi: isolate; font-weight: 700; font-size: 20px; color: #fff; text-decoration: none; }
.cta .stores .store.off { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .4); }
.qr { width: 168px; height: 168px; background: #fff; border-radius: 18px; padding: 10px; }
.qr svg { width: 100%; height: 100%; display: block; }

/* صفحة الرئيسية */
.hub-hero { padding: 80px 0 40px; text-align: center; }
.hub-hero img { width: 72px; height: 82px; object-fit: contain; margin: 0 auto 18px; }
.hub-hero h1 { font-size: clamp(36px, 6vw, 64px); }
.hub-hero .lead { margin: 14px auto 0; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.app-card {
  --accent: #C8161F; display: flex; flex-direction: column; gap: 14px; text-decoration: none; background: var(--card); border: 1px solid var(--line);
  border-radius: 26px; padding: 26px; box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease;
}
.app-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.app-card header { display: flex; align-items: center; gap: 14px; }
.app-card header img { width: 52px; height: 58px; object-fit: contain; }
.app-card h2 { font-size: 26px; color: var(--accent); }
.app-card small { color: var(--muted); font-weight: 600; }
.app-card p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.app-card .go { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; }
.app-card .go svg { width: 18px; height: 18px; }
html[dir=rtl] .app-card .go svg, html[dir=rtl] .chip-link svg.flip { transform: scaleX(-1); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* نص طويل (الخصوصية) */
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 44px); max-width: 820px; margin: 0 auto; }
.doc h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 18px; }
.doc h2 { font-size: 21px; margin: 28px 0 8px; }
.doc p, .doc li { color: #3A3F46; }
.doc ul { padding-inline-start: 22px; }

/* تذييل */
.foot { border-top: 1px solid var(--line); padding: 28px 0 36px; margin-top: 40px; color: var(--muted); font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot p { margin: 0; }

/* عارض الصور */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(15, 16, 18, .88); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-height: 92vh; width: auto; border-radius: 12px; }
.lightbox button { position: absolute; top: 14px; inset-inline-end: 14px; border: 0; background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; }

.loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.center-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 0; }
.center-page h1 { font-size: 36px; margin-bottom: 8px; }

@media (max-width: 860px) {
  section { padding: 52px 0; }
  .hero { padding: 32px 0 48px; }
  .hero-grid, .how-grid { grid-template-columns: 1fr; gap: 36px; }
  .phone { width: min(260px, 80%); }
  .brochure { grid-template-columns: 1fr 1fr; }
  .cta { grid-template-columns: 1fr; padding: 28px 22px; }
  .qr { width: 148px; height: 148px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .app-id b { font-size: 32px; }
  .brochure { grid-template-columns: 1fr; }
  .store { min-width: 0; flex: 1 1 140px; padding: 10px 12px; gap: 8px; }
  .store b { font-size: 16px; }
  .store svg { width: 22px; height: 22px; }
  .lang span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
