/* ==========================================================================
   ABCode — Design System (مشترک بین همه صفحات)
   استخراج‌شده از index.php تا از تکرار CSS جلوگیری شود.
   ترتیب: tokens → base → buttons → cards → layout → utilities
   ========================================================================== */

/* ---------- 1. Design Tokens ---------- */
:root {
  /* surfaces */
  --canvas: #FAFAFC;
  --canvas-alt: #F4F5F8;
  --canvas-deep: #E9ECF2;
  --surface: #FFFFFF;
  /* text */
  --ink: #0B1120;
  --muted: #64748B;
  --line: #E2E8F0;
  /* brand */
  --primary: #5B4FE9;
  --primary-dark: #4338CA;
  --primary-soft: #EEF0FF;
  --accent: #06B6D4;
  --dark: #0B1120;
  --dark-surface: #111827;
  /* gradients */
  --grad-brand: linear-gradient(135deg, #5B4FE9 0%, #8B5CF6 50%, #06B6D4 100%);
  --grad-btn: linear-gradient(135deg, #5B4FE9 0%, #7C3AED 100%);
  /* radii */
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-pill: 999px;
  /* shadows */
  --shadow-btn: 0 6px 20px -6px rgba(91, 79, 233, .45);
  --shadow-btn-hover: 0 12px 28px -8px rgba(91, 79, 233, .55);
  --shadow-card-hover: 0 18px 40px -24px rgba(15, 23, 42, .18);
  /* spacing */
  --section-pad: 5.5rem;
  --section-pad-sm: 3.5rem;
  --container-max: 1240px;
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background-color: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

::selection { background: var(--primary); color: #fff; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------- 3. Buttons ---------- */
.btn-primary,
.btn-secondary,
.btn-on-dark,
.btn-readmore { position: relative; }

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .75rem 1.75rem;
  border-radius: var(--radius-btn);
  font-size: .875rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: var(--shadow-btn);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
  filter: brightness(1.05);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, transform .2s ease;
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-on-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .75rem 1.75rem;
  border-radius: var(--radius-btn);
  font-size: .875rem;
  font-weight: 600;
  background: #fff;
  color: var(--ink);
  border: 1px solid #fff;
  transition: background .2s ease, border-color .2s ease;
}
.btn-on-dark:hover { background: #E9ECF2; border-color: #E9ECF2; }

.btn-readmore {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: gap .2s ease, border-color .2s ease;
}
.btn-readmore:hover { gap: .625rem; border-bottom-color: var(--primary); }


/* ---------- 4. Cards & Tags ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.card:hover {
  border-color: #C7CCF5;
  box-shadow: var(--shadow-card-hover);
}

.card-dark {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--radius-card);
  color: #F1F5F9;
  transition: border-color .25s ease, background .25s ease;
}
.card-dark:hover {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .06);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border-radius: var(--radius-pill);
  font-size: .6875rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.tag-accent { background: rgba(6, 182, 212, .12); color: #0E7490; }

/* ---------- 5. Layout ---------- */
.section { padding-block: var(--section-pad); }
@media (max-width: 768px) { .section { padding-block: var(--section-pad-sm); } }

.container-x {
  margin-inline: auto;
  max-width: var(--container-max);
  padding-inline: 1rem;
}
@media (min-width: 768px) { .container-x { padding-inline: 2rem; } }
@media (min-width: 1024px) { .container-x { padding-inline: 4rem; } }

/* ---------- 6. Utilities ---------- */
.rtl-flip { transform: scaleX(-1); }

.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.orb {
  position: absolute;
  border-radius: var(--radius-pill);
  filter: blur(70px);
  opacity: .35;
  pointer-events: none;
}

.bg-dots {
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ---------- 7. Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 8. Pricing period toggle ---------- */
.period-btn { color: var(--muted); background: transparent; }
.period-btn:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.period-btn[data-active="true"] {
  color: #fff;
  background: var(--grad-btn);
  box-shadow: 0 6px 16px -6px rgba(91, 79, 233, .5);
}
.period-btn[data-active="true"]:hover { background: var(--grad-btn); }

/* ---------- 9. FAQ ---------- */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] summary i.ph-plus { transform: rotate(45deg); }
details[open] summary { color: var(--primary-dark); }

/* ---------- 10. Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 8px;
  border: 2px solid var(--canvas);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---------- 11. Screen-reader only ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ==========================================================================
   12. Service page components (فاز ۱)
   ========================================================================== */

/* ---------- Trust bar (نوار اعتماد عددی) ---------- */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  border-block: 1px solid var(--line);
  padding-block: 1.25rem;
}
@media (min-width: 768px) {
  .trust-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
}
.trust-bar__item { display: flex; align-items: center; gap: .75rem; }
.trust-bar__value {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.trust-bar__label { font-size: .6875rem; color: var(--muted); }

/* ---------- Answer-first / پاسخ کوتاه ---------- */
.answer-box {
  background: var(--surface);
  border: 1px solid var(--primary-soft);
  border-inline-start: 4px solid var(--primary);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
}
.answer-box__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: .04em;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: .75rem; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; }
.breadcrumbs a { transition: color .2s ease; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }
.breadcrumbs__sep { color: var(--canvas-deep); user-select: none; }

/* ---------- Comparison table ---------- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8125rem;
  text-align: start;
}
.compare-table caption {
  caption-side: top;
  text-align: start;
  font-size: .75rem;
  color: var(--muted);
  padding-bottom: .75rem;
}
.compare-table th,
.compare-table td {
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  vertical-align: top;
}
.compare-table thead th {
  background: var(--canvas-alt);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.compare-table tbody tr:hover { background: var(--canvas); }

/* ---------- Reading progress ---------- */
.read-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
}
.read-progress__bar {
  height: 100%;
  width: 0;
  background: var(--grad-brand);
  transition: width .1s linear;
}

/* ---------- Table of contents ---------- */
.toc {
  border-inline-start: 2px solid var(--line);
  padding-inline-start: 1rem;
}
.toc__title {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .75rem;
}
.toc a {
  display: block;
  padding-block: .3rem;
  font-size: .8125rem;
  color: var(--muted);
  transition: color .2s ease, padding-inline-start .2s ease;
}
.toc a:hover,
.toc a.is-active {
  color: var(--primary-dark);
  padding-inline-start: .25rem;
}


/* ---------- Sticky mobile call bar ---------- */
.sticky-call {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  padding: .625rem .75rem calc(.625rem + env(safe-area-inset-bottom, 0px));
  background: rgba(11, 17, 32, .96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-block-start: 1px solid rgba(255, 255, 255, .1);
}
@media (min-width: 768px) { .sticky-call { display: none; } }
.sticky-call__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  border-radius: var(--radius-btn);
  font-size: .8125rem;
  font-weight: 700;
  transition: filter .2s ease;
}
.sticky-call__btn:hover { filter: brightness(1.12); }
.sticky-call__btn--primary { background: var(--grad-btn); color: #fff; }
.sticky-call__btn--ghost {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
}
body.has-sticky-call { padding-block-end: 68px; }
@media (min-width: 768px) { body.has-sticky-call { padding-block-end: 0; } }

/* ---------- Author box ---------- */
.author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--canvas-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.25rem;
}
.author-box__avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  background: var(--grad-brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.125rem;
}

/* ---------- Active nav state ---------- */
.nav-link[aria-current="page"],
.nav-active {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

/* ---------- Process steps ---------- */
.step-num {
  position: absolute;
  inset-block-start: -1rem;
  inset-inline-start: 1.5rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-pill);
  background: var(--grad-brand);
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  box-shadow: 0 6px 16px -6px rgba(91, 79, 233, .45);
}

/* ---------- Feature checklist ---------- */
.feature-list { display: grid; gap: .5rem; }
@media (min-width: 640px) {
  .feature-list--2 { grid-template-columns: 1fr 1fr; }
}
.feature-list__item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .8125rem;
  line-height: 1.9;
  color: var(--muted);
}
.feature-list__item i {
  color: var(--primary);
  flex-shrink: 0;
  margin-block-start: .3rem;
}

/* ---------- Inline SVG Icons ---------- */
/* آیکون‌ها با currentColor رنگ می‌گیرند و اندازه‌شان از font-size ارث می‌رسد،
   بنابراین کلاس‌های text-sm/text-2xl مثل قبل کار می‌کنند. */
.abc-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
  color: currentColor;
}

/* ---------- Print ---------- */
@media print {
  .sticky-call,
  .read-progress,
  .toc { display: none !important; }
  .section { padding-block: 1.5rem; }
}

