/* Local fonts — no external requests */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500 600 700 800 900; font-display: swap; src: url('/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500 600 700; font-display: swap; src: url('/fonts/jbmono-400.woff2') format('woff2'); }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  color-scheme: dark;
  --bg: #08080a;
  --bg-card: #0e0e12;
  --bg-card-hover: #141419;
  --border: #1a1a22;
  --border-glow: #6c3bff;
  --purple: #8b5cf6;
  --purple-light: #a78bfa;
  --purple-dim: rgba(139, 92, 246, 0.08);
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.08);
  --cyan: #06b6d4;
  --red: #ef4444;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --text-dim: #3f3f46;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* Store Banner */
#store-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 101;
  background: #e67e22;
  color: #fff;
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}
.has-banner nav { top: calc(0.45rem * 2 + 0.82rem * 1.4); }
.has-banner .page-container { padding-top: calc(6rem + 0.45rem * 2 + 0.82rem * 1.4); }

/* Nav */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8,8,10,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: #000; font-weight: 800;
}

.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a, .nav-link-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
  background: none; border: none; cursor: pointer;
  font-family: inherit;
}
.nav-links a:hover, .nav-link-btn:hover { color: var(--text); }

.btn-nav {
  background: var(--purple);
  color: #fff !important;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-nav:hover { background: #7c3aed; transform: translateY(-1px); }

.lang-picker { position: relative; }
.lang-btn {
  background: none; border: none; cursor: pointer;
  font-size: 28px; line-height: 1; padding: 0.25rem;
  border-radius: 6px; transition: background 0.2s;
  display: inline-block;
}
.lang-btn:hover { background: rgba(255,255,255,0.06); }
.lang-dropdown {
  display: none;
  position: absolute; top: 100%; right: 0; margin-top: 0.5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.4rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
  flex-direction: column; gap: 0.1rem;
  min-width: 48px;
}
/* Radio card selection (topup crypto) */
input[type="radio"]:checked + div, input[type="radio"]:checked ~ div {
  filter: none;
}
label:has(input[type="radio"]:checked) {
  border-color: var(--purple) !important;
  background: rgba(139,92,246,0.06);
}

.lang-check { display: none; }
.lang-check:checked ~ .lang-dropdown,
.lang-picker.open .lang-dropdown { display: flex; }
.lang-option {
  background: none; border: none; cursor: pointer;
  font-size: 28px; padding: 0.4rem 0.5rem; border-radius: 6px;
  line-height: 1; transition: background 0.15s;
  text-decoration: none; display: block;
}
.lang-option:hover { background: rgba(255,255,255,0.08); }
.lang-option.active { background: var(--purple-dim); }

/* Buttons */
.btn-primary {
  background: var(--purple);
  color: #fff;
  border: none;
  padding: 0.85rem 2rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}
.btn-primary:hover { background: #7c3aed; transform: translateY(-2px); box-shadow: 0 8px 30px rgba(139,92,246,0.3); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.85rem 2rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}
.btn-outline:hover { border-color: var(--text-dim); background: rgba(255,255,255,0.02); }

.btn-sm {
  padding: 0.5rem 1.2rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

.btn-red { background: var(--red); }
.btn-red:hover { background: #dc2626; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.8rem;
  transition: all 0.3s;
}

.card:hover { border-color: rgba(139,92,246,0.15); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
  outline: none;
}
.form-control:focus { border-color: var(--purple); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control option {
  background: var(--bg-card);
  color: var(--text);
}

/* Auth form container */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.auth-card .sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.auth-card .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

.auth-card .alt {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-card .alt a {
  color: var(--purple-light);
  text-decoration: none;
}
.auth-card .alt a:hover { text-decoration: underline; }

.error-msg {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #fca5a5;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

/* Dashboard */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
}

.stat-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.4rem;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-purple .value { color: var(--purple-light); }
.stat-green .value { color: var(--green); }
.stat-cyan .value { color: var(--cyan); }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-muted);
}

.data-table tr:hover td { color: var(--text); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}

.badge-admin { background: var(--purple-dim); color: var(--purple-light); }
.badge-user { background: rgba(255,255,255,0.04); color: var(--text-muted); }

/* Glow */
.glow-top {
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(139,92,246,0.08) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse-icon { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.8; } }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 768px) {
  .nav-links { gap: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-container { padding: 5rem 1rem 3rem; }
  .has-banner .page-container { padding-top: calc(5rem + 0.45rem * 2 + 0.82rem * 1.4); }
}
