/* ==========================================================================
   صيانتي | Sianati — Landing Page Custom Styles
   يكمّل Tailwind: خطوط، أنيميشن، أنماط مركّبة، ودعم RTL
   ========================================================================== */

/* ---------- 1. الخطوط والأساسيات ---------- */
:root {
  --brand-50:  #eef3ff;
  --brand-100: #dbe5ff;
  --brand-200: #bacfff;
  --brand-300: #8fadff;
  --brand-400: #5c84ff;
  --brand-500: #2f5bff;
  --brand-600: #1b4dff;
  --brand-700: #1339cc;
  --brand-800: #122f9e;
  --brand-900: #132a76;

  --ink-900: #0a1024;
  --ink-700: #1e293b;
  --gold:    #ffb020;

  --ring: 0 0 0 1px rgb(15 23 42 / 0.06);
  --shadow-sm:  0 1px 2px rgb(15 23 42 / 0.04);
  --shadow-md:  0 8px 24px -8px rgb(15 23 42 / 0.12);
  --shadow-lg:  0 24px 48px -16px rgb(15 23 42 / 0.16);
  --shadow-brand: 0 18px 40px -12px rgb(27 77 255 / 0.45);
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
}

body {
  font-family: "IBM Plex Sans Arabic", "Tajawal", system-ui, -apple-system, sans-serif;
  background-color: #ffffff;
  color: #0a1024;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
  font-family: "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif;
  letter-spacing: -0.02em;
}

/* الأرقام دائمًا لاتينية ومحاذاة سليمة داخل RTL */
.num {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

::selection {
  background: var(--brand-600);
  color: #fff;
}

/* ---------- 2. شريط التمرير ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-400);
}

.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ---------- 3. خلفيات ونقوش ---------- */
.bg-grid {
  background-image:
    linear-gradient(to right, rgb(15 23 42 / 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(15 23 42 / 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
}

.bg-dots {
  background-image: radial-gradient(rgb(27 77 255 / 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* قناع تلاشي للأطراف */
.mask-fade-b {
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
/* هالات ضوئية */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  will-change: transform;
}

/* ---------- 4. الأزرار ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  border-radius: 0.875rem;
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.22s ease,
    background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active {
  transform: translateY(1px) scale(0.985);
}
.btn:focus-visible {
  outline: 3px solid rgb(27 77 255 / 0.35);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px -12px rgb(27 77 255 / 0.55);
}

.btn-ghost {
  background: #fff;
  color: var(--ink-900);
  box-shadow: var(--ring), var(--shadow-sm);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgb(27 77 255 / 0.28), 0 12px 28px -12px rgb(15 23 42 / 0.22);
  color: var(--brand-700);
}

/* لمعة تمر فوق الزر */
.btn-shine {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-shine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgb(255 255 255 / 0.32) 45%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.75s ease;
}
.btn-shine:hover::after {
  transform: translateX(120%);
}

/* ---------- 5. البطاقات ---------- */
.card {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: var(--ring), var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 1px rgb(27 77 255 / 0.18), var(--shadow-lg);
}

/* إطار متدرّج رفيع */
.gradient-border {
  position: relative;
  background: #fff;
  border-radius: 1.25rem;
}
.gradient-border::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgb(27 77 255 / 0.55), rgb(27 77 255 / 0) 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* توهج يتبع المؤشر */
.spotlight {
  position: relative;
  overflow: hidden;
}
.spotlight::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgb(27 77 255 / 0.1),
    transparent 68%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.spotlight:hover::before {
  opacity: 1;
}

/* ---------- 6. الهيدر ---------- */
.site-header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease,
    border-color 0.3s ease;
}
.site-header.is-stuck {
  background: rgb(255 255 255 / 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 rgb(15 23 42 / 0.07), 0 10px 30px -18px rgb(15 23 42 / 0.28);
}

/* تسطير متحرك لروابط القائمة */
.nav-link {
  position: relative;
  padding-block: 0.35rem;
}
.nav-link::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-600), var(--brand-400));
  transform: scaleX(0);
  transform-origin: inline-end;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
  transform-origin: inline-start;
}
.nav-link.is-active {
  color: var(--brand-700);
}

/* قائمة الجوال */
#mobileMenu {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#mobilePanel {
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 7. الأنيميشن ---------- */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-16px); }
}
@keyframes float-y-slow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(24px, -20px) scale(1.06); }
  66%  { transform: translate(-18px, 14px) scale(0.96); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes pulse-ring {
  0%   { transform: scale(0.85); opacity: 0.7; }
  70%  { transform: scale(1.5);  opacity: 0; }
  100% { transform: scale(1.5);  opacity: 0; }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
@keyframes progress-fill {
  from { width: 0%; }
  to   { width: var(--to, 70%); }
}

.anim-float       { animation: float-y 6s ease-in-out infinite; }
.anim-float-slow  { animation: float-y-slow 8s ease-in-out infinite; }
.anim-drift       { animation: drift 22s ease-in-out infinite; }
.delay-1 { animation-delay: 0.8s; }
.delay-2 { animation-delay: 1.6s; }
.delay-3 { animation-delay: 2.4s; }

.pulse-ring::before,
.pulse-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid currentColor;
  animation: pulse-ring 2.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.pulse-ring::after { animation-delay: 1.3s; }

/* نص متدرّج */
.text-gradient {
  background: linear-gradient(115deg, var(--brand-600) 0%, #4d7bff 45%, var(--brand-800) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 8. ظهور تدريجي عند التمرير ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal-x-start { transform: translateX(34px); }
.reveal-x-end   { transform: translateX(-34px); }
.reveal-scale   { transform: scale(0.94); }

/* ---------- 9. موك أب الجوال ---------- */
.phone {
  position: relative;
  border-radius: 2.75rem;
  background: linear-gradient(160deg, #1c2436, #070b16);
  padding: 0.6rem;
  box-shadow: 0 42px 90px -26px rgb(10 16 36 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.06) inset;
}
.phone::after {
  content: "";
  position: absolute;
  top: 0.85rem;
  left: 50%;
  transform: translateX(-50%);
  width: 5.5rem;
  height: 1.35rem;
  background: #070b16;
  border-radius: 999px;
  z-index: 5;
}
.phone-screen {
  position: relative;
  border-radius: 2.25rem;
  overflow: hidden;
  background: #f6f8fd;
  aspect-ratio: 9 / 19.2;
}
.phone-side {
  position: absolute;
  inset-inline-end: -3px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, #3b465e, #1c2436);
}

/* ---------- 10. الخطوات ---------- */
.step-line::before {
  content: "";
  position: absolute;
  top: 2.75rem;
  inset-inline-start: 50%;
  width: 100%;
  height: 2px;
  background-image: linear-gradient(90deg, rgb(27 77 255 / 0.35) 55%, transparent 0);
  background-size: 14px 2px;
  background-repeat: repeat-x;
}
@media (max-width: 1023px) {
  .step-line::before { display: none; }
}

/* ---------- 11. الأكورديون ---------- */
.faq-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.faq-item.is-open .faq-body {
  grid-template-rows: 1fr;
}
.faq-body > div {
  overflow: hidden;
}
.faq-item.is-open .faq-icon {
  transform: rotate(45deg);
  background: var(--brand-600);
  color: #fff;
}
.faq-icon {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease,
    color 0.3s ease;
}
.faq-item.is-open {
  border-color: rgb(27 77 255 / 0.3);
  box-shadow: 0 18px 40px -22px rgb(27 77 255 / 0.4);
}

/* ---------- 12. الباقات ---------- */
.plan-featured {
  background: linear-gradient(165deg, var(--brand-700), var(--ink-900) 118%);
  color: #fff;
}
.plan-featured .plan-check {
  background: rgb(255 255 255 / 0.16);
  color: #fff;
}

.billing-toggle {
  position: relative;
  isolation: isolate;
}
.billing-pill {
  position: absolute;
  z-index: -1;
  inset-block: 0.3rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-md);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), width 0.35s ease;
}

/* ---------- 13. آراء العملاء ---------- */
.testimonial-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-block: 0.5rem 1.5rem;
}
.testimonial-track > * {
  scroll-snap-align: center;
  flex: 0 0 auto;
}

/* ---------- 14. النموذج ---------- */
.field {
  width: 100%;
  border-radius: 0.875rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}
.field::placeholder { color: #94a3b8; }
.field:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgb(27 77 255 / 0.12);
}
.field:user-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgb(239 68 68 / 0.1);
}

/* ---------- 15. الفوتر ---------- */
.footer-link {
  position: relative;
  transition: color 0.22s ease, padding-inline-start 0.22s ease;
}
.footer-link:hover {
  color: #fff;
  padding-inline-start: 0.4rem;
}
.footer-link::before {
  content: "";
  position: absolute;
  inset-inline-start: -0.5rem;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand-400);
  transform: translateY(-50%) scale(0);
  transition: transform 0.22s ease;
}
.footer-link:hover::before {
  transform: translateY(-50%) scale(1);
}

/* ---------- 16. عناصر عائمة ---------- */
#backToTop {
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
#backToTop.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.9);
}

/* شريط تقدّم القراءة */
#readingBar {
  transform-origin: right center;
  transform: scaleX(0);
  transition: transform 0.1s linear;
}

/* ---------- 17. إتاحة الوصول ---------- */
.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  z-index: 100;
  transition: top 0.25s ease;
}
.skip-link:focus {
  top: 0.75rem;
}

@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;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- 18. الطباعة ---------- */
@media print {
  .site-header,
  #backToTop,
  .no-print {
    display: none !important;
  }
  body { color: #000; }
}
