/* =========================================================
   أفق — نظام التصميم (Design Tokens)
   شفافية زجاجية + تدرجات لونية عميقة
   ========================================================= */
:root {
  --bg-void: #060714;
  --grad-a: #1b1140;
  --grad-b: #3b1768;
  --grad-c: #0f4c5c;
  --accent: #a78bfa;
  --accent-2: #34d8c7;
  --text-primary: #f5f3ff;
  --text-muted: #b8b3d6;
  --glass-fill: rgba(255, 255, 255, 0.055);
  --glass-fill-strong: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 8px 32px rgba(4, 3, 20, 0.45);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Tajawal", "Segoe UI", sans-serif;
  color: var(--text-primary);
  background: var(--bg-void);
  overflow-x: hidden;
  line-height: 1.7;
}

/* -------- خلفية متدرجة عميقة بها كتل ضوئية ضبابية -------- */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-void);
  overflow: hidden;
}
.bg-scene span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.bg-scene .blob-a { width: 46vw; height: 46vw; top: -12vw; right: -10vw; background: var(--grad-b); }
.bg-scene .blob-b { width: 40vw; height: 40vw; bottom: -14vw; left: -8vw; background: var(--grad-c); }
.bg-scene .blob-c { width: 30vw; height: 30vw; top: 32vh; left: 30vw; background: var(--grad-a); opacity: 0.5; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* -------------------- عناصر زجاجية عامة -------------------- */
.glass {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--glass-shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  color: var(--bg-void);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  box-shadow: 0 10px 30px rgba(167, 139, 250, 0.28);
}
.btn-primary:hover { box-shadow: 0 14px 38px rgba(167, 139, 250, 0.4); transform: translateY(-1px); }

.btn-glass {
  color: var(--text-primary);
  background: var(--glass-fill);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn-glass:hover { background: var(--glass-fill-strong); }

.btn-block { width: 100%; }

/* -------------------------- الناف بار -------------------------- */
.nav {
  position: fixed;
  top: 18px;
  right: 50%;
  transform: translateX(50%);
  width: min(94%, 1080px);
  z-index: 50;
  border-radius: 999px;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--bg-void);
  font-size: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 15px;
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--text-primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 22px; cursor: pointer; }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}

/* -------------------------- الهيرو -------------------------- */
.hero {
  padding: 190px 0 110px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 64px);
  font-weight: 900;
  line-height: 1.18;
  max-width: 820px;
  margin: 0 auto 22px;
}
.hero p {
  max-width: 560px;
  margin: 0 auto 38px;
  color: var(--text-muted);
  font-size: 18px;
}
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------------------- قسم المميزات ---------------------- */
.section { padding: 90px 0; }
.section-head { max-width: 620px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin-bottom: 14px; }
.section-head p { color: var(--text-muted); font-size: 16px; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 900px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card {
  padding: 30px 26px;
  border-radius: var(--radius-lg);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--glass-fill-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent-2);
}
.feature-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); font-size: 15px; }

/* ------------------------ قسم التطبيق ------------------------ */
.app-section {
  padding: 26px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.app-copy { flex: 1 1 320px; }
.app-copy h2 { font-size: clamp(24px, 3.6vw, 32px); font-weight: 800; margin-bottom: 14px; }
.app-copy p { color: var(--text-muted); margin-bottom: 26px; max-width: 440px; }

.store-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.store-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
}
.store-badge small { display: block; color: var(--text-muted); font-size: 11px; font-weight: 400; }
.store-badge strong { font-size: 14px; }

.app-visual {
  flex: 0 0 auto;
  width: 190px;
  height: 300px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* ------------------------------ فوتر ------------------------------ */
.footer {
  padding: 50px 0 40px;
  border-top: 1px solid var(--glass-border);
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-links { display: flex; gap: 22px; }

/* ---------------------- صفحات الدخول / التسجيل ---------------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 20px 60px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 38px 34px;
  border-radius: var(--radius-lg);
}
.auth-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; text-align: center; }
.auth-card > p.subtitle { color: var(--text-muted); text-align: center; margin-bottom: 30px; font-size: 15px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; margin-bottom: 8px; color: var(--text-muted); }
.field input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.22);
}

.form-msg {
  font-size: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  display: none;
}
.form-msg.error { display: block; background: rgba(244, 63, 94, 0.12); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }
.form-msg.success { display: block; background: rgba(52, 216, 199, 0.12); color: var(--accent-2); border: 1px solid rgba(52, 216, 199, 0.3); }

.auth-switch { text-align: center; margin-top: 22px; font-size: 14px; color: var(--text-muted); }
.auth-switch a { color: var(--accent); font-weight: 700; }

/* --------------------------- لوحة التحكم --------------------------- */
.dash-nav {
  position: fixed;
  top: 0; right: 0; left: 0;
  z-index: 50;
  padding: 16px 0;
  border-bottom: 1px solid var(--glass-border);
}
.dash-nav .container { display: flex; align-items: center; justify-content: space-between; }
.dash-wrap { padding: 110px 0 60px; }
.dash-hello { margin-bottom: 34px; }
.dash-hello h1 { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.dash-hello p { color: var(--text-muted); }
.dash-panel { padding: 60px 30px; border-radius: var(--radius-lg); text-align: center; color: var(--text-muted); }

/* keyboard focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
