/* ==========================================================================
   ۱. متغیرهای بنیادین، پالت رنگی و سیستم تم پیوسته (0 تا 100%)
   ========================================================================== */
:root {
  --bg-r: 255;
  --bg-g: 255;
  --bg-b: 255;

  --alt-r: 247;
  --alt-g: 249;
  --alt-b: 250;

  --card-r: 255;
  --card-g: 255;
  --card-b: 255;

  --text-r: 23;
  --text-g: 23;
  --text-b: 23;

  --muted-r: 100;
  --muted-g: 116;
  --muted-b: 139;

  --border-r: 226;
  --border-g: 232;
  --border-b: 240;

  --bg-main: rgb(var(--bg-r), var(--bg-g), var(--bg-b));
  --bg-alt: rgb(var(--alt-r), var(--alt-g), var(--alt-b));
  --bg-card: rgb(var(--card-r), var(--card-g), var(--card-b));
  --text-main: rgb(var(--text-r), var(--text-g), var(--text-b));
  --text-muted: rgb(var(--muted-r), var(--muted-g), var(--muted-b));
  --border-color: rgb(var(--border-r), var(--border-g), var(--border-b));

  --primary: #67BC7A;
  --primary-dark: #4da661;
  --primary-glow: rgba(103, 188, 122, 0.25);
  --accent-orange: #f59e0b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-elevated: 0 16px 36px rgba(0, 0, 0, 0.09);
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   ۲. ریست سراسری و مهار اسکرول افقی (Anti-Horizontal Scroll)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   ۳. نور موضعی موس (فقط برای صفحات بزرگتر از تبلت)
   ========================================================================== */
.spotlight {
  position: fixed;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, rgba(103, 188, 122, 0) 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  transition: opacity 0.3s ease;
}

@media (pointer: coarse), (max-width: 992px) {
  .spotlight {
    display: none !important;
  }
}

/* ==========================================================================
   ۴. نوار متحرک بالای صفحه (Marquee)
   ========================================================================== */
.top-marquee {
  background: var(--primary);
  color: #ffffff;
  padding: 8px 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  position: relative;
  z-index: 50;
}

.marquee-track {
  display: inline-flex;
  gap: 15px;
  animation: marqueeAnimation 30s linear infinite;
  will-change: transform;
}

@keyframes marqueeAnimation {
  0% { transform: translateX(0%); }
  100% { transform: translateX(50%); }
}

/* ==========================================================================
   ۵. هدر، اسلایدر تم و ناوبری موبایل
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(var(--bg-r), var(--bg-g), var(--bg-b), 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-img-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-right: 1px solid var(--border-color);
  padding-right: 10px;
  margin-right: 6px;
  white-space: nowrap;
}

.theme-controller {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-alt);
  padding: 5px 12px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

.theme-controller input[type="range"] {
  width: 70px;
  cursor: pointer;
  accent-color: var(--primary);
}

.theme-percent {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 28px;
  text-align: center;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.3rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* دراور منوی موبایل (Full Screen Drawer) */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--bg-main);
  box-shadow: -8px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  padding: 30px 24px;
  gap: 20px;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1px solid var(--border-color);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav a {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-color);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   ۶. دکمه‌ها و المان‌های عمومی
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px var(--primary-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.pill-badge {
  display: inline-block;
  background: var(--primary-glow);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 14px;
}

/* ==========================================================================
   ۷. سکشن Hero و رفع Overflow کارت تعاملی
   ========================================================================== */
.hero-section {
  padding: 50px 0 70px;
  position: relative;
  z-index: 10;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-title {
  font-size: 2.3rem;
  line-height: 1.35;
  font-weight: 900;
  margin-bottom: 18px;
}

.highlight {
  color: var(--primary);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 25px;
}

.hero-cta-group {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.trust-indicators {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.trust-check {
  color: var(--primary);
  font-weight: bold;
}

/* کارت شبیه‌ساز داشبورد */
.tilt-container {
  perspective: 1200px;
  width: 100%;
}

.dashboard-mockup {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  transition: transform 0.15s ease-out;
  transform-style: preserve-3d;
  width: 100%;
}

.mockup-header {
  background: var(--bg-alt);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.mockup-dots {
  display: flex;
  gap: 5px;
}

.mockup-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.mockup-dots span:nth-child(1) { background: #ef4444; }
.mockup-dots span:nth-child(2) { background: #f59e0b; }
.mockup-dots span:nth-child(3) { background: #10b981; }

.mockup-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.mockup-mini-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.mockup-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.mockup-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mockup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mockup-stat-card {
  background: var(--bg-alt);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stat-val {
  font-size: 1rem;
  font-weight: 800;
}

.highlight-green { color: var(--primary); }
.highlight-orange { color: var(--accent-orange); }

/* جدول با قابلیت اسکرول داخلی برای دستگاه‌های کوچک */
.mockup-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mockup-table {
  min-width: 360px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.table-head, .table-row {
  display: grid;
  grid-template-columns: 1.2fr 1.1fr 1.1fr 0.9fr;
  padding: 8px 10px;
  align-items: center;
}

.table-head {
  background: var(--bg-alt);
  font-weight: 700;
  color: var(--text-muted);
}

.table-row {
  border-top: 1px solid var(--border-color);
}

.status-done {
  color: var(--primary);
  font-weight: 700;
}

.status-pending {
  color: var(--accent-orange);
  font-weight: 700;
}

/* ==========================================================================
   ۸. سکشن آمار (Stats Grid)
   ========================================================================== */
.stats-section {
  background: var(--bg-alt);
  padding: 50px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-box {
  text-align: center;
  padding: 10px;
}

.stat-number-wrap {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-suffix {
  font-size: 1rem;
  margin-right: 4px;
}

.stat-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   ۹. سکشن امکانات (Feature Cards)
   ========================================================================== */
.features-section {
  padding: 70px 0;
}

.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 40px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-smooth);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-elevated);
}

.feature-icon-wrapper {
  width: 44px;
  height: 44px;
  background: var(--primary-glow);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.icon-svg {
  width: 24px;
  height: 24px;
  fill: var(--primary);
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ==========================================================================
   ۱۰. بخش دانلودها
   ========================================================================== */
.downloads-section {
  padding: 30px 0 60px;
}

.download-banner {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 35px 25px;
  text-align: center;
}

.download-info h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.download-info p {
  color: var(--text-muted);
  margin-bottom: 25px;
  font-size: 0.95rem;
}

.download-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
  transition: var(--transition-smooth);
}

.app-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-subtle);
}

.app-card-icon {
  font-size: 1.8rem;
}

.app-card-text strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-main);
}

.app-card-text small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   ۱۱. بخش سوالات متداول (FAQ Accordion)
   ========================================================================== */
.faq-section {
  padding: 60px 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border-color);
}

.faq-accordion-wrapper {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-btn {
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  text-align: right;
  gap: 15px;
}

.faq-toggle-icon {
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform 0.3s ease;
  line-height: 1;
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0, 1, 0, 1);
  padding: 0 20px;
}

.faq-content p {
  padding-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.faq-item.active .faq-toggle-icon {
  transform: rotate(45deg);
}

/* ==========================================================================
   ۱۲. فوتر و اینماد (Footer & eNamad)
   ========================================================================== */
.main-footer {
  background: var(--bg-main);
  border-top: 1px solid var(--border-color);
  padding: 50px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.3fr;
  gap: 35px;
  margin-bottom: 35px;
}

.footer-about-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 12px 0;
  line-height: 1.7;
}

.footer-contact-row {
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-contact-row a {
  color: var(--primary);
  margin-right: 5px;
}

.footer-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.footer-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-menu a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-menu a:hover {
  color: var(--primary);
}

.enamad-box-wrapper {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.enamad-img-badge {
  max-width: 105px;
  max-height: 105px;
  background: #ffffff;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.enamad-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   ۱۳. مدیا کوئری‌ها و بهینه‌سازی دقیق نمایش در تبلت و موبایل
   ========================================================================== */
/* لپ‌تاپ‌های کوچک و تبلت افقی */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 35px;
  }

  .hero-title {
    font-size: 2.1rem;
  }

  .hero-cta-group, .trust-indicators {
    justify-content: center;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .download-links-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

/* تبلت‌های عمودی و موبایل‌های بزرگ */
@media (max-width: 768px) {
  .brand-tagline {
    display: none;
  }

  .header-actions {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero-section {
    padding: 35px 0 50px;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .hero-desc {
    font-size: 0.95rem;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .download-links-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-contact-row {
    justify-content: center;
  }

  .enamad-box-wrapper {
    margin: 0 auto;
  }

  .footer-bottom-inner {
    flex-direction: column;
    gap: 6px;
  }
}

/* موبایل‌های کوچک (عرض کمتر از 480 پیکسل) */
@media (max-width: 480px) {
  .container {
    padding: 0 14px;
  }

  .theme-controller input[type="range"] {
    width: 50px;
  }

  .theme-controller {
    padding: 4px 8px;
    gap: 4px;
  }

  .theme-percent {
    display: none; /* برای جلوگیری از فشرده شدن هدر در گوشی‌های باریک */
  }

  .hero-title {
    font-size: 1.45rem;
  }

  .mockup-row {
    grid-template-columns: 1fr;
  }

  .stat-number-wrap {
    font-size: 1.7rem;
  }
}
