*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
html[dir="rtl"] { direction: rtl; }
body {
  font-family: var(--font-fa);
  background: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--text-brand); text-decoration: none; }
a:hover { color: var(--blue-800); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }

.skip {
  position: absolute;
  left: -9999px;
  inset-inline-start: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip:focus { inset-inline-start: 8px; background: var(--bg-surface); padding: 8px 12px; z-index: 100; }

.container { width: min(100% - 48px, var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - 48px, 480px); margin-inline: auto; }

.display { font-size: 64px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 700; margin: 0; }
.h1 { font-size: 40px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 700; margin: 0; }
.h2 { font-size: 28px; line-height: 1.4; font-weight: 700; margin: 0; }
.h3 { font-size: 22px; line-height: 1.45; font-weight: 600; margin: 0; }
.h4 { font-size: 18px; line-height: 1.5; font-weight: 600; margin: 0; }
.body-lg { font-size: 18px; line-height: 2; }
.body { font-size: 16px; line-height: 1.85; }
.body-sm { font-size: 14px; line-height: 1.8; }
.caption { font-size: 12px; line-height: 1.7; color: var(--text-muted); }
.label { font-size: 13px; line-height: 1.6; font-weight: 500; }
.muted { color: var(--text-secondary); }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; font-weight: 500;
  transition: background var(--duration-fast, 160ms) ease, color var(--duration-fast, 160ms) ease, border-color var(--duration-fast, 160ms) ease, transform 120ms ease, box-shadow var(--duration-fast, 160ms) ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--bg-brand); color: var(--text-inverse); }
.btn-primary:hover { background: var(--bg-brand-hover); color: var(--text-inverse); }
.btn-secondary { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-surface-soft); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-surface-soft); }
.btn-danger { background: transparent; color: var(--status-error); border-color: var(--border); }
.btn-ai { background: var(--violet-600); color: #fff; }
.btn-ai:hover { background: #6d28d9; color: #fff; }
.btn-lg { min-height: 48px; padding: 12px 22px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field span { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.input {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-primary);
}
.input:focus { border-color: var(--border-brand); box-shadow: var(--focus); outline: none; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 500;
}
.badge-ok { background: #f0fdf4; color: var(--status-success); }
.badge-warn { background: #fffbeb; color: #b45309; }
.badge-err { background: #fef2f2; color: var(--status-error); }
.badge-info { background: var(--blue-100); color: var(--blue-800); }
.badge-ai { background: #f5f3ff; color: var(--violet-600); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px; background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.logo { font-weight: 700; letter-spacing: 0.12em; font-size: 13px; color: var(--text-primary); }

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-hover) 100%);
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 8px 18px rgba(26, 86, 214, 0.22);
}

.brand-mark img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  display: block;
}

.brand-mark-inline {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.brand-word {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.footer-logo,
.modal-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-header .dash-brand,
.site-header .brand-lockup {
  margin: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 800;
}

.brand-lockup .brand-text {
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.brand-lockup .brand-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.nav { display: flex; gap: 28px; }
.nav a { color: var(--text-secondary); font-size: 14px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue-600); }
.header-actions { display: flex; gap: 8px; align-items: center; }

.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.kicker { font-size: 13px; letter-spacing: 0.04em; color: var(--blue-600); font-weight: 600; margin: 0 0 12px; }
pre, code, .code, input[type="tel"], input[type="url"] { direction: ltr; text-align: left; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.site-footer {
  padding: 48px 40px 64px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
  color: var(--text-secondary); font-size: 14px;
}
.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--text-primary); }
.site-footer h4 { color: var(--text-primary); margin: 0 0 16px; font-size: 13px; }

.footer-trust {
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-footer .footer-trust--site {
  grid-column: 1 / -1;
  padding-top: 8px;
}

.enamad-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface, #fff) 88%, white);
  border: 1px solid color-mix(in srgb, var(--border, #d8dee8) 90%, transparent);
  box-shadow: 0 8px 20px rgba(11, 28, 58, 0.06);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.enamad-seal:hover,
.enamad-seal:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary, #1a56d6) 28%, var(--border, #d8dee8));
  box-shadow: 0 12px 28px rgba(11, 28, 58, 0.1);
  outline: none;
}

.enamad-seal img {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.support-fab {
  position: fixed;
  inset-inline-end: max(18px, env(safe-area-inset-right, 0px));
  inset-block-end: max(18px, env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: grid;
  justify-items: end;
  gap: 10px;
  direction: rtl;
}

.support-fab-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 10px 8px 16px;
  border: 1px solid color-mix(in srgb, var(--primary, #1a56d6) 32%, transparent);
  border-radius: 999px;
  color: var(--text-inverse, #fff);
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(135deg, var(--primary, #1a56d6), var(--primary-hover, #1344b0));
  box-shadow: 0 18px 42px rgba(26, 86, 214, 0.28);
  cursor: pointer;
}

.support-fab-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.support-fab-copy {
  display: grid;
  gap: 1px;
  text-align: start;
  line-height: 1.35;
}

.support-fab-copy span {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.84;
}

.support-fab-copy strong {
  font-size: 13px;
  font-weight: 800;
}

.support-fab-panel {
  width: min(calc(100vw - 32px), 330px);
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(26, 86, 214, 0.12), transparent 60%),
    var(--bg-surface, #fff);
  box-shadow: 0 22px 60px rgba(11, 28, 58, 0.18);
}

.support-fab-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
}

.support-fab-text {
  margin: 6px 0 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.8;
}

.support-fab-phones {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.support-fab-phones a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-surface-soft, #f6f8fc) 70%, white);
  font-weight: 700;
}

.support-fab-phones a::before {
  content: "تماس";
  color: var(--text-brand);
  font-size: 12px;
  font-weight: 800;
}

.support-fab-call {
  width: 100%;
  border-radius: 14px;
}

@media (max-width: 640px) {
  .support-fab {
    inset-inline-start: auto;
    inset-inline-end: 14px;
    inset-block-end: max(14px, env(safe-area-inset-bottom, 0px));
    justify-items: end;
  }

  .support-fab-toggle {
    justify-content: flex-start;
    width: auto;
  }

  .support-fab-panel {
    width: calc(100vw - 28px);
  }
}

@media (max-width: 900px) {
  .display { font-size: 40px; line-height: 48px; }
  .h1 { font-size: 32px; line-height: 40px; }
  .site-header { padding: 0; }
  .nav { display: none; }
  .site-footer { grid-template-columns: 1fr 1fr; padding: 32px 16px 48px; }
  .container { width: min(100% - 32px, var(--container)); }
}

/* —— Promotion offer UI (pricing + billing) —— */
.pricing-card.has-promo,
.plan-card.has-promo {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-color: color-mix(in srgb, var(--warning) 42%, var(--border));
  background:
    linear-gradient(165deg, var(--warning-soft) 0%, transparent 42%),
    var(--surface);
  animation: promo-card-in 0.55s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

.pricing-card.has-promo > .btn,
.plan-card.has-promo > .btn {
  margin-top: auto;
}

.pricing-card.has-promo::before,
.plan-card.has-promo::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--warning) 0%,
    color-mix(in srgb, var(--warning) 55%, var(--primary)) 55%,
    var(--primary) 100%
  );
}

.promo-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
  background: color-mix(in srgb, var(--warning-soft) 88%, white);
  color: #9a5b05;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
  animation: promo-pop 0.45s 0.08s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

.promo-ribbon::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--warning);
  flex-shrink: 0;
}

.promo-was {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.promo-was s {
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, var(--error) 55%, var(--text-muted));
}

.pricing-card.has-promo .price,
.plan-card.has-promo .price {
  margin-top: 2px;
  color: var(--text-primary);
  animation: promo-price-in 0.5s 0.12s var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

.promo-save {
  display: inline-flex;
  align-items: center;
  margin: 8px 0 0;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--success-soft);
  color: #0a6b4a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

/* Digikala-like remaining time boxes → brand urgency strip on package cards */
.promo-countdown {
  margin: 16px 0 14px;
  padding: 12px 12px 11px;
  width: 100%;
  align-self: stretch;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 28%, var(--border, #d8dee8));
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--warning-soft, #fff7e8) 90%, white) 0%,
      color-mix(in srgb, var(--surface, #fff) 92%, #fff) 100%
    );
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.promo-countdown-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.promo-countdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4056;
  box-shadow: 0 0 0 4px color-mix(in srgb, #ef4056 18%, transparent);
  animation: promo-dot-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

.promo-countdown-label {
  margin: 0;
  color: color-mix(in srgb, #9a1f32 70%, var(--text-primary, #111));
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.promo-countdown-units {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  gap: 6px;
  direction: rtl;
}

.promo-countdown-unit[hidden],
.promo-countdown-sep[hidden] {
  display: none !important;
}

.promo-countdown-unit {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 8px 4px 7px;
  border-radius: 10px;
  background: #1c2434;
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 6px 14px rgba(28, 36, 52, 0.18);
}

.promo-countdown-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

.promo-countdown-caption {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0.78;
  font-family: var(--font-fa, inherit);
}

.promo-countdown-sep {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding-bottom: 14px;
  color: #ef4056;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.promo-countdown-status {
  margin: 0;
  color: var(--error, #dc2626);
  font-size: 12px;
  font-weight: 700;
}

.promo-countdown.is-expired {
  border-color: var(--border, #d8dee8);
  background: var(--surface-muted, #f5f6f8);
}

.promo-countdown.is-expired .promo-countdown-dot {
  background: #9ca3af;
  box-shadow: none;
  animation: none;
}

.promo-countdown.is-expired .promo-countdown-unit {
  background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
  box-shadow: none;
}

.promo-countdown.is-expired .promo-countdown-label {
  color: var(--text-muted, #6b7280);
}

@keyframes promo-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.65; }
}

.promo-code-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 22px;
  max-width: 440px;
  padding: 14px 16px;
  border: 1px dashed color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: var(--radius-xl, 16px);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary-light) 55%, white), var(--surface));
}

.promo-code-bar .field {
  flex: 1 1 12rem;
  margin: 0;
  text-align: start;
}

@keyframes promo-card-in {
  from { opacity: 0.55; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes promo-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes promo-price-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .pricing-card.has-promo,
  .plan-card.has-promo,
  .promo-ribbon,
  .pricing-card.has-promo .price,
  .plan-card.has-promo .price,
  .promo-countdown-dot {
    animation: none;
  }
}
