/* MindraPay — Mindra visual identity: deep navy, glass surfaces, one accent. */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2-variations"), url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #070b1a;
  --bg-2: #0b1228;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e8edf8;
  --muted: #8f9bbd;
  --faint: #5f6b8c;
  --accent: #6c8cff;
  --accent-ink: #0a1030;
  --accent-soft: rgba(108, 140, 255, 0.14);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, 0.13);
  --warn: #f6c453;
  --warn-soft: rgba(246, 196, 83, 0.13);
  --bad: #ff7a7a;
  --bad-soft: rgba(255, 122, 122, 0.13);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(1000px 600px at 85% -10%, rgba(108, 140, 255, 0.18), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(61, 220, 151, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: left; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88em; direction: ltr; unicode-bidi: isolate; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-left: 1px solid var(--line);
  background: rgba(7, 11, 26, 0.6);
  backdrop-filter: blur(14px);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #9b7bff); color: #fff; font-size: .95rem; font-weight: 900;
  box-shadow: 0 8px 24px -8px rgba(108, 140, 255, .8);
}
.brand small { display: block; font-size: .7rem; color: var(--muted); font-weight: 500; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  color: var(--muted); padding: 9px 12px; border-radius: var(--radius-sm); font-weight: 500;
}
.nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--text); }
.nav-sep { margin: 14px 12px 4px; font-size: .72rem; color: var(--faint); letter-spacing: .02em; }
.side-foot { margin-top: auto; padding: 12px; font-size: .8rem; color: var(--faint); }

.main { padding: 28px 36px 60px; max-width: 1240px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { margin: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flat { box-shadow: none; }
.card.accent { border-color: rgba(108, 140, 255, .45); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }

.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; margin-top: 2px; }
.stat .sub { color: var(--faint); font-size: .8rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: .82rem; background: rgba(255,255,255,.02); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255,255,255,.025); }
td.wrap { white-space: normal; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.plain::before { display: none; }

/* ---------- forms ---------- */
label { display: block; font-size: .86rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 14px; }
.hint { font-size: .78rem; color: var(--faint); margin-top: 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .9rem; }
select option { background: var(--bg-2); }
.err { color: var(--bad); font-size: .8rem; margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #04261a; }
.btn.danger { color: var(--bad); border-color: rgba(255,122,122,.35); background: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 11px; font-size: .8rem; }
.btn.block { width: 100%; }
form.inline { display: inline; }

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: rgba(61,220,151,.3); color: var(--ok); }
.flash.bad { background: var(--bad-soft); border-color: rgba(255,122,122,.3); color: var(--bad); }
.flash.warn { background: var(--warn-soft); border-color: rgba(246,196,83,.3); color: var(--warn); }

.secret {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: rgba(0,0,0,.3); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.secret code { overflow-wrap: anywhere; }

pre {
  direction: ltr; text-align: left; background: rgba(0,0,0,.35); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; font-size: .82rem; line-height: 1.6; margin: 0 0 1em;
}
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
:not(pre) > code { background: rgba(255,255,255,.07); padding: 1px 6px; border-radius: 6px; font-size: .85em; direction: ltr; unicode-bidi: isolate; }

details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: 12px; }

/* ---------- empty / onboarding ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--text); }
.steps { counter-reset: s; display: grid; gap: 12px; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.step::before {
  counter-increment: s; content: counter(s, persian);
  flex: 0 0 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-weight: 800;
}
.step.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.step .body { flex: 1; }
.step h3 { margin-bottom: 2px; }

/* ---------- chart (dashboard bars) ---------- */
.bars { display: grid; grid-template-columns: repeat(14, 1fr); align-items: end; gap: 6px; height: 140px; padding-top: 10px; }
.bar { background: linear-gradient(180deg, var(--accent), rgba(108,140,255,.35)); border-radius: 6px 6px 2px 2px; min-height: 3px; position: relative; }
.bar:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); right: 50%; transform: translateX(50%);
  background: #000; color: #fff; padding: 3px 8px; border-radius: 6px; font-size: .72rem; white-space: nowrap; z-index: 2;
}
.bar-labels { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; font-size: .68rem; color: var(--faint); text-align: center; margin-top: 6px; }

/* ---------- pagination ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.pager .on { background: var(--accent-soft); color: var(--text); border-color: transparent; }

/* ---------- auth & public pages ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box .brand { justify-content: center; padding-bottom: 24px; }

/* ---------- hosted payment page ---------- */
.pay { width: 100%; max-width: 460px; }
.pay-card { padding: 0; overflow: hidden; }
.pay-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pay-merchant { font-weight: 700; }
.pay-body { padding: 22px; }
.amount-box { text-align: center; padding: 18px; border-radius: var(--radius); background: rgba(0,0,0,.28); border: 1px solid var(--line); margin-bottom: 16px; }
.amount-box .k { color: var(--muted); font-size: .85rem; }
.amount-box .v { font-size: 2.1rem; font-weight: 900; letter-spacing: -.01em; margin: 4px 0; }
.amount-box .rial { color: var(--faint); font-size: .8rem; }
.warn-line { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .86rem; margin-bottom: 16px; }
.copy-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 10px;
}
.copy-row .k { font-size: .78rem; color: var(--muted); }
.copy-row .v { font-size: 1.12rem; font-weight: 800; letter-spacing: .02em; }
.copy-btn { flex: 0 0 auto; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.state { text-align: center; padding: 26px 10px 8px; }
.state .icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; font-size: 1.8rem; }
.state.ok .icon { background: var(--ok-soft); color: var(--ok); }
.state.wait .icon { background: var(--accent-soft); color: var(--accent); }
.state.bad .icon { background: var(--bad-soft); color: var(--bad); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.pay-foot { text-align: center; font-size: .78rem; color: var(--faint); margin-top: 14px; }
.howto { font-size: .86rem; color: var(--muted); padding-right: 18px; margin: 0 0 14px; }
.howto li { margin-bottom: 4px; }

/* ---------- landing ---------- */
.hero { max-width: 980px; margin: 0 auto; padding: 70px 20px 40px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 900; letter-spacing: -.01em; }
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 640px; margin: 0 auto 26px; }
.feature-grid { max-width: 1040px; margin: 20px auto 60px; padding: 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.price-grid { max-width: 1040px; margin: 0 auto 60px; padding: 0 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.price .p { font-size: 1.5rem; font-weight: 900; }
.price ul { padding-right: 18px; color: var(--muted); font-size: .88rem; }
.site-nav { max-width: 1100px; margin: 0 auto; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; }

/* ---------- docs ---------- */
.doc { max-width: 860px; }
.doc h2 { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.doc table th, .doc table td { white-space: normal; }

/* ---------- responsive ---------- */
.menu-btn { display: none; }
@media (max-width: 980px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .feature-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 0 0 auto; width: 260px; transform: translateX(100%); transition: transform .2s; z-index: 50; background: var(--bg-2); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 18px 16px 50px; }
  .g2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .g4, .price-grid { grid-template-columns: 1fr; }
  .amount-box .v { font-size: 1.8rem; }
}
