/* ==========================================================================
   OmegaForm — Design System
   RTL-first · Light + Dark · No build step (درون باینری بسته‌بندی می‌شود)
   ========================================================================== */

/* ---------- فونت (self-hosted، بدون CDN) ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("/static/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---------- توکن‌های طراحی ---------- */
:root {
  --brand-50:  #eef0ff;
  --brand-100: #dcdefe;
  --brand-300: #a5a8fb;
  --brand-500: #5b5bd6;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --violet-500: #7c3aed;
  --teal-500:  #0ea5a4;

  --bg:        #f6f7fb;
  --bg-soft:   #eef0f7;
  --surface:   #ffffff;
  --surface-2: #f9fafc;
  --text:      #0d1424;
  --text-2:    #3d4760;
  --muted:     #6b7590;
  --border:    #e3e7f0;
  --border-2:  #eef1f7;

  --success: #0f9d58;
  --warn:    #d97706;
  --danger:  #dc2626;

  --ring: 0 0 0 3px rgba(91, 91, 214, .28);
  --shadow-sm: 0 1px 2px rgba(13, 20, 36, .06);
  --shadow-md: 0 4px 12px -2px rgba(13, 20, 36, .08), 0 2px 4px -2px rgba(13, 20, 36, .06);
  --shadow-lg: 0 24px 48px -12px rgba(13, 20, 36, .18);
  --shadow-glow: 0 20px 60px -20px rgba(79, 70, 229, .45);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  --container: 1160px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

html[data-theme="dark"] {
  --bg:        #080c17;
  --bg-soft:   #0c1120;
  --surface:   #101728;
  --surface-2: #0c1322;
  --text:      #e9eefb;
  --text-2:    #c2cbe0;
  --muted:     #8b96b0;
  --border:    #1d2740;
  --border-2:  #151d31;

  --brand-50:  #171a3a;
  --brand-100: #1e2150;
  --brand-300: #8b8ef7;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, .5);
  --shadow-lg: 0 28px 56px -16px rgba(0, 0, 0, .7);
  --shadow-glow: 0 24px 70px -24px rgba(99, 102, 241, .55);
}

/* ---------- پایه ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- دکمه‌ها ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn-primary {
  --btn-fg: #fff;
  --btn-bd: transparent;
  background: linear-gradient(135deg, var(--brand-600), var(--violet-500));
  box-shadow: 0 6px 18px -6px rgba(79, 70, 229, .6);
}
.btn-primary:hover { box-shadow: 0 12px 28px -8px rgba(79, 70, 229, .65); }

.btn-ghost {
  --btn-bg: transparent;
  --btn-bd: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { --btn-bg: var(--bg-soft); color: var(--text); box-shadow: none; }

.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: var(--r-lg); }
.btn-block { width: 100%; }

/* ---------- نوار بالا ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--border); }

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-600), var(--violet-500));
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .8);
  color: #fff;
  font-size: 17px;
  flex: none;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
  margin-inline-start: 24px;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  transition: background .18s, color .18s;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }

@media (min-width: 900px) {
  .nav-links { display: flex; }
}

/* ---------- هیرو ---------- */
.hero {
  position: relative;
  padding: 64px 0 72px;
  overflow: hidden;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  pointer-events: none;
  z-index: 0;
}
.hero::before {
  width: 520px; height: 520px;
  top: -240px; inset-inline-start: -120px;
  background: radial-gradient(circle, rgba(91, 91, 214, .55), transparent 70%);
}
.hero::after {
  width: 460px; height: 460px;
  top: -180px; inset-inline-end: -140px;
  background: radial-gradient(circle, rgba(14, 165, 164, .4), transparent 70%);
}
.hero > .container { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}
@media (min-width: 980px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border-radius: var(--r-full);
  background: var(--brand-50);
  border: 1px solid color-mix(in srgb, var(--brand-500) 22%, transparent);
  color: var(--brand-700);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 20px;
}
html[data-theme="dark"] .eyebrow { color: var(--brand-300); }
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(15, 157, 88, .18);
}

.hero h1 {
  font-size: clamp(30px, 5.2vw, 52px);
  line-height: 1.24;
  letter-spacing: -.03em;
  margin-bottom: 20px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand-600), var(--violet-500) 45%, var(--teal-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  font-size: clamp(15.5px, 1.6vw, 18px);
  color: var(--text-2);
  max-width: 54ch;
  margin-bottom: 30px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--muted);
  font-size: 13.5px;
}
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.tick {
  width: 16px; height: 16px; flex: none;
  color: var(--success);
}

/* ---------- کارت نمایش آزمون ---------- */
.demo-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  padding: 22px;
  transform: perspective(1400px) rotateY(4deg) rotateX(2deg);
  transition: transform .5s var(--ease);
}
.demo-card:hover { transform: perspective(1400px) rotateY(0) rotateX(0); }

.demo-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-2);
  margin-bottom: 16px;
}
.demo-title { font-weight: 700; font-size: 15px; }
.demo-sub { font-size: 12.5px; color: var(--muted); }

.timer {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .timer { color: var(--brand-300); }

.q-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.q-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 14px;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px;
  margin-bottom: 8px;
  background: var(--surface-2);
  transition: border-color .2s, background .2s;
}
.option .box {
  width: 18px; height: 18px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
}
.option.is-correct {
  border-color: color-mix(in srgb, var(--success) 45%, transparent);
  background: color-mix(in srgb, var(--success) 9%, var(--surface));
}
.option.is-correct .box {
  border-color: var(--success);
  background: radial-gradient(circle, var(--success) 45%, transparent 46%);
}

.demo-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-2);
  font-size: 12.5px;
  color: var(--muted);
}
.saved-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-inline-start: auto;
  color: var(--success);
  font-weight: 600;
}
.saved-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.8); }
}

/* ---------- بخش‌ها ---------- */
.section { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 {
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: -.02em;
  margin-bottom: 12px;
}
.section-head p { color: var(--text-2); font-size: 16px; }
.section-head.center { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand-500) 30%, var(--border));
}

.f-icon {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--brand-50);
  color: var(--brand-600);
  margin-bottom: 16px;
}
html[data-theme="dark"] .f-icon { color: var(--brand-300); }
.f-icon svg { width: 22px; height: 22px; }

.card h3 { font-size: 16.5px; margin-bottom: 8px; }
.card p { color: var(--text-2); font-size: 14.5px; line-height: 1.75; }

/* ---------- مراحل ---------- */
.steps { display: grid; gap: 18px; counter-reset: step; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.step {
  position: relative;
  padding: 26px 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.step::before {
  counter-increment: step;
  content: counter(step, persian);
  position: absolute;
  top: -14px;
  inset-inline-start: 24px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-600), var(--violet-500));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .8);
}
.step h3 { font-size: 16px; margin: 12px 0 8px; }
.step p { color: var(--text-2); font-size: 14.5px; }

/* ---------- تعرفه ---------- */
.pricing { display: grid; gap: 18px; align-items: start; }
@media (min-width: 900px) { .pricing { grid-template-columns: repeat(3, 1fr); } }

.price {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.price:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.price.featured {
  border-color: transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--brand-600), var(--violet-500), var(--teal-500)) border-box;
  border: 1.5px solid transparent;
  box-shadow: var(--shadow-glow);
}
.price-tag {
  position: absolute;
  top: -12px;
  inset-inline-start: 24px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--violet-500));
}
.price h3 { font-size: 17px; }
.price .amount {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.price .amount small { font-size: 13px; font-weight: 500; color: var(--muted); }
.price .desc { font-size: 14px; color: var(--text-2); min-height: 44px; }

.price ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 14px;
}
.price li { display: flex; gap: 9px; align-items: flex-start; color: var(--text-2); }
.price li svg { width: 17px; height: 17px; flex: none; margin-top: 4px; color: var(--success); }
.price li.off { opacity: .55; }
.price li.off svg { color: var(--muted); }
.price .btn { margin-top: auto; }

/* ---------- سوالات متداول ---------- */
.faq { display: grid; gap: 10px; max-width: 780px; margin-inline: auto; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px 18px;
  transition: border-color .2s;
}
.faq details[open] { border-color: color-mix(in srgb, var(--brand-500) 34%, var(--border)); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 0;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  margin-inline-start: auto;
  font-size: 20px;
  font-weight: 400;
  color: var(--muted);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { padding: 0 0 16px; color: var(--text-2); font-size: 14.5px; }

/* ---------- CTA پایانی ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 48px 32px;
  text-align: center;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500) 55%, var(--violet-500));
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.cta-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .22), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(14, 165, 164, .35), transparent 45%);
  pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { font-size: clamp(22px, 3.2vw, 32px); margin-bottom: 12px; }
.cta-band p { opacity: .92; margin-bottom: 26px; font-size: 15.5px; }
.cta-band .btn {
  background: #fff;
  color: var(--brand-700);
  border: none;
}
.cta-band .btn:hover { box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .45); }
.cta-band .btn-ghost { background: rgba(255, 255, 255, .14); color: #fff; }
.cta-band .btn-ghost:hover { background: rgba(255, 255, 255, .22); }

/* ---------- فوتر ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 72px;
  padding: 44px 0 32px;
  background: var(--surface-2);
}
.footer-grid {
  display: grid;
  gap: 32px;
  margin-bottom: 32px;
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-grid p { color: var(--muted); font-size: 14px; margin-top: 12px; max-width: 40ch; }
.footer-col h4 { font-size: 14px; margin-bottom: 12px; }
.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 14px;
  padding: 5px 0;
  transition: color .18s;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- کمکی ---------- */
.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;
}
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* ورود با انیمیشن ملایم */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
