/* ============================================================
   دفتري — صفحة تحميل التطبيق
   نظام الألوان مبني على اللون الأساسي القادم من قاعدة البيانات
   ============================================================ */

:root {
  --primary: #9E000E;
  --primary-rgb: 158, 0, 14;
  --primary-bright: #ff2d3a;
  --bg: #0d0808;
  --bg-alt: #150c0d;
  --surface: #1c1213;
  --surface-2: #241618;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f6efee;
  --muted: #b9a6a4;
  --muted-2: #8a7574;

  --font-display: 'Tajawal', 'Segoe UI', sans-serif;
  --font-body: 'Tajawal', 'Segoe UI', sans-serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.75;
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
section { position: relative; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- خلفية جوية عامة ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 45% at 82% -5%, rgba(var(--primary-rgb), .35), transparent 60%),
    radial-gradient(50% 40% at 10% 15%, rgba(var(--primary-rgb), .16), transparent 65%),
    var(--bg);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------- شريط علوي ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(13, 8, 8, .55);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .2px;
}
.nav-brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px var(--border);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(145deg, var(--primary-bright), var(--primary));
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
  box-shadow: 0 6px 20px -6px rgba(var(--primary-rgb), .7);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -6px rgba(var(--primary-rgb), .9);
}

/* ---------- الهيرو ---------- */
.hero {
  padding: 84px 0 60px;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 28px;
}
.hero-glow::before {
  content: '';
  position: absolute;
  inset: -46px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), .55), transparent 70%);
  filter: blur(6px);
  animation: pulse-glow 3.2s ease-in-out infinite;
}
.hero-logo {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 32px;
  object-fit: cover;
  background: var(--surface);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08),
    0 20px 50px -12px rgba(var(--primary-rgb), .65);
  animation: float-y 5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: .95; transform: scale(1.12); }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.eyebrow b { color: var(--primary-bright); font-weight: 800; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  letter-spacing: -.5px;
  margin-bottom: 18px;
}
.hero h1 span {
  background: linear-gradient(90deg, var(--primary-bright), #ff8a7a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  max-width: 620px;
  margin: 0 auto 34px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(145deg, var(--primary-bright), var(--primary));
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  padding: 16px 34px;
  border-radius: 999px;
  box-shadow: 0 14px 34px -10px rgba(var(--primary-rgb), .85);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -8px rgba(var(--primary-rgb), 1);
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; right: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg);
  animation: shine 3.4s ease-in-out infinite;
}
@keyframes shine {
  0%   { right: -60%; }
  35%  { right: 130%; }
  100% { right: 130%; }
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-weight: 700;
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.btn-ghost:hover {
  border-color: rgba(var(--primary-rgb), .6);
  background: rgba(var(--primary-rgb), .08);
  transform: translateY(-2px);
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  color: var(--muted-2);
  font-size: .86rem;
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.version-badge {
  color: var(--primary-bright);
  font-weight: 800;
  font-family: 'Courier New', monospace;
}

/* ---------- سكشن عام ---------- */
.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 46px;
}
.section-head .eyebrow { margin-bottom: 16px; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  margin-bottom: 12px;
}
.section-head p { color: var(--muted); }

.screens {
  padding: 40px 0 90px;
}

/* ---------- لقطات الشاشة ---------- */
.screens-track {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 30px 6px 20px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}
.screens-track::-webkit-scrollbar { height: 6px; }
.screens-track::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb), .5); border-radius: 10px; }

.phone {
  flex: 0 0 auto;
  scroll-snap-align: center;
  width: 220px;
  border-radius: 30px;
  padding: 10px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  box-shadow: 0 24px 50px -20px rgba(0,0,0,.6);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.js .phone {
  opacity: 0;
  transform: translateY(28px) scale(.96);
}
.js .phone.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.js .phone:nth-child(odd)  { transform: translateY(38px) rotate(-2.5deg) scale(.96); }
.js .phone:nth-child(even) { transform: translateY(10px) rotate(2.5deg) scale(.96); }
.js .phone.is-visible:nth-child(odd)  { transform: translateY(14px) rotate(-2.5deg); }
.js .phone.is-visible:nth-child(even) { transform: translateY(0) rotate(2.5deg); }

.phone:hover {
  transform: translateY(-10px) rotate(0deg) scale(1.04) !important;
  box-shadow: 0 30px 60px -16px rgba(var(--primary-rgb), .55);
  z-index: 3;
}

.phone-screen {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  border-radius: 22px;
  overflow: hidden;
  background: #100a0a;
  position: relative;
}
.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 18px;
  background: #0b0708;
  border-radius: 12px;
  z-index: 2;
}

/* ---------- شريط تحميل لاصق (موبايل) ---------- */
.sticky-cta {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(20, 12, 13, .85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.6);
  transition: transform .4s var(--ease);
}
.sticky-cta.show { transform: translateX(-50%) translateY(0); }
.sticky-cta img { width: 34px; height: 34px; border-radius: 9px; }
.sticky-cta .btn-primary { padding: 10px 20px; font-size: .86rem; }

/* ---------- فوتر ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 34px 0 90px;
  text-align: center;
  color: var(--muted-2);
  font-size: .85rem;
}
.footer strong { color: var(--muted); }

@media (max-width: 720px) {
  .hero { padding: 60px 0 44px; }
  .nav-inner { padding: 12px 18px; }
  .phone { width: 190px; }
  .footer { padding-bottom: 110px; }
}

@media (min-width: 721px) {
  .sticky-cta { display: none; }
}

/* ---------- ظهور تدريجي عند التمرير (يعمل فقط إذا كان الجافاسكربت مفعّلاً) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* رقم مختلط (إنجليزي) داخل نص عربي RTL بدون انعكاس */
.ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* وضوح التركيز للوحة المفاتيح */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--primary-bright);
  outline-offset: 3px;
  border-radius: 6px;
}
