/* MR VPN — Bale Mini App — «Noir & Champagne» (mirrors the Telegram mini app) */
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.woff2) format('woff2'); font-weight: 400; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Medium.woff2) format('woff2'); font-weight: 500; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.woff2) format('woff2'); font-weight: 700; }

:root, [data-theme="dark"] {
  --bg: #0a0a0b; --card: #17171a; --card2: #1f1f23; --text: #f5f3ec;
  --muted: #9a97a3; --gold: #D8B45A; --gold-text: #171204;
  --border: #2a2a2f; --danger: #e5484d; --ok: #3fb68b;
  --sheet: #141416;
}
[data-theme="light"] {
  --bg: #f4f2ec; --card: #ffffff; --card2: #f0ede4; --text: #17171a;
  --muted: #6f6c66; --gold: #b8912f; --gold-text: #ffffff;
  --border: #e2ded2; --danger: #c62f35; --ok: #1e8a63;
  --sheet: #ffffff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Vazirmatn, system-ui, sans-serif; background: var(--bg);
  color: var(--text); font-size: 15px; line-height: 1.7;
  padding-bottom: 92px; user-select: none; -webkit-user-select: none;
}
input, textarea { user-select: text; -webkit-user-select: text; }
button { font-family: inherit; cursor: pointer; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .center { text-align: center; }
.pad { padding: 14px; }

/* Gate */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 28px 22px; text-align: center; max-width: 340px; }
.gate-logo { width: 92px; height: auto; display: block; margin: 0 auto 10px; }
.gate-card h2 { margin: 6px 0; font-size: 19px; }
.gate-card p { color: var(--muted); font-size: 14px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); padding: 10px 14px 6px; }
.toprow { display: flex; align-items: center; justify-content: space-between; }
.userpill { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px 5px 6px; color: var(--text); }
.av { width: 30px; height: 30px; border-radius: 50%; background: var(--card2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; }
.av.big { width: 52px; height: 52px; font-size: 20px; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.nm { font-weight: 500; font-size: 14px; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.iconbtn .i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
[data-theme="dark"] .ic-sun { display: none; } [data-theme="light"] .ic-moon { display: none; }

/* Screens */
.scr { display: none; padding: 8px 14px 0; animation: fade .22s ease; }
.scr.on { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.stitle { margin: 10px 2px 12px; font-size: 17px; }

/* Cards & wallet */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; margin-bottom: 12px; }
.walcard { background: linear-gradient(160deg, var(--card2), var(--card)); border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.wt { color: var(--muted); font-size: 13px; }
.big { font-size: 30px; margin: 4px 0 12px; } .big small { font-size: 14px; color: var(--muted); }
.rowbetween { display: flex; align-items: center; justify-content: space-between; }
.linkbtn { background: none; border: none; color: var(--gold); font-size: 13.5px; }

/* Buttons */
.btn { border: 1px solid var(--border); background: var(--card2); color: var(--text); border-radius: 14px; padding: 12px 16px; font-size: 15px; font-weight: 500; }
.btn.gold { background: var(--gold); color: var(--gold-text); border-color: var(--gold); font-weight: 700; }
.btn.danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.wide { width: 100%; display: block; }
.btn.outline { background: var(--card); }
.btn:disabled { opacity: .55; }
.btn + .btn { margin-top: 8px; }

/* Banner */
.banner { width: 100%; display: flex; align-items: center; gap: 10px; text-align: right; border-radius: 18px; padding: 14px; margin-bottom: 12px; color: var(--text); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border)); background: linear-gradient(120deg, color-mix(in srgb, var(--gold) 16%, var(--card)), var(--card)); }
.bicon { font-size: 24px; } .btext { flex: 1; display: flex; flex-direction: column; } .btext small { color: var(--muted); }
.bchev { color: var(--muted); font-size: 20px; }

/* Lists */
.mini-list .row, .svc-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); }
.mini-list .row:last-child, .svc-row:last-child { border-bottom: none; }
.svc-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 14px; margin-bottom: 12px; text-align: right; width: 100%; color: var(--text); }
.svc-card .nm { font-weight: 700; font-size: 15.5px; }
.pill { font-size: 11.5px; border-radius: 999px; padding: 2px 9px; background: var(--card2); border: 1px solid var(--border); color: var(--muted); }
.pill.test { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.pill.ok { color: var(--ok); } .pill.bad { color: var(--danger); }
.plan-row { display: flex; align-items: center; justify-content: space-between; width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; color: var(--text); text-align: right; }
.plan-row.sel { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, var(--card)); }
.price { color: var(--gold); font-weight: 700; }
.bar { height: 8px; background: var(--card2); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar > div { height: 100%; background: var(--gold); border-radius: 99px; }

/* Forms */
.fld { display: block; margin: 12px 0; }
.fld span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.fld input { width: 100%; background: var(--card2); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; color: var(--text); font-family: inherit; font-size: 15px; }
.cardinfo { background: var(--card2); border: 1px dashed color-mix(in srgb, var(--gold) 45%, var(--border)); border-radius: 14px; padding: 12px; margin: 10px 0; direction: rtl; }
.cardinfo .num { direction: ltr; font-size: 18px; letter-spacing: 1px; font-weight: 700; color: var(--text); text-align: center; }

/* Menu (more) */
.profile { display: flex; align-items: center; gap: 12px; }
.menu-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.menu-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; color: var(--text); font-size: 15px; text-align: right; }
.menu-item .bchev { margin-right: auto; }

/* Tab bar */
.tabbar { position: fixed; bottom: 0; right: 0; left: 0; z-index: 30; display: flex; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); }
.tab { flex: 1; background: none; border: none; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; }
.tab .tic { font-size: 19px; }
.tab.on { color: var(--gold); font-weight: 700; }

/* Sheet */
.dim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
.sheet { position: fixed; right: 0; left: 0; bottom: 0; z-index: 41; background: var(--sheet); border-top: 1px solid var(--border); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; animation: up .25s ease; }
@keyframes up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet h3 { margin: 0 0 10px; }
.qr { display: block; margin: 10px auto; width: 190px; height: 190px; border-radius: 14px; background: #fff; padding: 6px; }
.linkbox { direction: ltr; word-break: break-all; background: var(--card2); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border)); color: var(--gold); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; text-align: left; margin: 8px 0; }

/* Toast */
.toast { position: fixed; bottom: 104px; right: 50%; transform: translateX(50%); z-index: 60; background: var(--card2); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; font-size: 14px; max-width: 88vw; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
