@font-face { font-family: Vazirmatn; src: url('/static/fonts/vazirmatn.woff2') format('woff2'); font-weight: 400; }
@font-face { font-family: Vazirmatn; src: url('/static/fonts/vazirmatn-bold.woff2') format('woff2'); font-weight: 700; }

:root {
  --bg: #0b1220; --bg2: #111a2e; --card: #16213a; --card2: #1b2947;
  --text: #e8eefc; --dim: #8fa3c8; --acc: #4f8cff; --ok: #2dd4a7; --warn: #f5b84f;
  --line: #22304f;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: Vazirmatn, system-ui, sans-serif;
  background: radial-gradient(1200px 500px at 80% -10%, #16223f 0%, var(--bg) 55%);
  color: var(--text); direction: rtl;
  padding-bottom: 72px;
}
header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11,18,32,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
#topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
#brand { font-weight: 700; font-size: 17px; }
.chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; color: var(--ok);
}
main { max-width: 640px; margin: 0 auto; padding: 16px; }
.view.hidden, .hidden { display: none !important; }
h2 { font-size: 16px; margin: 4px 0 14px; color: var(--dim); font-weight: 400; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-pill {
  white-space: nowrap; background: var(--card); color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px;
  font-size: 13px; cursor: pointer; font-family: inherit;
  transition: all .2s;
}
.tab-pill.active { background: var(--acc); border-color: var(--acc); color: #fff; }

.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg2) 100%);
  border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.prod { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prod-info { display: flex; flex-direction: column; gap: 6px; }
.prod-name { font-weight: 700; font-size: 15px; }
.prod-meta { color: var(--dim); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.prod-price { font-weight: 700; color: var(--acc); font-size: 15px; white-space: nowrap; }
.btn {
  font-family: inherit; border: none; border-radius: 12px; cursor: pointer;
  padding: 10px 18px; font-size: 14px; transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--acc); color: #fff; font-weight: 700; }
.btn.ghost { background: transparent; color: var(--dim); border: 1px solid var(--line); }
.btn.ok { background: var(--ok); color: #06281f; font-weight: 700; }
.btn.big { width: 100%; padding: 14px; font-size: 15px; margin-top: 12px; }
.btn:disabled { opacity: .5; }

.wallet-card { text-align: center; padding: 26px 16px; }
.wallet-label { color: var(--dim); font-size: 13px; margin-bottom: 8px; }
.wallet-num { font-size: 26px; font-weight: 700; color: var(--ok); margin-bottom: 6px; }
.hint { color: var(--dim); font-size: 12px; line-height: 1.9; margin-top: 14px; }

.svc { display: flex; flex-direction: column; gap: 10px; }
.svc-top { display: flex; justify-content: space-between; align-items: center; }
.svc-name { font-weight: 700; }
.svc-days { font-size: 12px; color: var(--dim); }
.svc-days.warn { color: var(--warn); }
.link-row { display: flex; gap: 8px; }
.link-row .btn { flex: 1; text-align: center; font-size: 13px; padding: 9px; }

.tabbar {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 20;
  display: flex; background: rgba(11,18,32,.95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; background: none; border: none; color: var(--dim); font-family: inherit;
  padding: 12px 0 14px; font-size: 13px; cursor: pointer;
}
.tab.active { color: var(--acc); font-weight: 700; }

.modal {
  position: fixed; inset: 0; z-index: 50; display: flex;
  align-items: center; justify-content: center;
  background: rgba(4,8,16,.7); backdrop-filter: blur(4px);
}
.modal-box {
  width: calc(100% - 40px); max-width: 420px; max-height: 82vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
  animation: rise .25s ease both;
}
.modal-title { font-weight: 700; font-size: 16px; }
.modal-price { font-size: 22px; font-weight: 700; color: var(--acc); }
.modal-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); }
.card-num {
  background: var(--bg2); border: 1px dashed var(--acc); border-radius: 12px;
  padding: 12px; text-align: center; font-size: 16px; font-weight: 700;
  letter-spacing: 2px; direction: ltr; margin: 8px 0;
}
.spinner {
  width: 22px; height: 22px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--acc);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wait-box { text-align: center; padding: 20px 0; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.wait-text { color: var(--dim); font-size: 13px; line-height: 1.9; }

.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-size: 13px; z-index: 99;
  animation: rise .2s ease both; max-width: 90%;
}