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

:root {
  --bg:     #080808;
  --c1:     #111;
  --c2:     #161616;
  --border: #1e1e1e;
  --b2:     #2a2a2a;
  --white:  #fff;
  --gray:   #888;
  --dim:    #555;
  --accent: #5865F2;
  --red:    #ef4444;
  --green:  #22c55e;
  --sb-w:   200px;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #222; border-radius: 2px; }

/* ══════════════════════════════════════════
   AUTH / LOGIN PAGE
══════════════════════════════════════════ */
body.auth-page { display: flex; align-items: stretch; min-height: 100vh; }

.auth-wrap { display: flex; width: 100%; min-height: 100vh; }

.auth-left {
  flex: 1; background: #050505;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 40px 48px;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 30px, rgba(255,255,255,.008) 30px, rgba(255,255,255,.008) 31px);
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 800; letter-spacing: 2px;
  color: var(--white);
}
.auth-logo svg { color: var(--gray); }
.auth-left-content { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.auth-left-content h1 {
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 900; line-height: 1.05; letter-spacing: -2px;
  margin-bottom: 20px;
}
.auth-left-content h1 .dim-text { color: var(--gray); }
.auth-left-content p { font-size: 14px; color: var(--gray); max-width: 380px; line-height: 1.8; }
.auth-left-footer { font-size: 12px; color: var(--dim); }

.auth-right {
  width: 480px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
}
.auth-card {
  width: 100%; max-width: 380px;
}
.auth-card-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.auth-card-sub { font-size: 13px; color: var(--gray); margin-bottom: 28px; line-height: 1.6; }

.auth-divider {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-divider span { font-size: 11px; color: var(--dim); white-space: nowrap; }

.field-group { margin-bottom: 18px; }
.field-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--gray); margin-bottom: 8px; }
.field-input {
  width: 100%; background: var(--c1); border: 1px solid var(--border);
  border-radius: 10px; color: var(--white);
  font-size: 14px; padding: 12px 14px; outline: none;
  transition: border-color .2s;
  font-family: 'Courier New', monospace; letter-spacing: 1px;
}
.field-input::placeholder { color: var(--dim); letter-spacing: 0; }
.field-input:focus { border-color: #444; }
.field-hint { font-size: 11px; color: var(--dim); margin-top: 6px; }

.form-error {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
  border-radius: 8px; padding: 10px 14px;
  font-size: 12px; color: #fca5a5; margin-bottom: 16px;
}
.form-error.hidden { display: none; }

.auth-btn {
  width: 100%; background: var(--white); color: #000;
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 700; padding: 13px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .2s; margin-bottom: 20px;
}
.auth-btn:hover { opacity: .88; }
.auth-btn:disabled { opacity: .5; cursor: not-allowed; }

.auth-foot {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  font-size: 12px; color: var(--dim);
}
.auth-foot a { color: var(--gray); transition: color .2s; }
.auth-foot a:hover { color: var(--white); }

/* Key result overlay */
.key-result {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.75); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.key-result.hidden { display: none; }
.kr-card {
  background: #0d0d0d; border: 1px solid var(--border);
  border-radius: 20px; padding: 40px 36px;
  text-align: center; max-width: 400px; width: 90%;
  position: relative;
}
.kr-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--gray);
  font-size: 15px; cursor: pointer;
}
.kr-close:hover { color: var(--white); }
.kr-status { font-size: 40px; margin-bottom: 14px; }
.kr-card h3 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.kr-sub { font-size: 13px; color: var(--gray); margin-bottom: 24px; }
.kr-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; text-align: left; }
.kr-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--c1); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
}
.kr-row-label { font-size: 11px; color: var(--gray); }
.kr-row-val { font-size: 13px; font-weight: 600; }
.kr-btn {
  display: block; background: var(--white); color: #000;
  border-radius: 50px; padding: 12px 32px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: opacity .2s;
}
.kr-btn:hover { opacity: .85; }

/* ══════════════════════════════════════════
   DASHBOARD LAYOUT (shared by all inner pages)
══════════════════════════════════════════ */
body.dash-page { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sb-w); flex-shrink: 0;
  background: #050505; border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-top {
  padding: 18px 16px 12px;
  display: flex; align-items: center; gap: 9px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 800; letter-spacing: 1.5px;
}
.sidebar-top svg { color: var(--gray); flex-shrink: 0; }
.sidebar-nav { flex: 1; padding: 16px 10px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--dim); padding: 10px 8px 6px; text-transform: uppercase;
}
.nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--gray); text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--c1); color: var(--white); }
.nav-link.active { background: var(--c2); color: var(--white); border-left: 2px solid var(--white); margin-left: -2px; }
.nav-link svg { flex-shrink: 0; }
.sidebar-user {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.sidebar-user-info {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #5865F2; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-tag  { font-size: 11px; color: var(--dim); }
.logout-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; background: none; border: 1px solid var(--border);
  border-radius: 8px; color: var(--gray); font-size: 12px;
  padding: 8px; cursor: pointer; transition: background .15s, color .15s;
}
.logout-btn:hover { background: var(--c1); color: var(--white); }

/* Main content */
.main-content {
  margin-left: var(--sb-w); flex: 1;
  min-height: 100vh; display: flex; flex-direction: column;
}
.page-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.page-title { font-size: 18px; font-weight: 700; }
.page-body { padding: 28px 32px; flex: 1; }

/* Right sidebar (quick actions) */
.dash-layout { display: flex; gap: 0; flex: 1; }
.dash-center { flex: 1; padding: 28px 32px; }
.dash-right {
  width: 260px; flex-shrink: 0; padding: 28px 20px;
  border-left: 1px solid var(--border);
}
.dash-right-title {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px; color: var(--dim);
  text-transform: uppercase; margin-bottom: 14px;
}
.qa-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 10px; margin-bottom: 4px;
  text-decoration: none; color: var(--white);
  transition: background .15s;
}
.qa-item:hover { background: var(--c1); }
.qa-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--c2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray); flex-shrink: 0;
}
.qa-text { flex: 1; }
.qa-title { font-size: 13px; font-weight: 600; }
.qa-sub   { font-size: 11px; color: var(--dim); }
.qa-arrow { color: var(--dim); font-size: 14px; }

/* Welcome card */
.welcome-card {
  background: var(--c1); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 24px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.welcome-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: #5865F2; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.welcome-text h3 { font-size: 15px; font-weight: 700; }
.welcome-text p  { font-size: 12px; color: var(--gray); }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 28px; }
.stat-card {
  background: var(--c1); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
}
.stat-icon { color: var(--dim); margin-bottom: 12px; }
.stat-val  { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-val.green { color: var(--green); }
.stat-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--dim); text-transform: uppercase; }

/* My Products empty state */
.empty-state {
  background: var(--c1); border: 1px solid var(--border);
  border-radius: 14px; padding: 60px 32px;
  text-align: center;
}
.empty-icon { color: var(--dim); margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.empty-state p  { font-size: 13px; color: var(--gray); margin-bottom: 24px; }
.empty-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--white); color: #000;
  border-radius: 8px; padding: 11px 22px;
  font-size: 13px; font-weight: 700; text-decoration: none;
}
.empty-btn:hover { opacity: .85; }

/* Product card (when user has products) */
.product-card {
  background: var(--c1); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 24px;
  display: flex; align-items: center; gap: 16px; margin-bottom: 12px;
}
.product-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg,#1a1a3e,#111);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.product-info { flex: 1; }
.product-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.product-meta { font-size: 12px; color: var(--gray); }
.product-status {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 6px;
}
.product-status.active { background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.25); }
.product-status.expired { background: rgba(239,68,68,.1); color: #fca5a5; border: 1px solid rgba(239,68,68,.2); }

/* Redeem page */
body.redeem-page {
  display: flex; min-height: 100vh; position: relative; overflow: hidden;
}
.redeem-bg {
  position: absolute; inset: 0; z-index: 0;
  background: #050505;
  background-image:
    radial-gradient(ellipse at 70% 50%, rgba(40,30,80,.4) 0%, transparent 60%),
    repeating-linear-gradient(45deg,transparent,transparent 32px,rgba(255,255,255,.008) 32px,rgba(255,255,255,.008) 33px);
}
.redeem-left {
  flex: 1; position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 80px;
}
.redeem-logo {
  position: absolute; top: 28px; left: 40px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 800; letter-spacing: 2px;
}
.redeem-logo svg { color: var(--gray); }
.redeem-left h1 {
  font-size: clamp(36px,4vw,56px); font-weight: 900;
  line-height: 1.05; letter-spacing: -2px; margin-bottom: 16px;
}
.redeem-left h1 span { color: var(--gray); }
.redeem-left p { font-size: 14px; color: var(--gray); max-width: 360px; line-height: 1.7; }
.redeem-right {
  width: 440px; flex-shrink: 0; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 32px;
}
.redeem-card {
  width: 100%; max-width: 360px;
  background: #0a0a0a; border: 1px solid var(--border);
  border-radius: 18px; padding: 28px;
}
.redeem-user-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.redeem-user { display: flex; align-items: center; gap: 10px; }
.redeem-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #5865F2; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.redeem-username { font-size: 13px; font-weight: 600; }
.redeem-usertag  { font-size: 11px; color: var(--dim); }
.redeem-logout {
  font-size: 11px; color: var(--gray); cursor: pointer;
  background: none; border: none; transition: color .2s;
}
.redeem-logout:hover { color: var(--white); }
.redeem-card h2 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.redeem-card > p { font-size: 12px; color: var(--gray); margin-bottom: 22px; line-height: 1.5; }
.redeem-foot {
  text-align: center; margin-top: 18px;
  font-size: 11px; color: var(--dim);
  display: flex; gap: 10px; justify-content: center;
}
.redeem-foot a { color: var(--gray); }
.redeem-foot a:hover { color: var(--white); }

/* Profile page */
.profile-card {
  background: var(--c1); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
  max-width: 560px;
}
.profile-top {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.profile-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: #5865F2; display: flex; align-items: center;
  justify-content: center; font-size: 22px; font-weight: 700;
  flex-shrink: 0;
}
.profile-name { font-size: 17px; font-weight: 700; }
.profile-bio  { font-size: 12px; color: var(--gray); }
.profile-field { margin-bottom: 20px; }
.profile-label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; color: var(--gray); margin-bottom: 8px;
}
.profile-hint { font-size: 11px; color: var(--dim); margin-top: 5px; }
.profile-textarea {
  width: 100%; background: var(--c2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--white);
  font-size: 13px; padding: 12px 14px; outline: none; resize: vertical;
  min-height: 80px; font-family: inherit; line-height: 1.5;
  transition: border-color .2s;
}
.profile-textarea:focus { border-color: #444; }
.save-btn {
  background: var(--white); color: #000;
  border: none; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 11px 24px;
  transition: opacity .2s;
}
.save-btn:hover { opacity: .85; }

/* Forum page */
.forum-empty {
  background: var(--c1); border: 1px solid var(--border);
  border-radius: 14px; padding: 60px 32px; text-align: center;
}
.forum-empty h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.forum-empty p  { font-size: 13px; color: var(--gray); }

/* Responsive */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .dash-right { display: none; }
  .auth-left { display: none; }
  .auth-right { width: 100%; }
  .redeem-left { display: none; }
  .redeem-right { width: 100%; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { margin-left: 0; }
  .sidebar { display: none; }
  .page-body, .dash-center { padding: 20px 16px; }
}
