:root {
  --bg: #05060d;
  --text: #eaf0ff;
  --muted: #93a0c8;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.14);
  --primary: #6d6bff;
  --primary-2: #a855f7;
  --cyan: #22d3ee;
  --success: #22c98a;
  --warning: #f7b733;
  --danger: #ff5a6e;
  --radius: 20px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --grad: linear-gradient(135deg, #6d6bff 0%, #a855f7 50%, #ec4899 100%);
  --grad-cyan: linear-gradient(135deg, #22d3ee 0%, #6d6bff 100%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.8rem; }

/* ---------------------------------------------------------------- Aurora bg */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 75% -10%, rgba(109, 107, 255, 0.18), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(34, 211, 238, 0.12), transparent 60%),
    var(--bg);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}
.orb-1 { width: 480px; height: 480px; background: #6d6bff; top: -120px; left: -80px; animation: float1 18s ease-in-out infinite; }
.orb-2 { width: 420px; height: 420px; background: #a855f7; top: 20%; right: -120px; animation: float2 22s ease-in-out infinite; }
.orb-3 { width: 360px; height: 360px; background: #22d3ee; bottom: -140px; left: 25%; animation: float3 20s ease-in-out infinite; }
.orb-4 { width: 300px; height: 300px; background: #ec4899; bottom: 10%; right: 20%; opacity: 0.35; animation: float1 26s ease-in-out infinite; }

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 80%);
}

@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,40px) scale(1.1); } }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,60px) scale(1.08); } }
@keyframes float3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,-50px) scale(1.12); } }

/* ----------------------------------------------------------------- Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 22, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 800; letter-spacing: 0.2px; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #fff; font-size: 0.9rem;
  box-shadow: 0 6px 20px rgba(109, 107, 255, 0.5);
  animation: spinPulse 6s ease-in-out infinite;
}
@keyframes spinPulse { 0%,100% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.08); } }
.brand-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.user-badge { display: flex; align-items: center; gap: 12px; }
.user-badge #badgeName { font-weight: 600; font-size: 0.92rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad-cyan); color: #06121f; font-weight: 800; font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.4);
}

.container { max-width: 1140px; margin: 0 auto; padding: 34px 22px 80px; }

/* -------------------------------------------------------------------- Cards */
.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.glass {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.glass:hover {
  transform: translateY(-4px);
  border-color: var(--line-2);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(109, 107, 255, 0.18);
}
.card h3 { margin: 0 0 4px; display: flex; align-items: center; gap: 9px; font-size: 1.05rem; }
.ico { font-size: 1.05rem; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4)); }

/* --------------------------------------------------------------------- Auth */
.auth-wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  min-height: 74vh;
}
.auth-hero { padding: 10px; }
.hero-pill {
  display: inline-block; padding: 7px 14px; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--line-2);
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.4px; color: #cdd6ff;
  margin-bottom: 22px;
}
.hero-title { font-size: 3.2rem; line-height: 1.05; margin: 0 0 18px; font-weight: 850; letter-spacing: -1px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--muted); font-size: 1.02rem; line-height: 1.6; max-width: 460px; margin: 0 0 26px; }
.hero-feats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.hero-feats li { display: flex; align-items: center; gap: 12px; font-size: 0.92rem; color: #d4dcff; }
.feat-ico {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--glass-strong); border: 1px solid var(--line); font-size: 1rem;
}

.auth-card { max-width: 440px; width: 100%; justify-self: end; }
.tabs {
  position: relative; display: flex; gap: 6px; margin-bottom: 22px;
  background: rgba(0, 0, 0, 0.25); padding: 6px; border-radius: 14px; border: 1px solid var(--line);
}
.tab {
  flex: 1; padding: 11px; border: none; border-radius: 10px; cursor: pointer; z-index: 1;
  background: transparent; color: var(--muted); font-weight: 700; font-size: 0.95rem;
  transition: color 0.2s ease;
}
.tab.active { color: #fff; }
.tabs:has(.tab[data-tab="login"].active) .tab-glow { left: 6px; }
.tabs:has(.tab[data-tab="register"].active) .tab-glow { left: 50%; }
.tab-glow {
  position: absolute; top: 6px; bottom: 6px; width: calc(50% - 6px);
  border-radius: 10px; background: var(--grad);
  box-shadow: 0 8px 24px rgba(109, 107, 255, 0.45);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 0;
}

/* -------------------------------------------------------------------- Forms */
.form { display: flex; flex-direction: column; gap: 15px; }
.form h2 { margin: 4px 0 8px; font-size: 1.35rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
input {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28); color: var(--text); font-size: 0.95rem; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input::placeholder { color: #5b6892; }
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(109, 107, 255, 0.18);
  background: rgba(0, 0, 0, 0.4);
}

/* ------------------------------------------------------------------ Buttons */
.btn {
  padding: 12px 18px; border: none; border-radius: 12px; cursor: pointer;
  font-weight: 800; font-size: 0.92rem; color: #fff; letter-spacing: 0.2px;
  transition: transform 0.08s ease, filter 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
  position: relative; overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--grad); }
.btn-success { background: linear-gradient(135deg, #16b97c, #1fd6a0); }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #f7b733); color: #1a1300; }
.btn-ghost { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; font-weight: 700; }
.btn-glow:hover { filter: brightness(1.08); box-shadow: 0 10px 30px rgba(109, 107, 255, 0.45); }
.btn-success.btn-glow:hover { box-shadow: 0 10px 30px rgba(31, 214, 160, 0.45); }
.btn-warning.btn-glow:hover { box-shadow: 0 10px 30px rgba(247, 183, 51, 0.45); }
/* Shimmer sweep */
.btn-glow::after {
  content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg); transition: left 0.6s ease;
}
.btn-glow:hover::after { left: 130%; }

/* ---------------------------------------------------------------- Dashboard */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }

/* Premium holographic wallet card */
.wallet-card {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(168, 85, 247, 0.55), transparent 55%),
    radial-gradient(120% 140% at 100% 0%, rgba(34, 211, 238, 0.45), transparent 55%),
    linear-gradient(135deg, #2a2360 0%, #1b1d4d 45%, #122036 100%);
  box-shadow: 0 30px 80px rgba(40, 30, 120, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 26px 28px;
}
.card-shine {
  position: absolute; top: -60%; left: -20%; width: 70%; height: 220%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.13), transparent);
  transform: skewX(-18deg); animation: shine 7s ease-in-out infinite;
}
@keyframes shine { 0%, 75% { left: -40%; } 100% { left: 130%; } }
.wallet-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.chip {
  width: 46px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, #f5d77a, #d9a441);
  position: relative; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.chip::before, .chip::after {
  content: ''; position: absolute; left: 8px; right: 8px; height: 1px; background: rgba(0,0,0,0.22);
}
.chip::before { top: 12px; } .chip::after { top: 21px; }
.wallet-label { display: block; margin-bottom: 4px; letter-spacing: 0.5px; text-transform: uppercase; font-size: 0.7rem; }
.balance {
  font-size: 3rem; font-weight: 850; margin: 2px 0 22px; letter-spacing: -1.5px;
  text-shadow: 0 4px 30px rgba(109, 107, 255, 0.4);
  font-variant-numeric: tabular-nums;
}
.wallet-meta { display: flex; gap: 34px; flex-wrap: wrap; }
.wallet-meta > div { display: flex; flex-direction: column; gap: 3px; }
.wallet-meta strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.wallet-brand {
  position: absolute; right: 26px; bottom: 22px; font-weight: 800; font-style: italic;
  font-size: 1.1rem; opacity: 0.85; letter-spacing: 0.3px;
  background: linear-gradient(135deg, #fff, #b9c4ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.pill { padding: 6px 13px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.3px; }
.pill-warn { background: rgba(247, 183, 51, 0.16); color: var(--warning); border: 1px solid rgba(247, 183, 51, 0.3); }
.pill-ok { background: rgba(34, 201, 138, 0.18); color: #4df0b0; border: 1px solid rgba(34, 201, 138, 0.35); }

.transactions-card { grid-column: 1 / -1; }
.tx-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.tx-list { display: flex; flex-direction: column; gap: 9px; max-height: 380px; overflow-y: auto; padding-right: 4px; }
.tx-list::-webkit-scrollbar { width: 8px; }
.tx-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
.tx {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(0, 0, 0, 0.25); transition: transform 0.18s ease, border-color 0.18s ease;
  animation: txIn 0.4s ease both;
}
.tx:hover { transform: translateX(4px); border-color: var(--line-2); }
@keyframes txIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.tx-left { display: flex; align-items: center; gap: 12px; }
.tx-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); flex-shrink: 0;
}
.tx-icon.credit { background: rgba(34, 201, 138, 0.14); border-color: rgba(34, 201, 138, 0.3); }
.tx-icon.debit { background: rgba(255, 90, 110, 0.12); border-color: rgba(255, 90, 110, 0.3); }
.tx-text { display: flex; flex-direction: column; gap: 2px; }
.tx-type { font-weight: 700; font-size: 0.9rem; }
.tx-desc { font-size: 0.76rem; color: var(--muted); }
.tx-amt { font-weight: 850; font-size: 1rem; font-variant-numeric: tabular-nums; }
.tx-amt.credit { color: #4df0b0; }
.tx-amt.debit { color: #ff8794; }

/* -------------------------------------------------------------------- Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(0);
  padding: 14px 22px; border-radius: 14px; font-weight: 700; font-size: 0.9rem;
  z-index: 60; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5); max-width: 90vw;
  backdrop-filter: blur(12px); border: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.35s cubic-bezier(0.2, 1.2, 0.3, 1) both;
}
.toast::before { font-size: 1.1rem; }
.toast.ok { background: rgba(20, 60, 45, 0.85); color: #b6ffe0; }
.toast.ok::before { content: '✅'; }
.toast.err { background: rgba(70, 22, 30, 0.85); color: #ffc9d0; }
.toast.err::before { content: '⚠️'; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* -------------------------------------------------------- Reveal animations */
.reveal { animation: revealUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.reveal-2 { animation-delay: 0.08s; }
.reveal-3 { animation-delay: 0.16s; }
.reveal-4 { animation-delay: 0.24s; }
@keyframes revealUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------- Responsive */
@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 24px; min-height: auto; padding-top: 10px; }
  .auth-hero { text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-feats { align-items: center; }
  .auth-card { justify-self: center; }
  .hero-title { font-size: 2.4rem; }
  .balance { font-size: 2.3rem; }
}
@media (max-width: 480px) {
  .container { padding: 22px 16px 60px; }
  .row-2 { grid-template-columns: 1fr; }
  .wallet-meta { gap: 20px; }
}
