:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --text: #161a26;
  --muted: #6b7285;
  --border: #e3e6ee;
  --primary: #3d5afe;
  --primary-ink: #ffffff;
  --primary-soft: #e8ecff;
  --ok: #12996b;
  --ok-soft: #e2f6ee;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --bad: #d43d51;
  --bad-soft: #fde8eb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1118;
    --surface: #161a24;
    --surface-2: #1d2230;
    --text: #e8eaf1;
    --muted: #9198ab;
    --border: #2a3040;
    --primary: #6c83ff;
    --primary-soft: #222a4d;
    --ok: #3ccf98;
    --ok-soft: #133328;
    --warn: #f0b552;
    --warn-soft: #3a2d14;
    --bad: #ff6b7f;
    --bad-soft: #3d1a20;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Vazirmatn", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; direction: ltr; unicode-bidi: embed; }
pre {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; overflow-x: auto; direction: ltr; text-align: left; font-size: 13px;
}
.ltr { direction: ltr; text-align: left; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.break { word-break: break-all; }

/* Layout */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar .inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), #00c2a8); }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; white-space: nowrap; }
.nav a.active, .nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 28px; padding-bottom: 60px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); min-width: 0;
}
.card + .card { margin-top: 16px; }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.5rem; font-weight: 800; margin-top: 4px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1, .head h2 { margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 10px 8px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; }
tr:last-child td { border-bottom: 0; }

/* Forms */
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input.mono { font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }
.btn.block { width: 100%; }

/* Badges & alerts */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.paid, .badge.on { background: var(--ok-soft); color: var(--ok); }
.badge.waiting, .badge.pending { background: var(--primary-soft); color: var(--primary); }
.badge.partial { background: var(--warn-soft); color: var(--warn); }
.badge.expired, .badge.cancelled, .badge.off { background: var(--bad-soft); color: var(--bad); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert ul { margin: 0; padding-inline-start: 18px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-color: var(--primary); text-decoration: none; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-all; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 8px; } }

.copy { display: flex; gap: 6px; align-items: stretch; }
.copy input { flex: 1; min-width: 0; }

.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; list-style: none; padding: 0; }
.pagination a, .pagination span { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); font-size: .85rem; }

/* Auth & landing */
.auth { max-width: 420px; margin: 60px auto; }

/* Payment page */
.pay { max-width: 480px; margin: 30px auto; padding: 0 16px; }
.pay .amount { font-size: 2rem; font-weight: 800; }
.pay .timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.coins { display: grid; gap: 10px; }
.coin {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer; text-align: start;
}
.coin:hover { border-color: var(--primary); background: var(--primary-soft); }
.coin .sym {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: .72rem; background: var(--surface-2);
}
.qr { display: block; width: 210px; height: 210px; margin: 0 auto 16px; background: #fff; padding: 8px; border-radius: 12px; }
.memo-box { border: 2px dashed var(--warn); border-radius: 12px; padding: 12px; background: var(--warn-soft); }
.big-icon { font-size: 3rem; text-align: center; }
footer.site { text-align: center; color: var(--muted); font-size: .8rem; padding: 30px 0; }

/* Language switcher */
.lang-select { width: auto; padding: 5px 10px; border-radius: 8px; font-size: .82rem; background: var(--surface-2); cursor: pointer; }
.end { text-align: end; }

/* Landing page */
.lp { --lp-accent: #00c2a8; }
.lp-hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
  padding: 56px 0 40px; position: relative;
}
.lp-hero::before {
  content: ""; position: absolute; inset: -40px 0 auto; height: 520px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 60% at 15% 30%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 70%),
    radial-gradient(35% 55% at 85% 40%, color-mix(in srgb, var(--lp-accent) 14%, transparent), transparent 70%);
}
.lp-hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 800; letter-spacing: -.01em; margin-bottom: .45em; }
.lp-lead { color: var(--muted); font-size: 1.08rem; max-width: 560px; }
.lp-cta { margin-top: 26px; }
.lp-btn { padding: 12px 22px; font-size: 1rem; border-radius: 12px; }
.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; margin-bottom: 18px;
  border: 1px solid var(--border); border-radius: 99px; background: var(--surface);
  font-size: .82rem; color: var(--muted);
}
.lp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lp-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lp-accent) 20%, transparent); }

/* Sample payment card */
.lp-demo { position: relative; max-width: 380px; width: 100%; justify-self: center; }
.lp-demo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px;
  box-shadow: 0 20px 50px -20px rgba(16, 24, 40, .35); transform: rotate(-1.5deg);
}
.lp-demo-amount { font-size: 2rem; font-weight: 800; margin: 14px 0 16px; }
.lp-demo-body { display: flex; gap: 16px; align-items: center; }
.lp-qr { width: 112px; height: 112px; flex: none; background: #fff; padding: 6px; border-radius: 10px; border: 1px solid var(--border); }
.lp-demo-fields { flex: 1; min-width: 0; display: grid; gap: 4px; }
.lp-demo-field { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: .88rem; margin-bottom: 6px; direction: ltr; text-align: start; }
.lp-status { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 3px 10px; border-radius: 99px; }
.lp-pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: lp-pulse 1.6s ease-in-out infinite; }
@keyframes lp-pulse { 50% { opacity: .25; } }
.lp-demo-toast {
  position: absolute; inset-inline-end: -18px; bottom: -44px; display: flex; gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px;
  box-shadow: 0 12px 30px -12px rgba(16, 24, 40, .35); animation: lp-float 4s ease-in-out infinite;
}
.lp-toast-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-weight: 800; }
@keyframes lp-float { 50% { transform: translateY(-6px); } }

/* Networks strip */
.lp-networks { text-align: center; padding: 34px 0 10px; }
.lp-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.lp-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.lp-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); font-weight: 600; font-size: .9rem; }
.lp-chip-dot { width: 10px; height: 10px; border-radius: 50%; }

/* Sections */
.lp-section { padding: 56px 0 0; }
.lp-h2 { text-align: center; font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 28px; }
.lp-step { position: relative; padding: 22px; border-radius: var(--radius); border: 1px dashed var(--border); }
.lp-step h3, .lp-feature h3 { margin-bottom: .35em; }
.lp-step p, .lp-feature p { color: var(--muted); margin: 0; font-size: .93rem; }
.lp-step-num {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--primary), var(--lp-accent)); color: #fff; font-weight: 800;
}
.lp-feature { transition: transform .15s ease, border-color .15s ease; }
.lp-feature:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.lp-feature + .lp-feature { margin-top: 0; }
.lp-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.lp-icon svg { width: 22px; height: 22px; }

/* Developers */
.lp-dev { display: grid; grid-template-columns: .9fr 1.1fr; gap: 36px; align-items: center; }
.lp-dev .lp-h2 { text-align: start; }
.lp-dev .lp-lead { margin-bottom: 20px; }
.lp-code { margin: 0; background: #0f1320; color: #d7dcef; border-color: #232a3d; border-radius: 14px; padding: 20px; font-size: 13px; line-height: 1.7; }
.lp-c-key { color: #7aa2ff; font-weight: 700; }
.lp-c-str { color: #9ad8c8; }
.lp-c-val { color: #f4c07a; }
.lp-c-dim { color: #6b7390; }

/* Final call to action */
.lp-final {
  margin: 64px 0 10px; padding: 44px 24px; text-align: center; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, var(--primary), #00a88f);
}
.lp-final h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); }
.lp-final p { opacity: .9; margin: 0 auto 22px; max-width: 520px; }
.lp-btn-light { background: #fff; color: #1b2240; }

@media (max-width: 860px) {
  .lp-hero, .lp-dev { grid-template-columns: 1fr; }
  .lp-hero { padding-top: 32px; gap: 56px; text-align: center; }
  .lp-hero .lp-lead { margin-inline: auto; }
  .lp-cta { justify-content: center; }
  .lp-demo-toast { inset-inline-end: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-pulse, .lp-demo-toast { animation: none; }
}

/* Narrow phones: keep the header on one row */
@media (max-width: 420px) {
  .topbar .inner { gap: 10px; }
  .brand-name { display: none; }
  .lang-select { padding: 5px 6px; }
}
