/* ============================================================
   keystoneseller - Modern Design System (Persian / RTL)
   Dark premium landing + Light clean app areas
   ============================================================ */

:root {
  /* Dark landing tokens */
  --d-bg: #070b16;
  --d-bg-2: #0d1326;
  --d-surface: #121a33;
  --d-surface-2: #1a2342;
  --d-border: rgba(148, 163, 255, 0.14);
  --d-text: #eef1ff;
  --d-muted: #97a0c8;
  --d-accent: #667eea;
  --d-accent-2: #9b6bf0;
  --d-mint: #2dd4bf;
  --d-gradient: linear-gradient(135deg, #667eea 0%, #9b6bf0 55%, #38bdf8 110%);

  /* Light app tokens */
  --l-bg: #f4f6fb;
  --l-surface: #ffffff;
  --l-border: #e6eaf4;
  --l-text: #171c2e;
  --l-muted: #6c7693;
  --l-primary: #4f46e5;
  --l-primary-2: #7c3aed;
  --l-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --l-success: #10b981;
  --l-danger: #ef4444;
  --l-warning: #f59e0b;

  /* Shared */
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 34px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.16);
  --glow: 0 0 0 1px rgba(102, 126, 234, 0.25), 0 14px 44px rgba(102, 126, 234, 0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  direction: rtl;
  text-align: right;
  background: var(--d-bg);
  color: var(--d-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.8;
}

img { max-width: 100%; }
a { text-decoration: none; transition: color .25s var(--ease); }

/* ---------- Typography helpers ---------- */
.gradient-text {
  background: var(--d-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(102, 126, 234, 0.12);
  border: 1px solid rgba(102, 126, 234, 0.35);
  color: #b7c2ff;
  backdrop-filter: blur(8px);
}

/* ---------- Buttons ---------- */
.btn-modern {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  white-space: nowrap;
}
.btn-modern::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.35) 50%, transparent 75%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
}
.btn-modern:hover::after { transform: translateX(120%); }
.btn-modern:hover { transform: translateY(-3px); }

.btn-gradient { background: var(--d-gradient); color: #fff; box-shadow: 0 10px 30px rgba(102,126,234,.35); }
.btn-gradient:hover { color: #fff; box-shadow: var(--glow); }
.btn-ghost {
  background: rgba(148, 163, 255, 0.08);
  color: var(--d-text);
  border: 1px solid var(--d-border);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { color: #fff; border-color: rgba(148, 163, 255, 0.4); background: rgba(148, 163, 255, 0.14); }
.btn-lg { padding: 17px 38px; font-size: 16px; }

/* ---------- Glass navbar ---------- */
.nav-modern {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 1000;
  padding: 18px 0;
  transition: padding .35s var(--ease), background .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav-modern.scrolled {
  padding: 10px 0;
  background: rgba(7, 11, 22, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--d-border);
  box-shadow: 0 12px 40px rgba(2, 6, 18, 0.45);
}
.nav-modern .nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: #fff; }
.nav-brand img { width: 44px; height: 44px; border-radius: 12px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  position: relative;
  color: var(--d-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 100px;
  transition: color .25s var(--ease), background .25s var(--ease);
}
.nav-links a:hover { color: #fff; background: rgba(148, 163, 255, 0.1); }
.nav-links a.active { color: #fff; background: rgba(102, 126, 234, 0.18); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

.nav-burger { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--d-border); background: rgba(148,163,255,.08); color: #fff; font-size: 18px; cursor: pointer; }
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(7, 11, 22, 0.96);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease);
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a { color: #fff; font-size: 22px; font-weight: 600; padding: 14px 20px; }
.mobile-menu a:hover { color: #b7c2ff; }
.mobile-menu .close-mobile { position: absolute; top: 24px; inset-inline-start: 24px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--d-border); background: transparent; color: #fff; font-size: 22px; cursor: pointer; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .nav-actions .hide-sm { display: none; }
}

/* ---------- Hero ---------- */
.hero-modern {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 90px;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(102, 126, 234, 0.28), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(155, 107, 240, 0.24), transparent 60%),
    radial-gradient(1000px 700px at 50% 110%, rgba(56, 189, 248, 0.12), transparent 60%),
    var(--d-bg);
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 40%, transparent 75%);
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: float-orb 12s ease-in-out infinite;
  pointer-events: none;
}
.hero-orb.o1 { width: 380px; height: 380px; top: -120px; inset-inline-start: -100px; background: #667eea; }
.hero-orb.o2 { width: 300px; height: 300px; bottom: 5%; inset-inline-end: -80px; background: #9b6bf0; animation-delay: -4s; }
.hero-orb.o3 { width: 200px; height: 200px; top: 40%; inset-inline-start: 45%; background: #38bdf8; opacity: 0.3; animation-delay: -8s; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 100px;
  background: rgba(102, 126, 234, 0.12);
  border: 1px solid rgba(102, 126, 234, 0.35);
  color: #b7c2ff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 26px;
  backdrop-filter: blur(8px);
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--d-mint);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.2);
  animation: pulse-dot 2s ease-in-out infinite;
}
.hero-title {
  font-size: clamp(34px, 5.4vw, 66px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 22px;
}
.hero-sub {
  color: var(--d-muted);
  font-size: clamp(16px, 1.6vw, 19px);
  max-width: 620px;
  line-height: 2;
  margin-bottom: 34px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 54px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 560px;
  border-top: 1px solid var(--d-border);
  padding-top: 30px;
}
.hero-stat b { display: block; font-size: 30px; font-weight: 800; color: #fff; }
.hero-stat span { color: var(--d-muted); font-size: 13px; }
@media (max-width: 640px) { .hero-stats { grid-template-columns: 1fr; } }

.hero-visual { position: relative; }
.hero-visual .glass-panel {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 28px;
  background: linear-gradient(160deg, rgba(148, 163, 255, 0.1), rgba(148, 163, 255, 0.03));
  border: 1px solid var(--d-border);
  backdrop-filter: blur(14px);
  box-shadow: 0 40px 90px rgba(2, 6, 18, 0.5);
  animation: float-y 7s ease-in-out infinite;
}
.hero-visual .glass-panel .bar { height: 10px; border-radius: 6px; background: rgba(148,163,255,.14); margin-bottom: 12px; }
.hero-visual .glass-panel .bar.short { width: 55%; }
.hero-visual .glass-panel .mini-row { display: flex; gap: 10px; margin-top: 18px; }
.hero-visual .glass-panel .mini-card {
  flex: 1; height: 86px; border-radius: 12px;
  background: linear-gradient(135deg, #1a2342, #232e5c);
  border: 1px solid rgba(148, 163, 255, 0.12);
  animation: float-y 5s ease-in-out infinite;
}
.hero-visual .glass-panel .mini-card:nth-child(2) { animation-delay: -2s; }
.hero-visual .glass-panel .mini-card:nth-child(3) { animation-delay: -4s; }
.float-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(18, 26, 51, 0.85);
  border: 1px solid var(--d-border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  animation: float-y 6s ease-in-out infinite;
}
.float-chip .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--d-gradient); font-size: 14px; }
.float-chip.c1 { top: -26px; inset-inline-end: 8%; animation-delay: -2s; }
.float-chip.c2 { bottom: -22px; inset-inline-start: 6%; animation-delay: -4s; }

/* ---------- Sections ---------- */
.section-modern { position: relative; padding: 110px 0; }
.section-head { max-width: 640px; margin: 0 auto 60px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 42px); font-weight: 800; margin: 16px 0 12px; }
.section-head p { color: var(--d-muted); font-size: 16px; }

/* ---------- Feature cards ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.feature-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 34px 28px;
  background: linear-gradient(160deg, rgba(148, 163, 255, 0.08), rgba(148, 163, 255, 0.02));
  border: 1px solid var(--d-border);
  overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--d-gradient);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease);
}
.feature-card:hover::before { transform: scaleX(1); }
.feature-card:hover { transform: translateY(-10px); border-color: rgba(148, 163, 255, 0.35); box-shadow: 0 24px 60px rgba(2, 6, 18, 0.5); }
.feature-icon {
  width: 60px; height: 60px; border-radius: 16px;
  display: grid; place-items: center;
  font-size: 24px;
  background: var(--d-gradient);
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.35);
  transition: transform .4s var(--ease);
}
.feature-emoji { font-size: 26px; line-height: 1; }
.feature-card:hover .feature-icon { transform: rotate(-8deg) scale(1.08); }
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--d-muted); font-size: 14px; margin: 0; }
@media (max-width: 960px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.step-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  transition: transform .4s var(--ease), border-color .4s var(--ease);
}
.step-card:hover { transform: translateY(-8px); border-color: rgba(148, 163, 255, 0.35); }
.step-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  color: #38bdf8;
  background: linear-gradient(145deg, rgba(37, 99, 235, .22), rgba(14, 165, 233, .08));
  border: 1px solid rgba(56, 189, 248, .3);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(14, 165, 233, .13), inset 0 1px 0 rgba(255,255,255,.1);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.step-icon .ks-local-icon { width: 29px; height: 29px; fill: #38bdf8; stroke: #38bdf8; }
.step-card:hover .step-icon { transform: translateY(-3px) rotate(-4deg); box-shadow: 0 16px 34px rgba(14,165,233,.22); }
.step-card .num { font-size: 13px; font-weight: 700; color: #b7c2ff; }
.step-card h3 { font-size: 18px; font-weight: 700; margin: 8px 0 10px; }
.step-card p { color: var(--d-muted); font-size: 14px; margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Stats band ---------- */
.stats-band {
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  background:
    radial-gradient(600px 300px at 10% 0%, rgba(102,126,234,.25), transparent 60%),
    radial-gradient(600px 300px at 90% 100%, rgba(155,107,240,.22), transparent 60%),
    var(--d-surface);
  border: 1px solid var(--d-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  text-align: center;
}
.stats-band .s b { font-size: 40px; font-weight: 900; }
.stats-band .s span { color: var(--d-muted); font-size: 14px; }
@media (max-width: 760px) { .stats-band { grid-template-columns: 1fr 1fr; } }

/* ---------- Templates showcase ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.tpl-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
}
.tpl-card:hover { transform: translateY(-12px) scale(1.01); border-color: rgba(148, 163, 255, 0.4); box-shadow: 0 30px 70px rgba(2, 6, 18, 0.55); }
.tpl-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.tpl-thumb .tpl-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--ease); }
.tpl-thumb .tpl-slide.active { opacity: 1; }
.tpl-card:hover .tpl-thumb img.active { transform: scale(1.12); }
.tpl-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--d-surface), transparent 55%);
  z-index: 2;
  pointer-events: none;
}
.tpl-card .tpl-body { padding: 20px 22px 24px; }
.tpl-card .tpl-body h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.tpl-card .tpl-body p { color: var(--d-muted); font-size: 13px; margin: 0; }
.tpl-card .tpl-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px 18px; border-top: 1px solid var(--d-border); font-size: 13px; color: var(--d-muted); }
.tpl-card .tpl-foot .tpl-cat { color: var(--d-accent); font-weight: 600; }
.tpl-rating { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--d-muted); }
.tpl-rating .stars { display: inline-flex; gap: 2px; letter-spacing: 1px; }
.tpl-rating .stars .fa-star { color: #fbbf24; }
.tpl-rating .stars .fa-star.off { color: rgba(148, 163, 255, 0.25); }
.tpl-rating .avg { font-weight: 700; color: #fbbf24; }
.tpl-rating .cnt { font-size: 11px; }
.tpl-badge {
  position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2;
  padding: 5px 12px; border-radius: 50px; font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, var(--d-accent), #764ba2); color: #fff;
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.45);
}
.tpl-price {
  position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2;
  padding: 5px 14px; border-radius: 50px; font-size: 12px; font-weight: 700;
  background: rgba(255, 159, 67, 0.92); color: #fff; backdrop-filter: blur(4px);
}
.tpl-price.free { background: rgba(46, 204, 113, 0.92); }
.tpl-overlay {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(7, 11, 22, 0.2) 0%, rgba(7, 11, 22, 0.75) 100%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.tpl-card:hover .tpl-overlay { opacity: 1; }
.tpl-preview {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 50px; font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px); transition: background .25s var(--ease), transform .25s var(--ease);
}
.tpl-preview:hover { background: rgba(255, 255, 255, 0.25); transform: translateY(-2px); }
@media (max-width: 960px) { .tpl-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .tpl-grid { grid-template-columns: 1fr; } }

/* ---------- Testimonials ---------- */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.testi-card {
  border-radius: var(--radius-lg);
  padding: 30px;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  transition: transform .4s var(--ease), border-color .4s var(--ease);
}
.testi-card:hover { transform: translateY(-8px); border-color: rgba(148, 163, 255, 0.35); }
.testi-card .stars { color: #fbbf24; margin-bottom: 14px; }
.testi-card p { color: #c6cdee; font-size: 15px; line-height: 2; }
.testi-card .who { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.testi-card .who .av {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--d-gradient);
  color: #fff; font-weight: 800; font-size: 15px;
}
.testi-card .who b { display: block; font-size: 14px; }
.testi-card .who span { color: var(--d-muted); font-size: 12px; }
@media (max-width: 960px) { .testi-grid { grid-template-columns: 1fr; } }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; align-items: stretch; }
.price-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 38px 30px;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  display: flex;
  flex-direction: column;
  transition: transform .4s var(--ease), border-color .4s var(--ease);
}
.price-card.popular {
  border-color: transparent;
  background: linear-gradient(160deg, rgba(102,126,234,.16), rgba(155,107,240,.08)) padding-box,
              var(--d-gradient) border-box;
  transform: scale(1.04);
  box-shadow: 0 30px 80px rgba(102, 126, 234, 0.28);
}
.price-card .tag {
  position: absolute; top: -13px; inset-inline-start: 50%;
  transform: translateX(-50%);
  background: var(--d-gradient);
  color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 5px 16px;
  border-radius: 100px;
}
.price-card h3 { font-size: 17px; font-weight: 700; }
.price-card .amount { font-size: 44px; font-weight: 900; margin: 14px 0 4px; }
.price-card .amount small { font-size: 14px; color: var(--d-muted); font-weight: 500; }
.price-card ul { list-style: none; margin: 22px 0 28px; padding: 0; flex: 1; }
.price-card ul li { padding: 9px 0; color: #c6cdee; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.price-card ul li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--d-mint); font-size: 13px; }
.price-card ul li.no::before { content: '\f00d'; color: #f87171; }
@media (max-width: 900px) { .price-grid { grid-template-columns: 1fr; } .price-card.popular { transform: none; } }

/* ---------- FAQ ---------- */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  border-radius: var(--radius-md);
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  overflow: hidden;
  transition: border-color .3s var(--ease);
}
.faq-item.open { border-color: rgba(148, 163, 255, 0.4); }
.faq-q {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--d-text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  text-align: right;
}
.faq-q .fa { transition: transform .35s var(--ease); color: var(--d-accent); }
.faq-item.open .fa-chevron-down { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); }
.faq-a p { padding: 0 22px 22px; color: var(--d-muted); font-size: 14px; margin: 0; }

/* ---------- CTA ---------- */
.cta-band {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 70px 50px;
  text-align: center;
  overflow: hidden;
  background: var(--d-gradient);
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: repeating-linear-gradient(45deg, transparent 0 24px, rgba(255,255,255,.05) 24px 48px);
}
.cta-band h2 { font-size: clamp(26px, 3vw, 40px); font-weight: 800; color: #fff; position: relative; }
.cta-band p { color: rgba(255,255,255,.85); margin: 14px auto 30px; max-width: 520px; position: relative; }
.cta-band .btn-white {
  position: relative;
  background: #fff; color: #4f46e5;
}
.cta-band .btn-white:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,.25); color: #4f46e5; }

/* ---------- Footer ---------- */
.footer-modern { border-top: 1px solid var(--d-border); padding: 80px 0 0; background: var(--d-bg-2); }
.footer-modern .f-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 50px; }
.footer-modern h4 { font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.footer-modern ul { list-style: none; margin: 0; padding: 0; }
.footer-modern ul li { margin-bottom: 12px; }
.footer-modern ul a { color: var(--d-muted); font-size: 14px; }
.footer-modern ul a:hover { color: #fff; }
.footer-modern p { color: var(--d-muted); font-size: 14px; }
.footer-modern .f-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-modern .f-social a {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(148,163,255,.1);
  border: 1px solid var(--d-border);
  color: var(--d-muted);
  transition: all .3s var(--ease);
}
.footer-modern .f-social a:hover { background: var(--d-gradient); color: #fff; transform: translateY(-3px); }
.footer-modern .f-bottom {
  border-top: 1px solid var(--d-border);
  padding: 24px 0;
  color: var(--d-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-modern .f-trust {
  border-top: 1px solid var(--d-border);
  padding-top: 24px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-modern .f-trust a, .footer-modern .f-trust div {
  display: inline-block;
}
.footer-modern .f-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}
.footer-modern .f-contact span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--d-muted);
  font-size: 13px;
  direction: rtl;
}
.footer-modern .f-contact i {
  color: #a5b4fc;
  font-size: 13px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.footer-modern .f-contact span a { color: var(--d-muted); }
.footer-modern .f-contact span a:hover { color: #fff; }
@media (max-width: 860px) { .footer-modern .f-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-modern .f-grid { grid-template-columns: 1fr; } }

/* Balanced footer spacing and contact-brand alignment. */
.footer-modern { padding-top: 48px; }
.footer-modern .f-grid { gap: 40px 38px; padding-bottom: 38px; align-items: start; }
.footer-modern .f-brand-column,
.footer-modern .f-grid > div:first-child { align-self: start; min-width: 0; }
.footer-modern .footer-brand-link,
.footer-modern .f-grid > div:first-child > .nav-brand {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 18px auto;
  transform: translateY(-7px);
}
.footer-modern .f-brand-column > p,
.footer-modern .f-grid > div:first-child > p { margin: 0 0 16px; line-height: 1.85; }
.footer-modern .f-contact { margin-top: 22px; gap: 11px; }
.footer-modern .f-contact span { line-height: 1.7; }
.footer-modern h4 { margin-bottom: 20px; }
.footer-modern ul li { margin-bottom: 13px; }
.category-chips .active { color: #fff !important; -webkit-text-fill-color: #fff !important; }
@media (max-width: 860px) {
  .footer-modern { padding-top: 42px; }
  .footer-modern .f-grid { gap: 34px 30px; padding-bottom: 34px; }
}
@media (max-width: 560px) {
  .footer-modern { padding-top: 36px; }
  .footer-modern .f-grid { gap: 28px; padding-bottom: 30px; }
  .footer-modern .footer-brand-link,
  .footer-modern .f-grid > div:first-child > .nav-brand { margin-inline-start: auto; margin-inline-end: 0; }
}

/* ---------- Scroll reveal animations ---------- */
.reveal, .reveal-up, .reveal-left, .reveal-right, .reveal-scale {
  opacity: 0;
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: calc(var(--reveal-delay, 0) * 70ms);
  will-change: opacity, transform;
}
.reveal { transform: translateY(28px); }
.reveal-up { transform: translateY(48px); }
.reveal-left { transform: translateX(48px); }
.reveal-right { transform: translateX(-48px); }
.reveal-scale { transform: scale(0.92); }
.in-view { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -50px) scale(1.15); }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Marquee ---------- */
.marquee-wrap { overflow: hidden; position: relative; }
.marquee-track { display: flex; direction:ltr; gap: 0; width: max-content; will-change: transform; }
.marquee-track.marquee-ready { animation: marquee-rtl var(--marquee-duration, 24s) linear infinite; }
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
.marquee-track .item { direction:rtl; margin-inline:20px; }
@keyframes marquee-rtl { from { transform: translateX(0); } to { transform: translateX(var(--marquee-shift)); } }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
.marquee-group { display:flex; direction:ltr; flex:0 0 auto; gap:0; }

/* ---------- Light / App area overrides ---------- */
.app-shell {
  background: var(--l-bg);
  color: var(--l-text);
  min-height: 100vh;
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  padding-top: 96px;
}
.app-shell .gradient-text { background: var(--l-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }

/* ---------- App topbar ---------- */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--l-border);
}
.app-topbar .container { min-height: 66px; }
.app-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--l-text); font-weight: 800; font-size: 18px; }
.app-brand img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.app-nav li a {
  color: #475569; font-weight: 600; font-size: 14px; text-decoration: none;
  padding: 8px 14px; border-radius: 10px; transition: all .25s var(--ease);
}
.app-nav li a:hover { color: var(--l-primary); background: rgba(79, 70, 229, 0.08); }
.btn-app {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 100px; font-size: 13px; font-weight: 700;
  text-decoration: none; transition: all .25s var(--ease); border: none; cursor: pointer;
}
.btn-app-ghost { background: #f1f5f9; color: #475569; }
.btn-app-ghost:hover { background: #e2e8f0; color: var(--l-text); }
.btn-app-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-app-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3); }

.app-mobile-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--l-border);
}
.app-mobile-nav a {
  white-space: nowrap;
  font-size: 13px; font-weight: 600; color: #475569;
  text-decoration: none;
  background: #f1f5f9; padding: 7px 14px; border-radius: 100px;
  transition: all .25s var(--ease);
}
.app-mobile-nav a:hover { background: rgba(79, 70, 229, 0.1); color: var(--l-primary); }

.app-main { flex: 1; }

.app-footer {
  border-top: 1px solid var(--l-border);
  background: #fff;
  padding: 20px 0;
  color: #94a3b8;
  font-size: 13px;
  margin-top: 40px;
}

.app-card {
  background: var(--l-surface);
  border: 1px solid var(--l-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.app-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: 100px;
  font-weight: 700; font-size: 14px; border: none; cursor: pointer;
  background: var(--l-gradient); color: #fff;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.app-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(79, 70, 229, 0.3); color: #fff; }
.app-btn.ghost { background: var(--l-surface); color: var(--l-primary); border: 1px solid var(--l-border); }
.app-btn.ghost:hover { border-color: var(--l-primary); color: var(--l-primary); }
.app-btn.danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.app-btn.success { background: linear-gradient(135deg, #10b981, #059669); }

/* Utility */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* ============================================================
   DAY / NIGHT THEME
   Default = dark (matches system via pre-paint script).
   html[data-theme="light"] switches the landing to light,
   html[data-theme="dark"] switches app areas to dark.
   ============================================================ */

/* ---------- Theme toggle button ---------- */
.theme-toggle {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--d-border);
  background: rgba(148, 163, 255, 0.08);
  color: var(--d-text);
  font-size: 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.theme-toggle:hover { border-color: rgba(148, 163, 255, 0.45); background: rgba(148, 163, 255, 0.16); transform: translateY(-2px); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline-flex; }
html[data-theme="light"] .theme-toggle { border-color: var(--l-border); background: #fff; color: #475569; box-shadow: var(--shadow-sm); }
html[data-theme="light"] .theme-toggle .icon-sun { display: inline-flex; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ---------- Background images (hero + sections) ---------- */
.bg-hero-1 { background-image: url('../images/backgrounds/bg-2.jpg'); }
.bg-hero-2 { background-image: url('../images/backgrounds/bg-3.jpg'); }
.bg-hero-3 { background-image: url('../images/backgrounds/bg-4.jpg'); }
.bg-hero-4 { background-image: url('../images/backgrounds/bg-1.jpg'); }

.hero-modern {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(102, 126, 234, 0.5), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(155, 107, 240, 0.42), transparent 60%),
    linear-gradient(rgba(7, 11, 22, 0.72), rgba(7, 11, 22, 0.82)),
    url('../images/backgrounds/bg-2.jpg') center / cover no-repeat;
}

html[data-theme="light"] {
  /* Landing tokens → light */
  --d-bg: #f4f6fb;
  --d-bg-2: #eef0ff;
  --d-surface: #ffffff;
  --d-surface-2: #eef1ff;
  --d-border: rgba(79, 70, 229, 0.14);
  --d-text: #171c2e;
  --d-muted: #5b6478;
  --d-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #2563eb 110%);
  --shadow-sm: 0 2px 10px rgba(30, 41, 82, 0.06);
  --shadow-md: 0 10px 34px rgba(30, 41, 82, 0.1);
  --shadow-lg: 0 24px 70px rgba(30, 41, 82, 0.14);

  /* App tokens stay light */
  --l-bg: #f4f6fb;
  --l-surface: #ffffff;
  --l-border: #e6eaf4;
  --l-text: #171c2e;
  --l-muted: #6c7693;
  --l-primary: #4f46e5;
  --l-primary-2: #7c3aed;
  --l-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

  /* Landing background with light overlay */
}
html[data-theme="light"] body { background: var(--d-bg); color: var(--d-text); }
html[data-theme="light"] .hero-modern {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(102, 126, 234, 0.22), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(155, 107, 240, 0.18), transparent 60%),
    linear-gradient(rgba(244, 246, 251, 0.82), rgba(244, 246, 251, 0.9)),
    url('../images/backgrounds/bg-2.jpg') center / cover no-repeat;
}
html[data-theme="light"] .hero-badge { color: var(--l-primary); border-color: rgba(79, 70, 229, 0.35); background: rgba(79, 70, 229, 0.08); }
html[data-theme="light"] .hero-badge .dot { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2); }
html[data-theme="light"] .hero-stat b { color: var(--l-text); }
html[data-theme="light"] .eyebrow-pill { color: var(--l-primary); border-color: rgba(79, 70, 229, 0.35); background: rgba(79, 70, 229, 0.08); }

html[data-theme="light"] .nav-modern.scrolled { background: rgba(255, 255, 255, 0.82); border-bottom: 1px solid var(--l-border); box-shadow: 0 12px 40px rgba(30, 41, 82, 0.1); }
html[data-theme="light"] .nav-brand { color: var(--l-text); }
html[data-theme="light"] .nav-links a { color: var(--l-muted); }
html[data-theme="light"] .nav-links a:hover { color: var(--l-text); background: rgba(79, 70, 229, 0.08); }
html[data-theme="light"] .nav-links a.active { color: var(--l-primary); background: rgba(79, 70, 229, 0.12); }
html[data-theme="light"] .nav-burger { border-color: var(--l-border); background: #fff; color: var(--l-text); }
html[data-theme="light"] .mobile-menu { background: rgba(255, 255, 255, 0.97); }
html[data-theme="light"] .mobile-menu a { color: var(--l-text); }
html[data-theme="light"] .mobile-menu a:hover { color: var(--l-primary); }
html[data-theme="light"] .mobile-menu .close-mobile { border-color: var(--l-border); color: var(--l-text); }

/* App pages (dashboard, profile, projects): navbar always solid so links stay readable at top of page */
body.app-page .nav-modern {
  background: rgba(244, 246, 251, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--l-border);
  box-shadow: 0 12px 40px rgba(30, 41, 82, 0.08);
}
html[data-theme="dark"] body.app-page .nav-modern { background: rgba(13, 19, 38, 0.85); }

html[data-theme="light"] .btn-ghost { background: #fff; color: var(--l-text); border-color: var(--l-border); }
html[data-theme="light"] .btn-ghost:hover { color: var(--l-primary); border-color: rgba(79, 70, 229, 0.4); background: rgba(79, 70, 229, 0.06); }
html[data-theme="light"] .btn-gradient { color: #fff; }
html[data-theme="light"] .gradient-text { background: var(--l-gradient); -webkit-background-clip: text; background-clip: text; }

html[data-theme="light"] .hero-visual .glass-panel { background: rgba(255, 255, 255, 0.72); border-color: var(--l-border); box-shadow: 0 40px 90px rgba(30, 41, 82, 0.14); }
html[data-theme="light"] .hero-visual .glass-panel .bar { background: rgba(79, 70, 229, 0.12); }
html[data-theme="light"] .hero-visual .glass-panel .mini-card { background: linear-gradient(135deg, #eef1ff, #e0e7ff); border-color: rgba(79, 70, 229, 0.12); }
html[data-theme="light"] .float-chip { background: rgba(255, 255, 255, 0.9); border-color: var(--l-border); color: var(--l-text); box-shadow: var(--shadow-md); }

html[data-theme="light"] .feature-card { background: #fff; border-color: var(--l-border); }
html[data-theme="light"] .feature-card:hover { border-color: rgba(79, 70, 229, 0.35); box-shadow: 0 24px 60px rgba(30, 41, 82, 0.12); }
html[data-theme="light"] .feature-card p { color: var(--l-muted); }
html[data-theme="light"] .step-card { background: var(--l-surface); border-color: var(--l-border); }
html[data-theme="light"] .step-card .num { color: var(--l-primary); }
html[data-theme="light"] .step-icon {
  color: #2563eb;
  background: linear-gradient(145deg, rgba(219,234,254,.95), rgba(239,246,255,.9));
  border-color: rgba(37,99,235,.22);
  box-shadow: 0 10px 24px rgba(37,99,235,.1), inset 0 1px 0 #fff;
}
html[data-theme="light"] .step-icon .ks-local-icon { fill: #2563eb; stroke: #2563eb; }
html[data-theme="light"] .step-card p { color: var(--l-muted); }
html[data-theme="light"] .stats-band { background: linear-gradient(160deg, #fff, #eef0ff); border-color: var(--l-border); }
html[data-theme="light"] .stats-band .s span { color: var(--l-muted); }
html[data-theme="light"] .tpl-card { background: var(--l-surface); border-color: var(--l-border); }
html[data-theme="light"] .tpl-card:hover { box-shadow: 0 30px 70px rgba(30, 41, 82, 0.14); }
html[data-theme="light"] .tpl-card .tpl-body p { color: var(--l-muted); }
html[data-theme="light"] .tpl-card .tpl-foot { border-top-color: var(--l-border); color: var(--l-muted); }
html[data-theme="light"] .tpl-rating { color: var(--l-muted); }
html[data-theme="light"] .tpl-rating .stars .fa-star.off { color: #d3d8e6; }
html[data-theme="light"] .tpl-thumb::after { background: linear-gradient(0deg, #fff, transparent 55%); }
html[data-theme="light"] .tpl-overlay { background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(15, 23, 42, 0.55) 100%); }
html[data-theme="light"] .testi-card { background: var(--l-surface); border-color: var(--l-border); }
html[data-theme="light"] .testi-card p { color: var(--l-text); }
html[data-theme="light"] .testi-card .who span { color: var(--l-muted); }
html[data-theme="light"] .price-card { background: var(--l-surface); border-color: var(--l-border); }
html[data-theme="light"] .price-card ul li { color: var(--l-text); }
html[data-theme="light"] .faq-item { background: var(--l-surface); border-color: var(--l-border); }
html[data-theme="light"] .faq-a p { color: var(--l-muted); }
html[data-theme="light"] .footer-modern { background: var(--l-bg-2, #eef0ff); }
html[data-theme="light"] .footer-modern ul a:hover { color: var(--l-text); }
html[data-theme="light"] .footer-modern .f-social a { background: #fff; border-color: var(--l-border); color: var(--l-muted); }
html[data-theme="light"] .client-marquee { border-block-color: var(--l-border); }

/* ---------- App areas in dark mode ---------- */
html[data-theme="dark"] {
  --l-bg: #0d1326;
  --l-surface: #141a33;
  --l-border: rgba(148, 163, 255, 0.14);
  --l-text: #eef1ff;
  --l-muted: #97a0c8;
  --l-primary: #667eea;
  --l-primary-2: #9b6bf0;
  --l-gradient: linear-gradient(135deg, #667eea 0%, #9b6bf0 100%);
}
html[data-theme="dark"] .app-shell { background: var(--l-bg); color: var(--l-text); }
html[data-theme="dark"] .app-topbar { background: rgba(13, 19, 38, 0.85); border-bottom-color: var(--l-border); }
html[data-theme="dark"] .app-brand { color: var(--l-text); }
html[data-theme="dark"] .app-nav li a { color: var(--l-muted); }
html[data-theme="dark"] .app-nav li a:hover { color: var(--l-text); background: rgba(102, 126, 234, 0.14); }
html[data-theme="dark"] .btn-app-ghost { background: var(--l-surface); color: var(--l-muted); }
html[data-theme="dark"] .btn-app-ghost:hover { background: var(--l-surface-2, #1a2342); color: var(--l-text); }
html[data-theme="dark"] .app-mobile-nav { background: var(--l-surface); border-bottom-color: var(--l-border); }
html[data-theme="dark"] .app-mobile-nav a { background: var(--l-surface-2, #1a2342); color: var(--l-muted); }
html[data-theme="dark"] .app-mobile-nav a:hover { color: var(--l-primary); background: rgba(102, 126, 234, 0.14); }
html[data-theme="dark"] .app-footer { background: var(--l-surface); border-top-color: var(--l-border); color: var(--l-muted); }
html[data-theme="dark"] .app-card { background: var(--l-surface); border-color: var(--l-border); }
html[data-theme="dark"] .app-btn.ghost { background: var(--l-surface); color: var(--l-primary); border-color: var(--l-border); }
html[data-theme="dark"] .app-btn.ghost:hover { border-color: var(--l-primary); }
html[data-theme="light"] .app-shell { background: var(--l-bg); color: var(--l-text); }

/* Focused visual refinements: hero artwork and auth surfaces. */
.hero-visual {
  isolation: isolate;
  padding: 28px;
  border-radius: 34px;
}
.hero-visual::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -2;
  border-radius: 38px;
  background:
    linear-gradient(rgba(102,126,234,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102,126,234,.08) 1px, transparent 1px),
    radial-gradient(circle at 20% 18%, rgba(56,189,248,.34), transparent 32%),
    radial-gradient(circle at 82% 74%, rgba(124,58,237,.32), transparent 38%),
    linear-gradient(145deg, rgba(8,124,240,.18), rgba(12,17,35,.58)),
    url('../images/hero/ai-eye.png') center / cover no-repeat;
  background-size: 34px 34px, 34px 34px, auto, auto, auto, cover;
  border: 1px solid rgba(148,163,255,.2);
  box-shadow: 0 28px 80px rgba(3,8,24,.32);
  opacity: .92;
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: -1;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,.08), transparent 55%);
  pointer-events: none;
}
.hero-visual .glass-panel {
  background: rgba(10,18,43,.48);
  border-color: rgba(148,163,255,.16);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
}
html[data-theme="light"] .hero-visual::before {
  background:
    linear-gradient(rgba(79,70,229,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,70,229,.07) 1px, transparent 1px),
    radial-gradient(circle at 18% 18%, rgba(14,165,233,.3), transparent 34%),
    radial-gradient(circle at 82% 76%, rgba(124,58,237,.24), transparent 38%),
    linear-gradient(145deg, rgba(224,231,255,.76), rgba(255,255,255,.38)),
    url('../images/hero/ai-eye.png') center / cover no-repeat;
  background-size: 34px 34px, 34px 34px, auto, auto, auto, cover;
  border-color: rgba(79,70,229,.18);
  box-shadow: 0 28px 70px rgba(30,41,82,.18);
  opacity: .78;
}
html[data-theme="light"] .hero-visual .glass-panel {
  background: rgba(255,255,255,.5);
  border-color: rgba(79,70,229,.13);
  backdrop-filter: blur(15px) saturate(115%);
}

.login-wrapper, .register-wrapper {
  align-self: center;
  margin: 24px;
  width: calc(50% - 48px) !important;
  flex: 0 0 calc(50% - 48px) !important;
  max-width: none !important;
  max-height: calc(100vh - 48px);
  border-radius: 26px;
  border: 1px solid rgba(79,70,229,.16);
  background: rgba(255,255,255,.92) !important;
  box-shadow: 0 26px 70px rgba(30,41,82,.2);
  overflow-y: auto;
  overflow-x: hidden;
}
.login-header, .register-header {
  margin: 0 28px 18px;
  padding: 22px 20px 18px !important;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(79,70,229,.1), rgba(14,165,233,.08));
  border: 1px solid rgba(79,70,229,.14);
}
.login-header .system-name, .register-header .system-name {
  color: #312e81 !important;
  font-size: 22px !important;
  font-weight: 900 !important;
}
.login-form, .register-form {
  margin-inline: 0;
  width: 100% !important;
  max-width: none !important;
  padding: 22px !important;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e3e8f3;
  box-shadow: 0 14px 36px rgba(30,41,82,.08);
}
.sms-otp-btn {
  display: flex !important;
  justify-content: center;
  margin-top: 10px;
  text-decoration: none;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.24) !important;
  background: linear-gradient(135deg,#4338ca,#2563eb) !important;
}
.sms-otp-btn:hover { color:#fff !important; filter:brightness(1.08); }
body:has(.login-container) .login-btn.sms-otp-btn,
body:has(.login-container) .login-btn.sms-otp-btn *,
body:has(.login-container) .login-form > a.login-btn,
body:has(.login-container) .login-form > a.login-btn * {
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

/* Auth navbar stays present and readable over both halves. */
body:has(.login-container) .nav-modern,
body:has(.register-container) .nav-modern {
  display:block !important;
  padding:8px 0 !important;
  background:rgba(4,12,30,.86) !important;
  border-bottom:1px solid rgba(148,163,255,.2) !important;
  box-shadow:0 12px 34px rgba(2,6,23,.24) !important;
  backdrop-filter:blur(18px) saturate(130%);
  -webkit-backdrop-filter:blur(18px) saturate(130%);
}
body:has(.login-container) .nav-brand,
body:has(.register-container) .nav-brand,
body:has(.login-container) .nav-links a,
body:has(.register-container) .nav-links a {
  color:#f8fafc !important;
  opacity:1 !important;
  text-shadow:0 1px 10px rgba(0,0,0,.35);
}
body:has(.login-container) .nav-links a:hover,
body:has(.register-container) .nav-links a:hover,
body:has(.login-container) .nav-links a.active,
body:has(.register-container) .nav-links a.active {
  color:#fff !important;
  background:rgba(85,173,255,.16) !important;
}
body:has(.login-container) .nav-modern .btn-ghost,
body:has(.register-container) .nav-modern .btn-ghost {
  color:#fff !important;
  background:linear-gradient(135deg,#7c3aed,#2563eb) !important;
  border-color:rgba(255,255,255,.25) !important;
  box-shadow:0 8px 22px rgba(37,99,235,.28) !important;
}
body:has(.login-container) .theme-toggle,
body:has(.register-container) .theme-toggle {
  color:#fff !important;
  background:rgba(255,255,255,.08) !important;
  border-color:rgba(255,255,255,.22) !important;
  box-shadow:none !important;
}
body:has(.login-container) .login-container,
body:has(.register-container) .register-container { padding-top:72px; }
html[data-theme="light"] body:has(.login-container) .login-wrapper,
html[data-theme="light"] body:has(.register-container) .register-wrapper {
  background:linear-gradient(155deg,rgba(255,255,255,.98),rgba(238,242,255,.96)) !important;
  border-color:rgba(99,102,241,.3) !important;
  box-shadow:0 28px 80px rgba(49,46,129,.2) !important;
}
html[data-theme="light"] body:has(.login-container) .login-form,
html[data-theme="light"] body:has(.register-container) .register-form {
  background:rgba(255,255,255,.98) !important;
  border-color:rgba(99,102,241,.2) !important;
  box-shadow:0 16px 42px rgba(79,70,229,.11) !important;
}
html[data-theme="dark"] .login-wrapper,
html[data-theme="dark"] .register-wrapper {
  background: rgba(8,18,38,.94) !important;
  border-color: rgba(85,173,255,.2);
  box-shadow: 0 28px 80px rgba(0,0,0,.48);
}
html[data-theme="dark"] .login-header,
html[data-theme="dark"] .register-header {
  background: linear-gradient(135deg,rgba(8,124,240,.18),rgba(49,46,129,.18));
  border-color: rgba(85,173,255,.18);
}
html[data-theme="dark"] .login-header .system-name,
html[data-theme="dark"] .register-header .system-name { color:#e0e7ff !important; }
html[data-theme="dark"] .login-form,
html[data-theme="dark"] .register-form {
  background: rgba(10,26,44,.86);
  border-color: rgba(85,173,255,.16);
  box-shadow: 0 16px 42px rgba(0,0,0,.3);
}
@media (max-width: 900px) {
  .login-wrapper, .register-wrapper { margin:14px; width:calc(100% - 28px) !important; flex-basis:calc(100% - 28px) !important; max-height:none; border-radius:20px; }
  .login-header, .register-header { margin-inline:14px; }
  .login-form, .register-form { margin-inline:0; }
  .hero-visual { padding:18px; }
}

@media (max-width: 1080px) {
  body:has(.login-container) .nav-links,
  body:has(.register-container) .nav-links { display:none; }
}

/* 2026 visual density and accessibility polish */
.nav-modern { padding: 10px 0; }
.nav-modern.scrolled { padding: 7px 0; }
.nav-brand { gap: 9px; font-size: 20px; }
.nav-brand img { width: 52px; height: 52px; border-radius: 14px; object-fit: contain; }
.keystoneseller-wordmark {
  color: #bfc8ff;
  -webkit-text-fill-color: currentColor;
  background: none;
  font-weight: 900;
  letter-spacing: -.02em;
}
html[data-theme="light"] .keystoneseller-wordmark { color: #4338ca; }
html[data-theme="dark"] .keystoneseller-wordmark { color: #c7d2fe; }
.nav-links { gap: 2px; }
.nav-links a { padding: 8px 12px; }
.nav-actions { gap: 8px; }
.btn-modern { padding: 9px 16px; }
.btn-modern i, .btn-modern .ks-local-icon { font-size: 1.08em; width: 1.08em; height: 1.08em; }
.theme-toggle, .nav-burger { width: 40px; height: 40px; }

.hero-modern { min-height: auto; padding: 126px 0 66px; }
.hero-modern .row { --bs-gutter-y: 2rem; }
.hero-stats { margin-top: 30px; padding-top: 24px; }
.section-modern { padding: 72px 0; }
.section-head { margin-bottom: 38px; }
.feature-grid, .tpl-grid { gap: 20px; }
.feature-card { padding: 24px; }
.feature-icon { width: 52px; height: 52px; }
.feature-icon svg { width: 27px; height: 27px; }
.client-marquee { padding: 22px 0; overflow: hidden; }
.marquee-track { gap: 34px; animation-duration: 22s; }
.marquee-track::after { content: ""; padding-inline-end: 1px; }
.tpl-price { top: 12px; inset-inline-end: 12px; inset-inline-start: auto; }
.tpl-body { padding-bottom: 12px; }
.tpl-rating .stars { min-width: 78px; }
.tpl-rating .stars .fa-star.off { color: rgba(148, 163, 255, .24); }

.auth-brand { margin: 0 0 8px !important; font-size: 30px !important; }
.login-header, .register-header { padding-top: 0 !important; }
.login-wrapper, .register-wrapper { padding-block: 30px !important; }
.login-header h2.auth-brand, .register-header h2.auth-brand { color: #4338ca; }
html[data-theme="dark"] .login-header h2.auth-brand,
html[data-theme="dark"] .register-header h2.auth-brand { color: #c7d2fe; }
.login-container, .register-container {
  background-image: radial-gradient(circle at 15% 10%, rgba(99,102,241,.22), transparent 28%), radial-gradient(circle at 85% 82%, rgba(14,165,233,.14), transparent 30%) !important;
}
html[data-theme="light"] .login-container,
html[data-theme="light"] .register-container { background-color: #eef2ff !important; }
html[data-theme="dark"] .login-container,
html[data-theme="dark"] .register-container { background-color: #0b1022 !important; }

@media (max-width: 991px) {
  .nav-modern { padding: 8px 0; }
  .nav-brand img { width: 46px; height: 46px; }
  .hero-modern { padding: 108px 0 54px; }
  .section-modern { padding: 58px 0; }
}

/* Theme-aware section backgrounds (bg-1 dark / bg-3 light for templates, bg-2 dark / bg-4 light for cta) */
.section-bg-templates {
  background:
    linear-gradient(rgba(7, 11, 22, 0.78), rgba(7, 11, 22, 0.86)),
    url('../images/backgrounds/bg-1.jpg') center / cover no-repeat;
}
html[data-theme="light"] .section-bg-templates {
  background:
    linear-gradient(rgba(238, 240, 255, 0.85), rgba(244, 246, 251, 0.92)),
    url('../images/backgrounds/bg-3.jpg') center / cover no-repeat;
}
.section-bg-cta {
  background:
    linear-gradient(rgba(7, 11, 22, 0.8), rgba(7, 11, 22, 0.85)),
    url('../images/backgrounds/bg-2.jpg') center / cover no-repeat;
}
html[data-theme="light"] .section-bg-cta {
  background:
    linear-gradient(rgba(238, 240, 255, 0.88), rgba(244, 246, 251, 0.94)),
    url('../images/backgrounds/bg-4.jpg') center / cover no-repeat;
}

/* Keep hero grid/orbs above the background image */
.hero-modern .hero-bg-grid,
.hero-modern .hero-orb { z-index: 0; }
.hero-modern .container { position: relative; z-index: 1; }

/* ============================================================
   AUTH PAGES (ورود / ثبت‌نام) — theme aware
   ============================================================ */
html[data-theme="dark"] .login-container,
html[data-theme="dark"] .register-container { background: linear-gradient(135deg, #0d1226 0%, #151a38 100%); }
html[data-theme="dark"] .login-wrapper,
html[data-theme="dark"] .register-wrapper,
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .register-panel { background: #141a33; color: #eef1ff; box-shadow: 0 10px 40px rgba(2, 6, 18, 0.6); }
html[data-theme="dark"] .login-header h2,
html[data-theme="dark"] .register-header h2 { color: #eef1ff; }
html[data-theme="dark"] .login-header p,
html[data-theme="dark"] .register-header p { color: #97a0c8; }
html[data-theme="dark"] .login-header .keystone-logo,
html[data-theme="dark"] .register-header .keystone-logo { background: #1a2145; border-color: rgba(148, 163, 255, 0.2); }
html[data-theme="dark"] .form-group label,
html[data-theme="dark"] .register-form label { color: #c6cdee; }
html[data-theme="dark"] .input-container input,
html[data-theme="dark"] .register-input,
html[data-theme="dark"] .form-control {
  background: #1a2145;
  border-color: rgba(148, 163, 255, 0.2);
  color: #eef1ff;
}
html[data-theme="dark"] .input-container input:focus,
html[data-theme="dark"] .register-input:focus,
html[data-theme="dark"] .form-control:focus { background: #202950; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2); }
html[data-theme="dark"] .input-container input::placeholder,
html[data-theme="dark"] .register-input::placeholder { color: #5b6478; }
html[data-theme="dark"] .input-container .input-icon,
html[data-theme="dark"] .input-container .toggle-password { color: #97a0c8; }
html[data-theme="dark"] .remember-me,
html[data-theme="dark"] .register-remember { color: #c6cdee; }
html[data-theme="dark"] .login-footer,
html[data-theme="dark"] .register-footer { color: #97a0c8; }
html[data-theme="dark"] .header-btn,
html[data-theme="dark"] .home-btn { background: #1a2145; border-color: rgba(148, 163, 255, 0.2); color: #a5b4fc; }
html[data-theme="dark"] .header-btn:hover { background: #4f46e5; color: #fff; }
html[data-theme="dark"] .form-text.text-muted { color: #97a0c8 !important; }
html[data-theme="dark"] .login-message.success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.3); }
html[data-theme="dark"] .login-message.error { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
html[data-theme="dark"] .error-input { background: rgba(239, 68, 68, 0.1) !important; }
html[data-theme="dark"] .login-side-image::before { background: linear-gradient(135deg, rgba(13, 18, 38, 0.85), rgba(30, 27, 75, 0.9)); }
html[data-theme="light"] .login-container,
html[data-theme="light"] .register-container { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
html[data-theme="light"] .login-wrapper,
html[data-theme="light"] .register-wrapper { background: #fff; }
/* Home feature introduction */
.hero-closing-line {
  display: block;
  margin-top: 10px;
  color: var(--d-text);
  font-weight: 700;
}
.feature-capabilities {
  margin-top: 14px !important;
  color: var(--d-text) !important;
  font-weight: 700;
}
.feature-capabilities span {
  margin-inline: 7px;
  color: var(--d-primary);
}
.home-manifesto {
  width: min(760px, 100%);
  margin: 22px auto 0;
  padding: 18px 24px;
  color: var(--d-text);
  background: linear-gradient(135deg, rgba(99, 102, 241, .11), rgba(14, 165, 233, .07));
  border: 1px solid rgba(129, 140, 248, .26);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.home-manifesto-section {
  padding: 0 0 56px;
  background: var(--d-bg);
}
.home-manifesto p { margin: 0 0 8px !important; color: var(--d-muted) !important; }
.home-manifesto strong { color: var(--d-text); font-size: 1.02rem; }
html[data-theme="light"] .home-manifesto {
  background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(14, 165, 233, .05));
  border-color: rgba(79, 70, 229, .2);
  box-shadow: 0 10px 28px rgba(79, 70, 229, .07), inset 0 1px 0 #fff;
}
@media (max-width: 640px) {
  .feature-capabilities { line-height: 2; }
  .feature-capabilities span { margin-inline: 3px; }
  .home-manifesto { margin-top: 16px; padding: 15px 16px; border-radius: 14px; }
  .home-manifesto-section { padding-bottom: 36px; }
}


/* ================= MEGA MENU (desktop) ================= */
.mega-chevron { font-size: 10px; margin-right: 4px; opacity: .6; transition: transform .2s; }
.nav-mega-trigger > a { cursor: default; }
.nav-mega-trigger.is-open .mega-chevron { transform: rotate(180deg); }

.mega-menu {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 999;
  padding-top: 70px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.mega-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.mega-inner {
  display: flex;
  gap: 0;
  padding: 0;
  background: rgba(7, 11, 22, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(148, 163, 255, 0.12);
  border-radius: 0 0 20px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}
.mega-root-panel {
  width: 280px;
  min-width: 280px;
  padding: 24px 20px;
  border-left: 1px solid rgba(148, 163, 255, 0.08);
  display: flex;
  flex-direction: column;
}
.mega-sub-panel {
  flex: 1;
  padding: 24px 28px;
  display: none;
}
.mega-sub-panel.is-active { display: block; }
.mega-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #b7c2ff;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 255, 0.1);
}
.mega-heading i { font-size: 14px; opacity: .7; }
.mega-list { list-style: none; margin: 0; padding: 0; }
.mega-list > li { margin-bottom: 2px; }
.mega-list > li > a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.mega-list > li > a:hover,
.mega-cat-item.is-hovered > a {
  background: rgba(148, 163, 255, 0.1);
  color: #fff;
}
.mega-list > li > a i { width: 18px; text-align: center; font-size: 13px; opacity: .55; }

.mega-item-arrow {
  font-size: 9px;
  margin-right: 0;
  margin-inline-start: auto;
  opacity: .35;
  transition: transform .2s, opacity .2s;
  flex-shrink: 0;
}
.mega-cat-item.has-children:hover .mega-item-arrow,
.mega-cat-item.is-hovered .mega-item-arrow {
  opacity: .7;
}
.mega-cat-item > a {
  flex: 1;
}
.mega-cat-item {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}
.mega-cat-item > a {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 500;
  transition: background .2s, color .2s;
  text-decoration: none;
}
.mega-cat-item.is-hovered > a,
.mega-cat-item > a:hover {
  background: rgba(148, 163, 255, 0.1);
  color: #fff;
}
.mega-view-all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #8fa4ff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 255, 0.08);
  transition: color .2s;
}
.mega-view-all:hover { color: #b7c2ff; }
.mega-sublist {
  list-style: none;
  margin: 2px 0 4px 26px;
  padding: 0;
  border-right: 2px solid rgba(148, 163, 255, 0.1);
  padding-right: 10px;
}
.mega-sublist li a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  transition: background .2s, color .2s;
}
.mega-sublist li a:hover { background: rgba(148,163,255,.08); color: #fff; }

html[data-theme="light"] .mega-inner {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(79, 70, 229, 0.12);
  box-shadow: 0 24px 64px rgba(30, 41, 82, 0.12);
}
html[data-theme="light"] .mega-root-panel { border-left-color: rgba(79,70,229,.08); }
html[data-theme="light"] .mega-heading { color: #4f46e5; border-bottom-color: rgba(79,70,229,.1); }
html[data-theme="light"] .mega-list > li > a,
html[data-theme="light"] .mega-cat-item > a { color: rgba(15,23,42,.7); }
html[data-theme="light"] .mega-list > li > a:hover,
html[data-theme="light"] .mega-cat-item.is-hovered > a,
html[data-theme="light"] .mega-cat-item > a:hover { background: rgba(79,70,229,.06); color: #0f172a; }
html[data-theme="light"] .mega-view-all { color: #4f46e5; border-top-color: rgba(79,70,229,.08); }
html[data-theme="light"] .mega-view-all:hover { color: #4338ca; }
html[data-theme="light"] .mega-sublist li a { color: rgba(15,23,42,.55); }
html[data-theme="light"] .mega-sublist li a:hover { background: rgba(79,70,229,.05); color: #0f172a; }
html[data-theme="light"] .mega-sublist { border-right-color: rgba(79,70,229,.1); }


/* Active path highlighting in mega menu */
.mega-cat-item.is-active-path > a {
  background: rgba(102, 126, 234, 0.15);
  color: #fff;
  font-weight: 600;
}
html[data-theme="light"] .mega-cat-item.is-active-path > a {
  background: rgba(79, 70, 229, 0.1);
  color: #0f172a;
}


/* Active path highlighting in mega menu */
.mega-cat-item.is-active-path > a {
  background: rgba(102, 126, 234, 0.15);
  color: #fff;
  font-weight: 600;
}
html[data-theme="light"] .mega-cat-item.is-active-path > a {
  background: rgba(79, 70, 229, 0.1);
  color: #0f172a;
}

/* Drawer sub-accordion */

/* Drawer split row: label navigates, chevron toggles */
.drawer-sublink-row {
  display: flex;
  align-items: center;
}
.drawer-sublink-row .drawer-sublink-parent {
  flex: 1;
  min-width: 0;
}
.drawer-sub-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-inline-start: 4px;
  border: none;
  background: none;
  color: rgba(255,255,255,.35);
  cursor: pointer;
  border-radius: 8px;
  transition: background .2s, color .2s;
  flex-shrink: 0;
}
.drawer-sub-toggle:hover {
  background: rgba(148,163,255,.1);
  color: rgba(255,255,255,.7);
}
.drawer-sub-toggle .acc-icon {
  font-size: 10px;
  transition: transform .25s;
}
.drawer-sub-accordion.is-open > .drawer-sublink-row .drawer-sub-toggle .acc-icon {
  transform: rotate(180deg);
}
html[data-theme="light"] .drawer-sub-toggle { color: rgba(15,23,42,.35); }
html[data-theme="light"] .drawer-sub-toggle:hover { background: rgba(79,70,229,.06); color: rgba(15,23,42,.6); }
.drawer-sub-accordion { margin-bottom: 2px; }
.drawer-sublink-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 14px 9px 44px;
  border-radius: 8px;
  border: none;
  background: none;
  color: rgba(255,255,255,.55);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s;
  font-family: inherit;
  text-align: start;
}
.drawer-sublink-btn span { flex: 1; }
.drawer-sublink-btn:hover { background: rgba(148,163,255,.06); color: rgba(255,255,255,.85); }
.drawer-sublink-btn .acc-icon { font-size: 10px; opacity: .4; transition: transform .25s; }
.drawer-sub-accordion.is-open .drawer-sublink-btn .acc-icon { transform: rotate(180deg); }
.drawer-sub-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.drawer-sub-accordion.is-open .drawer-sub-body { /* max-height set by JS */ }
html[data-theme="light"] .drawer-sublink-btn { color: rgba(15,23,42,.55); }
html[data-theme="light"] .drawer-sublink-btn:hover { background: rgba(79,70,229,.04); color: rgba(15,23,42,.8); }

@media (max-width: 860px) {
  .mega-menu { display: none !important; }
}

/* ================= MOBILE DRAWER ================= */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s;
}
.drawer-backdrop.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1101;
  width: min(88vw, 360px);
  background: rgba(7, 11, 22, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(148, 163, 255, 0.1);
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-drawer.is-open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(148, 163, 255, 0.08);
}
.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
}
.drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(148,163,255,.15);
  background: rgba(148,163,255,.06);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.drawer-close:hover { background: rgba(244,63,94,.15); color: #fb7185; }

.drawer-body {
  flex: 1;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  color: rgba(255,255,255,.8);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.drawer-link:hover { background: rgba(148,163,255,.08); color: #fff; }
.drawer-link i { width: 20px; text-align: center; font-size: 15px; opacity: .6; }
.drawer-link-danger:hover { background: rgba(244,63,94,.1); color: #fb7185; }
.drawer-link-accent { background: rgba(102,126,234,.12); color: #b7c2ff; }
.drawer-link-accent:hover { background: rgba(102,126,234,.2); color: #fff; }
.drawer-divider { height: 1px; background: rgba(148,163,255,.08); margin: 8px 0; }

.drawer-accordion { margin-bottom: 2px; }
.drawer-accordion-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  background: none;
  color: rgba(255,255,255,.8);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
  font-family: inherit;
}
.drawer-accordion-btn span { display: flex; align-items: center; gap: 10px; }
.drawer-accordion-btn span i { width: 20px; text-align: center; font-size: 15px; opacity: .6; }
.drawer-accordion-btn:hover { background: rgba(148,163,255,.08); color: #fff; }
.acc-icon { font-size: 11px; opacity: .4; transition: transform .25s; }
.drawer-accordion.is-open .acc-icon { transform: rotate(180deg); }

.drawer-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.drawer-accordion.is-open .drawer-accordion-body {
  max-height: 600px;
}
.drawer-sublink {
  display: block;
  padding: 9px 14px 9px 44px;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  text-decoration: none;
  border-radius: 8px;
  transition: background .2s, color .2s;
}
.drawer-sublink:hover { background: rgba(148,163,255,.06); color: rgba(255,255,255,.85); }
.drawer-sublink-nested { padding-right: 58px; font-size: 13px; }
.drawer-sublink-all { color: #8fa4ff; font-weight: 600; margin-top: 4px; }
.drawer-sublink-all:hover { color: #b7c2ff; }

html[data-theme="light"] .mobile-drawer {
  background: rgba(255, 255, 255, 0.98);
  border-left-color: rgba(79,70,229,.08);
}
html[data-theme="light"] .drawer-brand { color: #0f172a; }
html[data-theme="light"] .drawer-close { border-color: rgba(79,70,229,.12); background: rgba(79,70,229,.04); color: #334155; }
html[data-theme="light"] .drawer-close:hover { background: rgba(244,63,94,.08); }
html[data-theme="light"] .drawer-link { color: rgba(15,23,42,.75); }
html[data-theme="light"] .drawer-link:hover { background: rgba(79,70,229,.05); color: #0f172a; }
html[data-theme="light"] .drawer-divider { background: rgba(79,70,229,.06); }
html[data-theme="light"] .drawer-accordion-btn { color: rgba(15,23,42,.75); }
html[data-theme="light"] .drawer-accordion-btn:hover { background: rgba(79,70,229,.05); color: #0f172a; }
html[data-theme="light"] .drawer-sublink { color: rgba(15,23,42,.5); }
html[data-theme="light"] .drawer-sublink:hover { background: rgba(79,70,229,.04); color: rgba(15,23,42,.8); }
html[data-theme="light"] .drawer-link-danger:hover { color: #dc2626; }

/* ================= TEMPLATE BADGES (backend-driven) ================= */
.card-badge {
  position: absolute; top: 12px; left: 12px; z-index: 5;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 100px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  backdrop-filter: blur(10px);
}
.card-badge-new     { background: rgba(139,92,246,.85); color: #fff; }
.card-badge-popular { background: rgba(255,179,0,.85); color: #1a1a2e; }
.card-badge-featured{ background: rgba(102,126,234,.85); color: #fff; }
.card-badge-hot     { background: rgba(255,61,0,.85); color: #fff; }
.card-badge-discount{ background: rgba(239,68,68,.85); color: #fff; }
.card-badge-limited { background: rgba(34,197,94,.85); color: #fff; }
