/* ──────────────────────────────────────────────────────────────────
   MobeAuth Partner Portal — design system
   Style direction: modern dark SaaS dashboard (Linear/Vercel/Stripe
   energy).  Single accent (gold) reserved for primary affordances and
   brand marks.  Status colours kept restrained.
   ────────────────────────────────────────────────────────────────── */

/* ── Font ── */
@import url('https://rsms.me/inter/inter.css');

/* ── Tokens ── */
:root {
  /* Backgrounds — layered depth */
  --bg-app:       #0a0d12;
  --bg-surface:   #11151c;
  --bg-elevated:  #161b24;
  --bg-input:     #0d1117;

  /* Borders */
  --border:       rgba(255, 255, 255, 0.06);
  --border-hi:    rgba(255, 255, 255, 0.10);
  --border-focus: rgba(212, 160, 23, 0.65);

  /* Text */
  --t-primary:    #e8edf8;
  --t-secondary:  #98a0b3;
  --t-muted:      #5d6477;
  --t-disabled:   #3c4151;

  /* Brand + status */
  --brand:        #d4a017;
  --brand-hi:     #f2c94c;
  --brand-soft:   rgba(212, 160, 23, 0.10);
  --ok:           #22c55e;
  --ok-soft:      rgba(34, 197, 94, 0.10);
  --warn:         #f59e0b;
  --warn-soft:    rgba(245, 158, 11, 0.10);
  --err:          #ef4444;
  --err-soft:     rgba(239, 68, 68, 0.10);
  --info:         #6366f1;
  --info-soft:    rgba(99, 102, 241, 0.10);

  /* Spacing scale (4px base) */
  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px; --s-6: 24px;  --s-7: 32px;  --s-8: 40px;
  --s-9: 48px; --s-10: 64px;

  /* Radius */
  --r-sm: 6px;  --r-md: 8px;  --r-lg: 12px;  --r-xl: 16px;  --r-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.30);
  --shadow:    0 6px 24px rgba(0,0,0,0.32), 0 1px 2px rgba(0,0,0,0.40);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.45);

  /* Motion */
  --t-fast: 120ms cubic-bezier(.4,0,.2,1);
  --t-med:  200ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-app);
  color: var(--t-primary);
  font-family: 'Inter', 'Segoe UI Variable', 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.55;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@supports (font-variation-settings: normal) {
  body { font-family: 'InterVariable', 'Segoe UI Variable', 'Segoe UI', sans-serif; }
}
a { color: var(--t-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-hi); }

/* ── App shell ── */
.app { display: grid; grid-template-rows: 60px 1fr; min-height: 100vh; }

/* ── Topbar ── */
header.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 13, 18, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--s-7);
  padding: 0 var(--s-7);
}
.topbar .brand {
  display: flex; align-items: center; gap: var(--s-3);
  font-weight: 650; font-size: 15px; letter-spacing: -0.01em;
}
.topbar .brand .mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hi) 100%);
  color: #1a1207; font-weight: 800; font-size: 13px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}
.topbar .brand .accent { color: var(--t-secondary); font-weight: 500; }

.topbar nav { display: flex; gap: var(--s-1); flex: 1; }
.topbar nav a {
  color: var(--t-secondary);
  padding: 7px 12px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 500;
  transition: all var(--t-fast);
}
.topbar nav a:hover { color: var(--t-primary); background: rgba(255,255,255,0.04); }
.topbar nav a.active {
  color: var(--brand-hi);
  background: var(--brand-soft);
}

.topbar .right { display: flex; align-items: center; gap: var(--s-3); }
.topbar .balance {
  display: inline-flex; align-items: center; gap: var(--s-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border-hi);
  color: var(--t-primary);
  padding: 5px 12px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.topbar .balance .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand-hi);
}
.topbar .user {
  display: flex; align-items: center; gap: 10px; padding-left: var(--s-3);
  border-left: 1px solid var(--border);
}
.topbar .avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hi) 100%);
  color: #1a1207; font-weight: 700; font-size: 13px;
  border-radius: 50%;
}
.topbar .user .who { line-height: 1.2; }
.topbar .user .who b { font-size: 13px; font-weight: 600; display: block; }
.topbar .user .who span { font-size: 11px; color: var(--t-muted); }
.topbar .logout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  color: var(--t-muted); border-radius: var(--r-md);
  transition: all var(--t-fast);
}
.topbar .logout:hover { color: var(--t-primary); background: rgba(255,255,255,0.05); }
.topbar .logout svg { width: 16px; height: 16px; }

/* ── Page wrapper ── */
main {
  padding: var(--s-7) var(--s-7);
  max-width: 1200px; margin: 0 auto; width: 100%;
}
.page-head {
  margin-bottom: var(--s-7);
}
.page-head h1 {
  margin: 0 0 6px;
  font-size: 24px; font-weight: 650; letter-spacing: -0.025em;
  color: var(--t-primary);
}
.page-head p { margin: 0; color: var(--t-secondary); font-size: 14px; }

/* ── Sections / cards ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  margin-bottom: var(--s-5);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s-5);
}
.card-head h2 {
  margin: 0; font-size: 14px; font-weight: 600;
  color: var(--t-primary); letter-spacing: -0.01em;
}
.card-head .sub { font-size: 12.5px; color: var(--t-muted); }

/* ── Stat tiles ── */
.stats {
  display: grid; gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: var(--s-5);
}
.stat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  transition: border-color var(--t-fast);
}
.stat:hover { border-color: var(--border-hi); }
.stat .label {
  color: var(--t-muted);
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
}
.stat .label svg { width: 13px; height: 13px; opacity: 0.6; }
.stat .value {
  margin-top: 10px;
  font-size: 26px; font-weight: 650; letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--t-primary);
}
.stat .value.gold { color: var(--brand-hi); }
.stat .value.ok   { color: var(--ok); }
.stat .sub { margin-top: 4px; font-size: 12px; color: var(--t-muted); }

/* ── Tables ── */
.tbl-wrap { background: var(--bg-surface); border: 1px solid var(--border);
            border-radius: var(--r-lg); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  text-align: left; padding: 12px var(--s-5);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-muted);
  background: rgba(255,255,255,0.015);
  border-bottom: 1px solid var(--border);
}
.tbl tbody td {
  padding: 14px var(--s-5);
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  color: var(--t-primary);
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover { background: rgba(255,255,255,0.02); }
.tbl td.mono {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 12.5px;
}
.tbl td.num { font-variant-numeric: tabular-nums; }
.tbl-empty {
  padding: var(--s-9); text-align: center;
  color: var(--t-muted); font-size: 13.5px;
}

/* ── Forms ── */
.field { margin-bottom: var(--s-5); }
.field label {
  display: block;
  font-size: 12.5px; font-weight: 500;
  color: var(--t-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.005em;
}
.field .hint { display: block; font-size: 11.5px; color: var(--t-muted); margin-top: 6px; }

input[type=text],
input[type=email],
input[type=password],
input[type=tel],
input[type=url],
input[type=number],
input[type=search],
select, textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--t-primary);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-family: inherit; font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none; appearance: none;
}
input:hover, select:hover, textarea:hover { border-color: rgba(255,255,255,0.18); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.10);
}
input::placeholder, textarea::placeholder { color: var(--t-muted); opacity: 1; }
input[type=email]:invalid:not(:placeholder-shown) {
  border-color: rgba(239, 68, 68, 0.50);
}
/* Chrome autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
  -webkit-text-fill-color: var(--t-primary) !important;
  caret-color: var(--t-primary);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--t-fast);
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; }
.btn:disabled, .btn.is-disabled {
  background: var(--bg-elevated); color: var(--t-disabled);
  cursor: not-allowed; border-color: var(--border);
}

.btn-primary {
  background: var(--brand); color: #1a1207;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--brand-hi); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-default {
  background: var(--bg-elevated); color: var(--t-primary);
  border-color: var(--border-hi);
}
.btn-default:hover { background: #1d2330; border-color: rgba(255,255,255,0.18); }

.btn-ghost {
  background: transparent; color: var(--t-secondary);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--t-primary); background: rgba(255,255,255,0.04); }

.btn-danger {
  background: var(--err-soft); color: var(--err);
  border-color: rgba(239,68,68,0.30);
}
.btn-danger:hover { background: rgba(239,68,68,0.18); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 22px; font-size: 14.5px; }
.btn-block { display: flex; width: 100%; }

/* ── Pills / badges ── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
}
.pill.ok    { background: var(--ok-soft);   color: var(--ok); }
.pill.warn  { background: var(--warn-soft); color: var(--warn); }
.pill.err   { background: var(--err-soft);  color: var(--err); }
.pill.info  { background: var(--info-soft); color: var(--info); }
.pill.muted { background: rgba(255,255,255,0.05); color: var(--t-muted); }
.pill.gold  { background: var(--brand-soft); color: var(--brand-hi); }
.pill .led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Service tags (FRP, UBL, etc) */
.svc {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  font-family: 'JetBrains Mono','SF Mono',monospace;
}
.svc.FRP      { background: rgba(99,102,241,0.12);  color: #a5b4fc; }
.svc.QC       { background: rgba(34,197,94,0.12);   color: #86efac; }
.svc.UBL      { background: rgba(56,189,248,0.12);  color: #7dd3fc; }
.svc.FDL      { background: rgba(245,158,11,0.12);  color: #fcd34d; }
.svc.MTK      { background: rgba(239,68,68,0.12);   color: #fca5a5; }
.svc.MTK6NEW  { background: rgba(249,115,22,0.12);  color: #fdba74; }
.svc.MTK6NEW2 { background: rgba(168,85,247,0.12);  color: #d8b4fe; }

/* ── Banners / alerts ── */
.alert {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 12px var(--s-4);
  border-radius: var(--r-md);
  font-size: 13.5px;
  margin-bottom: var(--s-5);
  border: 1px solid;
}
.alert .icon {
  flex: 0 0 18px; display: grid; place-items: center;
}
.alert .icon svg { width: 18px; height: 18px; }
.alert.ok   { background: var(--ok-soft);   color: #6ee7b7; border-color: rgba(34,197,94,0.30); }
.alert.warn { background: var(--warn-soft); color: #fcd34d; border-color: rgba(245,158,11,0.30); }
.alert.err  { background: var(--err-soft);  color: #fca5a5; border-color: rgba(239,68,68,0.30); }
.alert.info { background: var(--info-soft); color: #a5b4fc; border-color: rgba(99,102,241,0.30); }
.alert .body { flex: 1; }
.alert b { color: inherit; font-weight: 600; }

/* ── Service-card grid (keygen) ── */
.svc-grid {
  display: grid; gap: var(--s-3);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.svc-card {
  position: relative; display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  cursor: pointer;
  transition: all var(--t-fast);
}
.svc-card:hover {
  border-color: rgba(255,255,255,0.20);
  transform: translateY(-1px);
}
.svc-card input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.svc-card.is-checked {
  border-color: var(--brand);
  background: linear-gradient(180deg, rgba(212,160,23,0.06) 0%, var(--bg-elevated) 100%);
  box-shadow: 0 0 0 3px rgba(212,160,23,0.08);
}
.svc-card.is-disabled { opacity: 0.55; cursor: not-allowed; }
.svc-card .row { display: flex; align-items: center; justify-content: space-between; }
.svc-card .name { font-weight: 600; font-size: 14px; color: var(--t-primary); }
.svc-card .desc { color: var(--t-muted); font-size: 12px; margin-top: 4px; }
.svc-card .price {
  margin-top: var(--s-3);
  font-size: 22px; font-weight: 650; letter-spacing: -0.02em;
  color: var(--brand-hi);
  font-variant-numeric: tabular-nums;
}
.svc-card .price .unit { font-size: 11.5px; color: var(--t-muted); font-weight: 500; margin-left: 4px; }
.svc-card .check {
  position: absolute; top: 12px; right: 12px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand); color: #1a1207;
  opacity: 0; transform: scale(.6);
  transition: all var(--t-fast);
}
.svc-card.is-checked .check { opacity: 1; transform: scale(1); }

/* ── Code / output ── */
.code, .keyout {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: 'JetBrains Mono','SF Mono',Consolas,monospace;
  font-size: 12.5px;
  color: var(--t-primary);
  overflow-wrap: anywhere;
}
.copy {
  border: 1px solid var(--border-hi);
  background: transparent;
  color: var(--t-secondary);
  padding: 5px 10px; border-radius: var(--r-sm);
  font-size: 11.5px; font-weight: 500;
  cursor: pointer; transition: all var(--t-fast);
}
.copy:hover { color: var(--t-primary); border-color: rgba(255,255,255,0.20); }
.copy.is-copied { color: var(--ok); border-color: rgba(34,197,94,0.30); }

/* ── Filter chips ── */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: transparent; color: var(--t-secondary);
  border: 1px solid var(--border-hi);
  font-size: 12.5px; font-weight: 500;
  transition: all var(--t-fast); cursor: pointer;
}
.chip:hover { color: var(--t-primary); border-color: rgba(255,255,255,0.20); }
.chip.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-hi);
}
.chip .count { color: var(--t-muted); font-size: 11.5px; }
.chip.is-active .count { color: var(--brand); }

/* ── Login surface ── */
.login-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  background:
    radial-gradient(900px circle at 20% 10%, rgba(99,102,241,0.10), transparent 55%),
    radial-gradient(900px circle at 85% 95%, rgba(212,160,23,0.10), transparent 55%),
    var(--bg-app);
  padding: var(--s-7);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-7);
  box-shadow: var(--shadow);
}
.login-brand {
  display: flex; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.login-brand .mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hi) 100%);
  border-radius: var(--r-md);
  font-weight: 800; color: #1a1207;
  box-shadow: var(--shadow-sm);
}
.login-card h1 {
  margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.02em;
}
.login-card .sub {
  color: var(--t-secondary); margin: 6px 0 var(--s-6); font-size: 13.5px;
}
.login-tabs {
  display: flex; gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px; margin-bottom: var(--s-5);
}
.login-tabs button {
  flex: 1; background: transparent; border: none;
  color: var(--t-secondary);
  padding: 8px;
  border-radius: var(--r-sm);
  font: 600 12.5px 'Inter', sans-serif;
  cursor: pointer; transition: all var(--t-fast);
}
.login-tabs button.is-on {
  background: var(--bg-surface);
  color: var(--brand-hi);
  box-shadow: var(--shadow-sm);
}
.pane { display: none; }
.pane.is-on { display: block; }

/* ── Identity card (account page) ── */
.identity {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: var(--s-4);
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5) var(--s-6);
  margin-bottom: var(--s-5);
}
.identity .av {
  width: 60px; height: 60px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hi) 100%);
  color: #1a1207; font-weight: 700; font-size: 24px;
  border-radius: 50%; box-shadow: var(--shadow-sm);
}
.identity .name { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.identity .meta {
  margin-top: 3px;
  display: flex; align-items: center; gap: 6px;
  color: var(--t-secondary); font-size: 13px;
  flex-wrap: wrap;
}
.identity .meta .sep { color: var(--t-muted); }
.identity .meta .tier { color: var(--brand-hi); font-weight: 600; }
.identity .balance-card {
  text-align: right;
}
.identity .balance-card .v {
  font-size: 22px; font-weight: 650; letter-spacing: -0.02em;
  color: var(--brand-hi);
  font-variant-numeric: tabular-nums;
}
.identity .balance-card .l {
  font-size: 11px; color: var(--t-muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-top: 2px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.06);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

/* ── Responsive ── */
@media (max-width: 720px) {
  main { padding: var(--s-5); }
  header.topbar { padding: 0 var(--s-4); gap: var(--s-4); }
  .topbar nav { display: none; }
  .identity { grid-template-columns: 60px 1fr; }
  .identity .balance-card {
    grid-column: 1 / -1; text-align: left; padding-top: var(--s-3);
    border-top: 1px solid var(--border);
  }
}
