/* صفحه‌های محتوایی منو (قیمت‌گذاری، قوانین، امکانات، نتیجه‌ی پرداخت) */
.page-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 20px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.page-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--brand-deep);
}

.page-brand img {
  width: 32px;
  height: 32px;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--cyan), var(--violet), var(--magenta), var(--cyan));
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.page-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-deep);
}

.page-nav a:hover,
.page-nav a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
}

.page-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.page-hero {
  text-align: center;
  margin-bottom: 28px;
}

.page-hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand) 60%, #b012b8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.page-updated {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  font-size: 12px;
  color: var(--brand-deep);
}

.doc-section {
  margin-bottom: 16px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.doc-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 17px;
  color: var(--brand-deep);
}

.doc-section h2 i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-size: 14px;
}

.doc-section p,
.doc-section li {
  font-size: 14px;
  line-height: 1.9;
  color: var(--brand-ink);
}

.doc-section ul,
.doc-section ol {
  margin: 0;
  padding-right: 20px;
}

.doc-section code,
.doc-section pre {
  font-family: ui-monospace, Consolas, monospace;
  direction: ltr;
  unicode-bidi: embed;
}

.doc-section code {
  /* آدرس‌های طولانی بدون فاصله (مثل /route?point=...) در موبایل بشکنند */
  overflow-wrap: anywhere;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--brand-soft);
  font-size: 12.5px;
}

.doc-section pre {
  overflow-x: auto;
  padding: 14px;
  border-radius: 12px;
  background: #1e1044;
  color: #e6fbff;
  font-size: 12.5px;
  line-height: 1.7;
  text-align: left;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.doc-table-wrap {
  overflow-x: auto;
}

.doc-table th,
.doc-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

.doc-table th {
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-note {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(47, 208, 255, 0.1);
  border-right: 4px solid var(--cyan);
  font-size: 13px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.feature-tile {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(160deg, #fbf9ff, var(--brand-soft));
  border: 1px solid var(--border);
}

.feature-tile i {
  font-size: 20px;
  color: var(--brand);
}

.feature-tile h3 {
  margin: 8px 0 4px;
  font-size: 15px;
  color: var(--brand-ink);
}

.feature-tile p {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.page-footer {
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.page-footer a {
  color: var(--brand);
}

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-nav {
    justify-content: center;
  }

  .page-hero h1 {
    font-size: 22px;
  }

  .doc-section {
    padding: 16px;
  }
}

/* صفحه‌ی نتیجه‌ی پرداخت */
.pay-result {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
}

.pr-icon {
  font-size: 56px;
}

.is-paid .pr-icon { color: #10b981; }
.is-failed .pr-icon { color: #c0392b; }

.pr-title {
  justify-content: center;
  margin-top: 6px !important;
}

.pr-desc {
  color: var(--muted) !important;
}

.pr-list {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--brand-soft);
  text-align: right;
}

.pr-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13.5px;
}

.pr-row + .pr-row {
  border-top: 1px dashed var(--border);
}

.pr-row dt {
  color: var(--muted);
}

.pr-row dd {
  margin: 0;
  font-weight: 700;
  color: var(--brand-ink);
  direction: ltr;
  unicode-bidi: plaintext;
}

.pr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b8fc0, var(--brand) 50%, #b012b8);
  color: #fff !important;
  font-weight: 800;
}

/* ===== پنل مشتری ===== */
.pn-meta {
  margin: -4px 0 14px;
  font-size: 13px !important;
  color: var(--muted) !important;
}

.pn-plan {
  position: relative;
  overflow: hidden;
}

.pn-plan::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--grad);
}

.pn-plan--bronze::after { background: linear-gradient(90deg, #c98a5a, #8f5228); }
.pn-plan--silver::after { background: linear-gradient(90deg, #d3d3d8, #8d8d96); }
.pn-plan--gold::after { background: linear-gradient(90deg, #f1cf6e, #c9971f); }

.pn-usage-line {
  margin: 0 0 8px;
  font-weight: 700;
}

.pn-progress {
  height: 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  overflow: hidden;
}

.pn-progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.pn-progress.is-warn span {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.pn-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.pn-stat {
  padding: 12px;
  border-radius: 14px;
  background: var(--brand-soft);
  text-align: center;
}

.pn-stat strong {
  display: block;
  font-size: 18px;
  color: var(--brand-deep);
}

.pn-stat span {
  font-size: 11.5px;
  color: var(--muted);
}

.pn-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pn-hint {
  font-size: 12px !important;
  color: var(--muted) !important;
}

.pn-empty {
  color: var(--muted) !important;
}

.pn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--brand-deep);
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
}

.pn-btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, #0b8fc0, var(--brand) 50%, #b012b8);
  color: #fff;
}

.pn-btn--danger {
  color: #c0392b;
  margin-top: 10px;
}

.pn-btn:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.pn-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff5e6;
  border: 1px solid #f5c26b;
  color: #7a4a00;
  font-size: 13px;
}

.pn-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding-bottom: 20px;
}

.pn-bar {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.pn-bar span {
  display: block;
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--violet), var(--brand));
  opacity: 0.85;
}

.pn-bar:hover span {
  opacity: 1;
  background: var(--grad);
}

.pn-bar small {
  position: absolute;
  bottom: -20px;
  right: 50%;
  transform: translateX(50%);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.pn-key {
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fbf9ff;
}

.pn-key-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pn-key-head strong {
  display: block;
  font-size: 14.5px;
}

.pn-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  font-size: 11.5px;
  color: var(--brand-deep);
}

.pn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.pn-chip {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(47, 208, 255, 0.12);
  border: 1px solid rgba(47, 208, 255, 0.4);
  font-size: 11.5px;
  direction: ltr;
}

.pn-chip.is-ip {
  background: rgba(153, 101, 253, 0.1);
  border-color: rgba(153, 101, 253, 0.35);
}

.pn-chip.is-open {
  background: #fff5e6;
  border-color: #f5c26b;
  color: #7a4a00;
  direction: rtl;
}

.pn-edit summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

.pn-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.pn-form label {
  flex: 1 1 100%;
  font-size: 12.5px;
  font-weight: 600;
}

.pn-form textarea,
.pn-form input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 14px;
}

.pn-form input {
  flex: 1 1 180px;
  width: auto;
  margin-top: 0;
  min-height: 42px;
}

.pn-form textarea:focus,
.pn-form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(109, 58, 224, 0.15);
}

/* ---------- تیکت پشتیبانی ---------- */
.pn-form label input,
.pn-form select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  min-height: 42px;
}

.pn-form select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(109, 58, 224, 0.15);
}

.pn-form > .pn-actions {
  flex: 1 1 100%;
  margin-top: 0;
}

.pn-tickets {
  margin-bottom: 12px;
}

.pn-ticket {
  margin-bottom: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fbf9ff;
}

.pn-ticket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.pn-ticket-head::-webkit-details-marker {
  display: none;
}

.pn-ticket-head strong {
  display: block;
  font-size: 14.5px;
}

.pn-ticket-head small {
  color: var(--muted);
  font-size: 11.5px;
}

.pn-tstatus {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  white-space: nowrap;
}

.pn-tstatus.is-open { background: #fff5e6; color: #7a4a00; }
.pn-tstatus.is-answered { background: #e6f7ef; color: #0b6b43; }
.pn-tstatus.is-closed { background: #efedf3; color: var(--muted); }

.pn-ticket-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}

.pn-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.pn-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
}

.pn-msg.is-customer {
  align-self: flex-start;
}

.pn-msg.is-support {
  align-self: flex-end;
  background: var(--brand-soft);
  border-color: rgba(109, 58, 224, 0.25);
}

.pn-msg small {
  color: var(--muted);
  font-size: 11px;
}

.pn-msg p {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pn-new-key,
.pn-new-ticket,
.pn-add-mobile {
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.pn-secret {
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(160deg, #effcff, #f5efff);
  border: 2px solid var(--cyan);
  box-shadow: var(--shadow-md);
}

.pn-secret-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.pn-secret-row code {
  flex: 1 1 260px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1e1044;
  color: #e6fbff;
  font-size: 13px;
  direction: ltr;
  word-break: break-all;
}

.pn-mobiles {
  list-style: none;
  padding: 0 !important;
}

.pn-mobiles li {
  display: inline-block;
  margin: 0 0 6px 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--brand-soft);
  letter-spacing: 1px;
}

.pn-toast {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 300;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 12px;
  background: #1e1044;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-md);
}

.pn-toast.is-error {
  background: #c0392b;
}

/* موبایل: جدول‌ها به کارت‌های زیر هم تبدیل می‌شوند (بدون اسکرول افقی) —
   عنوان ستون از data-label (js/tables.js) کنار هر مقدار می‌آید */
@media (max-width: 640px) {
  .doc-table-wrap {
    overflow: visible;
  }

  .doc-table,
  .doc-table tbody,
  .doc-table tr,
  .doc-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .doc-table thead {
    display: none;
  }

  .doc-table tr {
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbf9ff;
  }

  /* block + عنوان شناور (نه flex): متن و کد مخلوط در یک سلول درست جریان پیدا کند */
  .doc-table td {
    display: flow-root;
    padding: 6px 0;
    white-space: normal;
    border-bottom: 1px dashed var(--border);
    text-align: left;
  }

  .doc-table tr td:last-child {
    border-bottom: none;
  }

  .doc-table td[data-label]::before {
    content: attr(data-label);
    float: right;
    margin-left: 12px;
    max-width: 45%;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-align: right;
  }

  /* ستون اول (نام پلن / کد) عنوان کارت است */
  .doc-table td:first-child {
    font-weight: 800;
    color: var(--brand-deep);
  }

  .doc-section pre {
    font-size: 11.5px;
  }
}

/* دکمه‌ی بازگشت هدر (ساخته‌شده در js/tabbar.js) */
.page-back {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.page-back:hover {
  background: #fff;
}

/* دکمه ظاهراً کوچک است، ولی ناحیه‌ی لمس نامرئی‌اش ~۴۴px می‌ماند */
.page-back::after {
  content: "";
  position: absolute;
  inset: -8px -4px;
}

.page-back:active {
  transform: scale(0.95);
}

.page-back:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  /* موبایل: هدر افقی می‌ماند — لوگو راست، بازگشت چپ */
  .page-header {
    flex-direction: row;
    align-items: center;
  }
}

/* موبایل: دکمه‌ی بازگشت ۱۰٪ کوچک‌تر (ناحیه‌ی لمس نامرئی همان می‌ماند) */
@media (max-width: 640px) {
  .page-back {
    gap: 5px;
    padding: 4.5px 9px;
    border-radius: 11px;
    font-size: 11.7px;
  }
}
