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

:root {
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --purple-dark: #5b21b6;
  --surface: rgba(15, 12, 28, 0.75);
  --border: rgba(255,255,255,0.08);
  --text: #f1f0f5;
  --muted: #9490b0;
  --success: #22c55e;
  --error: #f87171;
}

body {
  font-family: 'Inter', sans-serif;
  background: #06040f;
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

/* ── Animated background canvas ── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── Glowing orbs ── */
.orbs {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.orb { display: none; }

/* ── Centered layout ── */
.page-center {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* ── Auth card ── */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(8, 5, 20, 0.72);
  border: 1px solid rgba(140, 100, 255, 0.18);
  border-radius: 20px;
  padding: 36px 40px 40px;
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 24px 80px rgba(0,0,0,0.65),
    0 0 60px rgba(124,58,237,0.18),
    inset 0 1px 0 rgba(255,255,255,0.06);
  animation: card-float 6s ease-in-out infinite alternate;
}

@keyframes card-float {
  0%   { transform: translateY(0px); }
  100% { transform: translateY(-8px); }
}

/* ── Logo ── */
.card-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.3px;
  margin-bottom: 28px;
}

/* ── Tabs ── */
.tab-row {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
}

.tab-btn {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: 9px;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}

.tab-btn.active {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 2px 14px rgba(124,58,237,.5);
}

/* ── Forms ── */
.auth-form.hidden { display: none; }

.form-header { margin-bottom: 24px; }

.form-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
  margin-bottom: 5px;
}

.form-header p { font-size: 13px; color: var(--muted); }

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.field-group label {
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
}

.field-group input,
.input-wrap input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
}

.field-group input:focus,
.input-wrap input:focus {
  border-color: var(--purple);
  background: rgba(124,58,237,0.08);
  box-shadow: 0 0 0 3px rgba(124,58,237,.18);
}

.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }

.eye-btn {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; color: var(--muted);
  display: flex; align-items: center; padding: 0;
  transition: color .2s;
}
.eye-btn:hover { color: var(--text); }
.eye-icon { width: 17px; height: 17px; }

.field-error { font-size: 12px; color: var(--error); min-height: 15px; }

.strength-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 5px;
}
.strength-fill {
  height: 100%; width: 0; border-radius: 2px;
  transition: width .3s, background .3s;
}

.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  cursor: pointer; user-select: none;
}
.checkbox-label input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--purple); cursor: pointer;
}
.terms-label { margin-bottom: 4px; }

.form-row {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.link-text {
  font-size: 13px; color: var(--purple-light);
  text-decoration: none;
}
.link-text:hover { text-decoration: underline; }

.btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff; border: none;
  border-radius: 9px;
  font-size: 15px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  margin-top: 8px;
  transition: opacity .2s, transform .1s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(124,58,237,.4);
}
.btn-primary:hover {
  opacity: .9;
  box-shadow: 0 6px 24px rgba(124,58,237,.55);
}
.btn-primary:active { transform: scale(.98); }

.status-msg {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}
.status-msg.show { display: block; }
.status-msg.success { background: rgba(34,197,94,.1); color: var(--success); border: 1px solid rgba(34,197,94,.2); }
.status-msg.error   { background: rgba(248,113,113,.1); color: var(--error);  border: 1px solid rgba(248,113,113,.2); }

@media (max-width: 480px) {
  .auth-card { padding: 28px 22px 32px; border-radius: 16px; }
  body { overflow: auto; }
}

/* ── Mobile hamburger button ── */
.mob-ham {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 600;
}
.mob-ham span {
  display: block;
  width: 18px; height: 2px;
  background: #fff;
  border-radius: 2px;
  position: relative;
  transition: all .25s;
}
.mob-ham span::before,
.mob-ham span::after {
  content: '';
  position: absolute;
  left: 0; width: 18px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .25s;
}
.mob-ham span::before { top: -6px; }
.mob-ham span::after  { top:  6px; }

/* ── Mobile sidebar overlay ── */
.mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 599;
  backdrop-filter: blur(2px);
}
.mob-overlay.open { display: block; }

/* ── Mobile sidebar ── */
.mob-sidebar {
  position: fixed;
  top: 0; left: -280px;
  width: 260px; height: 100%;
  background: rgba(6,4,15,0.98);
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 600;
  transition: left .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}
.mob-sidebar.open { left: 0; }

.mob-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  font-weight: 700;
  font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  color: #fff;
}
.mob-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  gap: 4px;
  flex: 1;
}
.mob-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #9490b0;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.mob-sidebar-nav a:hover,
.mob-sidebar-nav a.active {
  background: rgba(124,58,237,0.18);
  color: #a78bfa;
}
.mob-sidebar-nav a.admin-link {
  color: #f59e0b;
  background: rgba(245,158,11,0.08);
}
.mob-sidebar-bottom {
  padding: 12px 10px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mob-balance {
  padding: 10px 14px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #a78bfa;
}
.mob-logout {
  width: 100%;
  padding: 11px;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 8px;
  color: #f87171;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
}

/* ── Apply on mobile only ── */
@media (max-width: 768px) {
  .mob-ham { display: flex; }
  .topbar nav,
  .topbar .topbar-right .user-name,
  .topbar .topbar-right .btn-logout { display: none !important; }
  .topbar { padding: 12px 16px !important; }
  .topbar-right { gap: 10px !important; }
}
