/* =========================================================================
   ESPYR CLOUD — BASE / DESIGN SYSTEM
   یک فایل واحد برای همه چیزهای مشترک بین صفحات:
   توکن‌ها، ریست، هدر، فوتر، دکمه‌ها، کارت پلن‌ها، گریدها و ریسپانسیو
   ========================================================================= */

/* ---------- 1. توکن‌های طراحی ---------- */
:root {
  /* رنگ برند */
  --brand:        #0052cc;
  --brand-dark:   #003f9e;
  --brand-soft:   #e8f0fe;
  --brand-ring:   rgba(0, 82, 204, .28);

  /* خنثی‌ها */
  --ink:          #0f172a;
  --ink-2:        #334155;
  --muted:        #64748b;
  --muted-2:      #94a3b8;
  --line:         #e5e9f0;
  --surface:      #ffffff;
  --surface-2:    #f1f5f9;
  --bg:           #f6f8fb;

  /* رنگ‌های وضعیت */
  --ok:           #16a34a;
  --ok-soft:      #e7f8ee;
  --warn:         #f97316;
  --warn-soft:    #fff0e6;
  --violet:       #8b5cf6;
  --violet-soft:  #f3ecff;
  --cyan:         #0891b2;
  --cyan-soft:    #e0f6fb;

  /* لهجه رنگی هر صفحه (در فایل css هر صفحه بازنویسی می‌شود) */
  --accent:       var(--brand);
  --accent-soft:  var(--brand-soft);

  /* شعاع گوشه‌ها */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* سایه‌ها */
  --sh-1: 0 1px 2px rgba(15, 23, 42, .04);
  --sh-2: 0 4px 16px rgba(15, 23, 42, .06);
  --sh-3: 0 18px 40px -12px rgba(15, 23, 42, .18);

  /* تایپوگرافی سیال — با عرض صفحه بزرگ و کوچک می‌شود */
  --fs-2xs: clamp(10.5px, .62rem + .1vw, 11.5px);
  --fs-xs:  clamp(11.5px, .68rem + .15vw, 13px);
  --fs-sm:  clamp(13px,  .76rem + .2vw,  14.5px);
  --fs-md:  clamp(14px,  .82rem + .25vw, 16px);
  --fs-lg:  clamp(16px,  .9rem  + .35vw, 19px);
  --fs-h3:  clamp(17px,  .95rem + .5vw,  22px);
  --fs-h2:  clamp(21px,  1.1rem + .9vw,  30px);
  --fs-h1:  clamp(26px,  1.3rem + 2.1vw, 44px);

  /* چیدمان */
  --gutter:   clamp(16px, 4vw, 40px);
  --maxw:     1200px;
  --gap:      clamp(12px, 1.4vw, 18px);
  --section:  clamp(38px, 6vw, 76px);
  --header-h: 64px;
}

/* ---------- 2. ریست ---------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, system-ui, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.75;
  color: var(--ink-2);
  background: var(--bg);
  direction: rtl;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;               /* بدون قطع کردن sticky برخلاف overflow:hidden */
  -webkit-font-smoothing: antialiased;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.35; font-weight: 800; text-wrap: balance; }
p { text-wrap: pretty; }

/* اعداد فارسی/لاتین قاطی نشوند */
.ltr { direction: ltr; unicode-bidi: isolate; }

/* متن‌هایی که ممکن است فارسی یا انگلیسی باشند: جهتشان از خودشان گرفته شود
   تا «4 vCPU» به شکل «vCPU 4» برعکس نشود */
.plan-title,
.plan-features li,
.plan-price .amount,
.spec h4, .spec p,
.perk h4, .perk p { unicode-bidi: plaintext; }

/* فوکوس قابل مشاهده برای دسترسی‌پذیری */
:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

/* احترام به تنظیم «کاهش انیمیشن» سیستم کاربر */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* فقط برای صفحه‌خوان — دیده نمی‌شود ولی خوانده می‌شود */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* پرش به محتوا (فقط با Tab دیده می‌شود) */
.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 200;
  background: var(--brand);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- 3. کانتینر و بخش‌ها ---------- */
.container {
  width: min(var(--maxw), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { flex: 1 0 auto; }

.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(26px, 4vw, 48px); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: clamp(20px, 3vw, 34px);
}
.section-head h2 { font-size: var(--fs-h2); letter-spacing: -.02em; }
.section-head p  { font-size: var(--fs-sm); color: var(--muted); max-width: 62ch; }

/* ---------- 4. دکمه‌ها ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  border: 1.5px solid transparent;
  transition: background-color .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 1em; height: 1em; flex: none; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 8px 20px -6px var(--brand-ring); }

.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }

.btn-ghost { color: var(--ink-2); padding-inline: 12px; }
.btn-ghost:hover { color: var(--brand); }

.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { filter: brightness(.96); }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: var(--fs-xs); }

/* ---------- 5. هدر ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: var(--sh-1); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 28px);
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.brand-icon { width: 27px; height: 27px; flex: none; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 15px;
  letter-spacing: .06em;
  color: var(--ink);
  font-weight: 500;
  direction: ltr;
}
.brand-text b { font-weight: 800; }

/* منوی اصلی */
.nav { display: flex; align-items: center; gap: clamp(14px, 1.8vw, 26px); }
.nav-link {
  position: relative;
  white-space: nowrap;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  padding-block: 6px;
  transition: color .18s;
}
.nav-link:hover { color: var(--ink); }
.nav-link.is-active { color: var(--brand); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.nav-auth { display: none; }

/* دکمه همبرگری */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  color: var(--ink);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--surface);
}
.nav-toggle:hover { color: var(--brand); border-color: var(--brand); }
.nav-toggle .ico-close { display: none; }
.nav-toggle[aria-expanded="true"] .ico-open  { display: none; }
.nav-toggle[aria-expanded="true"] .ico-close { display: block; }

/* ---------- 6. مسیر راهنما ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: clamp(14px, 2vw, 22px);
  font-size: var(--fs-xs);
  color: var(--muted-2);
}
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: var(--line); }
.breadcrumb [aria-current] { color: var(--ink-2); font-weight: 600; }

/* ---------- 7. هیروی صفحات داخلی ---------- */
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(26px, 4vw, 54px);
}
.page-hero__title {
  font-size: var(--fs-h1);
  letter-spacing: -.02em;
  margin-bottom: 10px;
}
.page-hero__title span { display: block; color: var(--brand); font-size: .5em; font-weight: 700; margin-top: 8px; line-height: 1.6; }
.page-hero__lead {
  font-size: var(--fs-sm);
  color: var(--muted);
  max-width: 58ch;
}
.page-hero__media { position: relative; }

/* قاب تصویر — تا وقتی عکس اضافه نشده هم چیدمان نمی‌پرد */
.media-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.media-frame::before {
  content: "";
  position: absolute;
  inset: 12% ;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  filter: blur(28px);
  z-index: 0;
}
.media-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* اگر فایل عکس هنوز آپلود نشده باشد، آیکون شکسته نشان داده نمی‌شود */
.is-missing { visibility: hidden; }
.media-frame:has(.is-missing)::after {
  content: "";
  position: absolute;
  inset: 8%;
  z-index: 1;
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
}

/* ---------- 8. نوار مشخصات (۴ آیتم زیر هیرو) ---------- */
.spec-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--gap);
  margin-top: clamp(20px, 3vw, 30px);
}
.spec {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--sh-1);
}
.spec-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  padding: 8px;
}
.spec-icon img { width: 100%; height: 100%; object-fit: contain; }
.spec h4 { font-size: var(--fs-xs); font-weight: 700; }
.spec p  { font-size: var(--fs-2xs); color: var(--muted); line-height: 1.5; }

/* ---------- 9. کارت پلن‌ها (مشترک بین همه صفحات فروش) ---------- */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--gap);
  align-items: stretch;
}
.plans--5 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.plans--6 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.plan {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 18px 18px;
  box-shadow: var(--sh-1);
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
@media (hover: hover) {
  .plan:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: #d5dde9; }
}
.plan.is-featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), 0 18px 34px -18px var(--brand-ring);
}

.plan-badge {
  position: absolute;
  top: 0;
  inset-inline-start: 50%;
  transform: translate(50%, -50%);
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-2xs);
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  box-shadow: 0 6px 14px -6px var(--brand-ring);
}

.plan-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-inline: auto;
}
.plan-title {
  font-size: var(--fs-h3);
  font-weight: 800;
  text-align: center;
  letter-spacing: -.01em;
}

.plan-price { text-align: center; }
.plan-price .from   { display: block; font-size: var(--fs-2xs); color: var(--muted-2); }
.plan-price .amount { font-size: clamp(19px, 1rem + .9vw, 26px); font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.plan-price .period { display: block; font-size: var(--fs-2xs); color: var(--muted); margin-top: 2px; }

.plan-features {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: var(--fs-xs);
  color: var(--ink-2);
  line-height: 1.6;
}
.plan-features li::before {
  content: "";
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat;
}
/* حالت چیپ افقی — برای پسوندهای دامنه */
.plan-features.is-chips { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; }
.plan-features.is-chips li { direction: ltr; background: var(--brand-soft); color: var(--brand); font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); }
.plan-features.is-chips li::before { display: none; }

.plan .btn { margin-top: 4px; }

/* ---------- 10. مزیت‌ها (ردیف آیکون‌دار) ---------- */
.perks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: var(--gap);
}
.perk {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--sh-1);
  transition: border-color .2s, transform .2s;
}
@media (hover: hover) { .perk:hover { border-color: #d5dde9; transform: translateY(-2px); } }
.perk-icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  padding: 9px;
}
.perk-icon img { width: 100%; height: 100%; object-fit: contain; }
.perk > div { min-width: 0; }
.perk h4 { font-size: var(--fs-sm); font-weight: 700; }
.perk p  { font-size: var(--fs-2xs); color: var(--muted); line-height: 1.5; }

/* ---------- 11. حالت بارگذاری و خطا ---------- */
.skeleton {
  border-radius: var(--r-lg);
  min-height: 230px;
  background: linear-gradient(100deg, var(--surface-2) 30%, #e8edf4 50%, var(--surface-2) 70%) 0 0 / 220% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

.load-error {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  padding: 30px 20px;
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* ---------- 12. فوتر ---------- */
.site-footer {
  margin-top: var(--section);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-top: clamp(30px, 4vw, 52px);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--gap);
}
.footer-card {
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.footer-card--cta { background: var(--brand-soft); border-color: #cfe0fb; }
.footer-card--cta h4 { font-size: var(--fs-lg); color: var(--brand); }
.footer-card--cta p  { font-size: var(--fs-xs); color: var(--muted); margin: 6px 0 14px; }

.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-card h4 { font-size: var(--fs-sm); margin-bottom: 14px; }
.footer-links a { font-size: var(--fs-xs); color: var(--muted); }
.footer-links a:hover { color: var(--brand); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 10px; }
.stat .num { display: block; font-size: var(--fs-lg); font-weight: 800; color: var(--brand); direction: ltr; }
.stat .lbl { font-size: var(--fs-2xs); color: var(--muted); }

.brands { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.brand-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted-2); }
.brand-chip img { width: 16px; height: 16px; object-fit: contain; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: clamp(22px, 3vw, 34px);
  padding-block: 18px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-2xs);
  color: var(--muted-2);
}
.socials { display: flex; align-items: center; gap: 14px; }
.socials a { color: var(--muted-2); transition: color .18s, transform .18s; }
.socials a:hover { color: var(--brand); transform: translateY(-2px); }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-weight: 700; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

/* =========================================================================
   ریسپانسیو — از بزرگ به کوچک
   ========================================================================= */

/* تبلت افقی و لپ‌تاپ کوچک */
@media (max-width: 1080px) {
  .nav { gap: 14px; }
  .nav-link { font-size: var(--fs-xs); }
}

/* تبلت — منو تبدیل به کشوی بازشو می‌شود */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .header-actions > .btn { display: none; }

  .nav {
    position: fixed;
    inset-block: var(--header-h) auto;
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-3);
    padding: 8px var(--gutter) 18px;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    transform: translateY(-14px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.is-open { transform: translateY(0); opacity: 1; visibility: visible; }

  .nav-link {
    padding: 14px 12px;
    border-bottom: 1px solid var(--surface-2);
    border-radius: var(--r-sm);
    font-size: var(--fs-sm);
  }
  .nav-link.is-active { background: var(--brand-soft); border-bottom-color: transparent; }
  .nav-link.is-active::after { display: none; }

  .nav-auth { display: flex; gap: 10px; margin-top: 16px; }
  .nav-auth .btn { flex: 1; }

  .page-hero { grid-template-columns: 1fr; text-align: center; }
  .page-hero__lead { margin-inline: auto; }
  .page-hero__media { order: -1; max-width: 380px; margin-inline: auto; }
  .spec { text-align: start; }
}

@media (max-width: 1000px) {
  .perks { grid-template-columns: repeat(2, 1fr); }
}

/* موبایل */
@media (max-width: 560px) {
  .spec-bar { grid-template-columns: 1fr 1fr; }
  .spec { flex-direction: column; align-items: flex-start; gap: 8px; }
  .plans, .plans--5, .plans--6 { grid-template-columns: 1fr; }
  .plan { padding: 22px 18px 18px; }
  .perks { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
  .spec-bar { grid-template-columns: 1fr; }
  .brand-text { font-size: 13px; }
}

/* پرینت */
@media print {
  .site-header, .nav-toggle, .site-footer, .breadcrumb { display: none !important; }
  body { background: #fff; }
}
