@import url("/css/fonts.css?v=1");

:root {
  --bg: #f7f7f8;
  --ink: #0d0d0d;
  --muted: #676767;
  --stroke: #e5e5e5;
  --card: #ffffff;
  --hover: rgba(0, 0, 0, 0.04);
  --accent: #0285ff;
  --accent-fg: #ffffff;
  --font: "IRANSansX", Tahoma, "Segoe UI", sans-serif;
  --recommended: #dbeafe;
  --recommended-fg: #1d4ed8;
  --badge-ordinary: #f3e8ff;
  --badge-ordinary-fg: #7c3aed;
  --badge-boss: #dcfce7;
  --badge-boss-fg: #15803d;
  --btn-dark: #0d0d0d;
  --btn-dark-fg: #ffffff;
}

html[data-theme="dark"] {
  --bg: #0d0d0d;
  --ink: #ececec;
  --muted: #9ca3af;
  --stroke: #2a2a2a;
  --card: #171717;
  --hover: rgba(255, 255, 255, 0.06);
  --recommended: #1e3a5f;
  --recommended-fg: #93c5fd;
  --badge-ordinary: #2e1065;
  --badge-ordinary-fg: #d8b4fe;
  --badge-boss: #14532d;
  --badge-boss-fg: #86efac;
  --btn-dark: #ffffff;
  --btn-dark-fg: #0d0d0d;
}

html[data-theme="dark"] .plan-cta.blue:hover:not(:disabled) {
  background: rgba(2, 133, 255, 0.18);
  border-color: rgba(2, 133, 255, 0.45);
  color: #93c5fd;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

.pricing-page,
.pricing-grid,
.plan-card,
.pricing-compare-section,
.pricing-compare,
.pricing-bottom,
.pricing-trust {
  font-family: var(--font);
}

.pricing-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border-radius: 8px;
  justify-self: start;
}
.back-link:hover { background: var(--hover); }

.back-link [data-ico] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 0;
}

.back-link .ico-svg {
  display: block;
  flex: 0 0 auto;
  transform: scaleX(-1);
}

.brand-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  justify-self: center;
  grid-column: 2;
  text-align: center;
}

.brand-mini svg {
  display: block;
  flex: 0 0 auto;
}

.theme-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  justify-self: end;
  grid-column: 3;
}
.theme-btn:hover { background: var(--hover); }

.pricing-page {
  max-width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 16px 72px;
}

.pricing-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 64px 16px;
  font-size: 15px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: none;
  gap: 12px;
  max-width: 440px;
  margin-inline: auto;
  align-items: stretch;
}

/* ── Card ── */
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  grid-row: auto;
  grid-column: auto;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 24px 24px 20px;
  min-height: 0;
  overflow: hidden;
}

.plan-card.is-recommended {
  border-color: #b8d9ff;
  background: linear-gradient(180deg, var(--card) 0%, var(--card) 55%, rgba(2, 133, 255, 0.06) 100%);
  box-shadow: 0 0 0 1px rgba(2, 133, 255, 0.08);
}

.plan-card.is-recommended::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(2, 133, 255, 0.07), transparent);
  pointer-events: none;
}

.plan-card > * { position: relative; z-index: 1; }

.plan-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 28px;
}

.plan-label {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.plan-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--recommended);
  color: var(--recommended-fg);
  line-height: 1.3;
  max-width: 11rem;
  text-align: center;
}

.plan-badge.badge-ordinary {
  background: var(--badge-ordinary);
  color: var(--badge-ordinary-fg);
}

.plan-badge.badge-boss {
  background: var(--badge-boss);
  color: var(--badge-boss-fg);
}

.plan-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.plan-desc {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
}

.plan-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  min-height: 40px;
}

.plan-price {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
.plan-price-old {
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: line-through;
  margin-inline-end: 8px;
}
.plan-price-sale {
  color: #0b6bcb;
}

.plan-price-unit {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

/* ── CTA buttons ── */
.plan-cta {
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--muted);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.plan-cta:hover:not(:disabled) { background: var(--hover); }

.plan-cta.current {
  cursor: default;
  background: var(--btn-dark);
  border-color: var(--btn-dark);
  color: var(--btn-dark-fg);
}

.plan-cta.ghost {
  background: var(--card);
  border-color: var(--stroke);
  color: var(--muted);
}
.plan-cta.ghost:hover:not(:disabled) { background: var(--hover); }

.plan-cta.dark {
  background: var(--btn-dark);
  border-color: var(--btn-dark);
  color: var(--btn-dark-fg);
}
.plan-cta.dark:hover:not(:disabled) { filter: brightness(1.08); }

.plan-cta.blue {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.plan-cta.blue:hover:not(:disabled) {
  background: #e8f3ff;
  border-color: #b8d9ff;
  color: var(--accent);
  filter: none;
}

.plan-cta:disabled {
  opacity: 1;
  cursor: default;
}

.plan-cta-spark {
  font-size: 13px;
  line-height: 1;
}

/* ── Features ── */
.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  align-content: start;
  align-self: stretch;
  flex: 1 1 auto;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
}

.plan-features .feat-ic {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--ink);
}

.plan-card.is-recommended .plan-features .feat-ic {
  color: var(--accent);
}

.plan-foot {
  margin: 16px 0 0;
  padding-top: 14px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  align-self: end;
}

.plan-foot a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.plan-foot a.plan-details-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  font-size: 13px;
}
.plan-foot a.plan-details-link:hover {
  color: #0269cc;
}

/* ── Bottom sections ── */
.pricing-bottom {
  margin-top: 40px;
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}

.promo-toggle {
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

.promo-panel {
  margin-top: 16px;
  text-align: start;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 18px;
}

.promo-panel label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.promo-row {
  display: flex;
  gap: 8px;
}

.promo-row input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.promo-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.pricing-pay {
  margin-top: 32px;
  padding-top: 0;
  text-align: center;
}

.pricing-pay h2 {
  display: none;
}

.pricing-pay p {
  margin: 0 auto 14px;
  max-width: 480px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ── Compare table (GapGPT-style) ── */
.pricing-compare-section {
  margin-top: 36px;
  margin-bottom: 24px;
}

.pricing-compare-title {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.pricing-compare-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
}

.pricing-compare-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pricing-compare {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
}

.pricing-compare th,
.pricing-compare td {
  padding: 12px 10px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--stroke);
  font-size: 13px;
  line-height: 1.45;
}

.pricing-compare thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  padding-top: 16px;
  padding-bottom: 14px;
}

.pricing-compare tbody tr:last-child th,
.pricing-compare tbody tr:last-child td {
  border-bottom: 0;
}

.pricing-compare .col-feature {
  width: 38%;
  min-width: 160px;
  text-align: start;
  font-weight: 500;
  color: var(--ink);
  padding-inline-start: 20px;
}

.pricing-compare thead .col-feature {
  color: var(--muted);
  font-weight: 500;
}

.pricing-compare .col-plan {
  width: 15.5%;
  min-width: 72px;
}

.pricing-compare .col-highlight {
  color: var(--accent);
  font-weight: 600;
}

.pricing-compare thead .col-highlight {
  color: var(--accent);
}

.pricing-compare tbody tr:nth-child(even):not(.cmp-section-row) .col-feature,
.pricing-compare tbody tr:nth-child(even):not(.cmp-section-row) .col-plan {
  background: var(--hover);
}

.cmp-section-row .cmp-section-head {
  padding: 14px 20px;
  text-align: start;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: #f3f4f6;
  border-bottom: 1px solid var(--stroke);
}

html[data-theme="dark"] .cmp-section-row .cmp-section-head {
  background: #1f1f1f;
}

.cmp-feature-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cmp-model-ic {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
}

.cmp-model-row {
  font-size: 12px;
  font-weight: 500;
}

.cmp-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 15px;
  font-weight: 700;
  color: #16a34a;
  line-height: 1;
}

.cmp-check.highlight {
  color: #16a34a;
}

.cmp-cross {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 15px;
  font-weight: 700;
  color: #dc2626;
  line-height: 1;
}

.cmp-dash {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.cmp-value {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.cmp-value.highlight {
  color: var(--accent);
}

/* ── Trust badges ── */
.pricing-trust {
  margin-top: 28px;
  text-align: center;
}

.pricing-trust-lead {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.pricing-trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 110px;
  height: 110px;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--stroke);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.trust-badge:hover {
  border-color: rgba(2, 133, 255, 0.35);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.trust-enamad img,
.trust-zarinpal img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 90px;
  max-height: 90px;
  object-fit: contain;
  cursor: pointer;
}

.pay-actions {
  display: none;
}

.btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  z-index: 50;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Tablet / small laptop: 2×2, no subgrid (avoids collapsed columns) */
@media (min-width: 721px) and (max-width: 1180px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 760px;
  }
  .plan-card {
    padding: 24px 24px 20px;
    border-radius: 24px;
  }
  .plan-title {
    font-size: 28px;
  }
  .plan-price {
    font-size: 36px;
  }
}

/* Desktop wide: 4 cards in one row with subgrid-aligned sections */
@media (min-width: 1181px) {
  .pricing-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto auto minmax(140px, 1fr) auto;
    gap: 16px;
    max-width: none;
    margin-inline: 0;
  }
  .plan-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: 1 / span 7;
    padding: 24px 24px 20px;
    border-radius: 24px;
  }
  .plan-features {
    flex: unset;
  }
  .plan-title {
    font-size: 28px;
  }
  .plan-price {
    font-size: 36px;
  }
}

@media (max-width: 720px) {
  .pricing-page {
    max-width: 100%;
    padding: 8px 12px 56px;
  }
  .pricing-top {
    padding: 10px 12px;
    gap: 8px;
  }
  .back-link {
    font-size: 13px;
    padding: 0 6px;
  }
  .plan-card {
    padding: 20px 18px 16px;
    border-radius: 20px;
  }
  .plan-title {
    font-size: 24px;
  }
  .plan-price {
    font-size: 30px;
  }
  .pricing-compare-title {
    font-size: 18px;
  }
  .pricing-compare .col-feature {
    padding-inline-start: 14px;
    font-size: 12px;
  }
}
