/* ============================================================
   WALLET DESIGN SYSTEM — Dark Mode
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-root:      #0d1117;
  --bg-card:      #161b22;
  --bg-card2:     #1c2333;
  --bg-input:     #21262d;
  --bg-hover:     #1f2937;
  --border:       #30363d;
  --accent:       #3b82f6;
  --accent-2:     #8b5cf6;
  --accent-glow:  rgba(59,130,246,.25);
  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --text-primary: #e6edf3;
  --text-muted:   #7d8590;
  --text-dim:     #484f58;
  --sidebar-w:    260px;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-root);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #60a5fa; }
img { max-width: 100%; }

/* ============================================================
   SIDEBAR LAYOUT
   ============================================================ */
.wl-layout {
  display: flex;
  min-height: 100vh;
}

.wl-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s ease;
}

.wl-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.wl-sidebar-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
}

.wl-sidebar-logo-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: -.3px;
}

/* User widget in sidebar */
.wl-sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.wl-user-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff;
  flex-shrink: 0;
}

.wl-user-info {
  display: flex; align-items: center; gap: 10px;
}

.wl-user-name { font-weight: 600; font-size: 13px; color: var(--text-primary); line-height: 1.2; }
.wl-user-email { font-size: 11px; color: var(--text-muted); }

/* Balance widget */
.wl-sidebar-balance {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.wl-balance-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 4px;
}

.wl-balance-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.5px;
}

.wl-balance-amount span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

.wl-balance-btc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.wl-sidebar-actions {
  display: flex; gap: 8px; margin-top: 12px;
}

.wl-sidebar-actions a {
  flex: 1;
  display: block;
  text-align: center;
  padding: 7px 4px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}

.wl-btn-dep {
  background: var(--accent);
  color: #fff;
}
.wl-btn-dep:hover { background: #2563eb; color: #fff; }

.wl-btn-with {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.wl-btn-with:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Sidebar Navigation */
.wl-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.wl-nav-section-title {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-dim);
}

.wl-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  border-radius: 0;
  transition: background .15s, color .15s;
  cursor: pointer;
  position: relative;
}

.wl-nav-item:hover,
.wl-nav-item.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.wl-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.wl-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.wl-sidebar-bottom {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.wl-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.wl-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.wl-topbar-title { font-size: 16px; font-weight: 600; }

.wl-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wl-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

/* Page Content */
.wl-content {
  padding: 28px;
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.wl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.wl-card-sm { padding: 16px; }

.wl-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 12px;
}

/* ============================================================
   BALANCE HERO CARD
   ============================================================ */
.wl-hero {
  background: linear-gradient(135deg, #1a1f35 0%, #0f1729 60%, #0d1117 100%);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.wl-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(59,130,246,.15), transparent 70%);
  pointer-events: none;
}

.wl-hero-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
}

.wl-hero-balance {
  font-size: 38px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1;
}

.wl-hero-balance .currency-symbol {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-muted);
  margin-right: 4px;
  vertical-align: top;
  line-height: 1.5;
}

.wl-hero-btc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.wl-quick-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.wl-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  transition: background .15s, transform .15s;
  min-width: 76px;
  cursor: pointer;
}

.wl-action-btn:hover {
  background: rgba(59,130,246,.15);
  border-color: rgba(59,130,246,.4);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.wl-action-btn svg { width: 20px; height: 20px; color: var(--accent); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.wl-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.wl-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.wl-stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wl-stat-icon.blue  { background: rgba(59,130,246,.15); color: var(--accent); }
.wl-stat-icon.green { background: rgba(16,185,129,.15); color: var(--success); }
.wl-stat-icon.purple{ background: rgba(139,92,246,.15); color: var(--accent-2); }
.wl-stat-icon.amber { background: rgba(245,158,11,.15); color: var(--warning); }
.wl-stat-icon svg   { width: 20px; height: 20px; }

.wl-stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.wl-stat-value { font-size: 18px; font-weight: 700; color: var(--text-primary); letter-spacing: -.3px; }

/* ============================================================
   PORTFOLIO LIST
   ============================================================ */
.wl-portfolio-list {
  list-style: none;
}

.wl-portfolio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}

.wl-portfolio-item:last-child { border-bottom: none; }

.wl-portfolio-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wl-coin-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: contain;
  background: var(--bg-input);
  padding: 2px;
}

.wl-coin-name { font-weight: 600; font-size: 14px; }
.wl-coin-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.wl-portfolio-right { text-align: right; }
.wl-coin-usd  { font-weight: 600; font-size: 14px; }
.wl-coin-crypto { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ============================================================
   FORMS
   ============================================================ */
.wl-form-group { margin-bottom: 18px; }

.wl-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.wl-form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 11px 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.wl-form-control::placeholder { color: var(--text-dim); }

.wl-form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

select.wl-form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d8590' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.wl-form-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

.wl-input-group {
  display: flex;
  gap: 0;
}

.wl-input-group .wl-form-control {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  flex: 1;
}

.wl-input-group select.wl-form-control {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-left: none;
  width: 110px;
  flex: 0 0 110px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.wl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}

.wl-btn-primary {
  background: var(--accent);
  color: #fff;
}
.wl-btn-primary:hover { background: #2563eb; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,.4); }

.wl-btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.wl-btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }

.wl-btn-success {
  background: var(--success);
  color: #fff;
}
.wl-btn-success:hover { background: #059669; color: #fff; }

.wl-btn-block { width: 100%; }

.wl-btn-lg { padding: 13px 28px; font-size: 15px; }

/* ============================================================
   ALERTS / MESSAGES
   ============================================================ */
.wl-alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wl-alert-error   { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.wl-alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.wl-alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: #93c5fd; }

/* ============================================================
   PAYMENT METHOD LIST
   ============================================================ */
.wl-method-list { list-style: none; }

.wl-method-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: all .15s;
}

.wl-method-item:last-child { border-bottom: none; }

.wl-method-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wl-method-img {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--bg-input);
  padding: 4px;
}

.wl-method-name  { font-weight: 600; font-size: 14px; }
.wl-method-badge {
  display: inline-block;
  background: rgba(59,130,246,.15);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 3px;
}

.wl-method-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  transition: color .15s;
}

.wl-method-item:hover .wl-method-arrow { color: var(--accent); }

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */
.wl-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.wl-page-header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all .15s;
}
.wl-page-header-back:hover { color: var(--text-primary); background: var(--bg-hover); }

.wl-page-title  { font-size: 18px; font-weight: 700; }
.wl-page-sub    { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   FILE UPLOAD
   ============================================================ */
.wl-file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.wl-file-drop:hover {
  border-color: var(--accent);
  background: rgba(59,130,246,.05);
}

.wl-file-drop input { display: none; }

.wl-file-drop svg { width: 28px; height: 28px; margin: 0 auto 8px; display: block; }
.wl-file-drop p { font-size: 13px; }
.wl-file-drop span { color: var(--accent); font-weight: 600; }

/* ============================================================
   OTP / CODE INPUT
   ============================================================ */
.wl-otp-box {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.wl-otp-box input {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color .15s;
}

.wl-otp-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ============================================================
   SUCCESS PAGE
   ============================================================ */
.wl-success-icon {
  width: 72px; height: 72px;
  background: rgba(16,185,129,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.wl-success-icon svg { width: 36px; height: 36px; color: var(--success); }

/* ============================================================
   AUTH PAGES (login/signup standalone)
   ============================================================ */
.wl-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-root);
  padding: 20px;
}

.wl-auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.wl-auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.wl-auth-logo img { height: 42px; }

.wl-auth-title   { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.wl-auth-sub     { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }
.wl-auth-footer  { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }
.wl-auth-footer a { color: var(--accent); font-weight: 600; }

.wl-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ============================================================
   GRID HELPERS
   ============================================================ */
.wl-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.wl-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ============================================================
   BADGE
   ============================================================ */
.wl-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.wl-badge-blue   { background: rgba(59,130,246,.15); color: var(--accent); }
.wl-badge-green  { background: rgba(16,185,129,.15); color: var(--success); }
.wl-badge-amber  { background: rgba(245,158,11,.15);  color: var(--warning); }
.wl-badge-red    { background: rgba(239,68,68,.15);   color: var(--danger); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.wl-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .wl-sidebar {
    transform: translateX(-100%);
  }

  .wl-sidebar.open {
    transform: translateX(0);
  }

  .wl-sidebar-overlay.open {
    display: block;
  }

  .wl-main {
    margin-left: 0;
  }

  .wl-hamburger { display: flex; }

  .wl-hero-balance { font-size: 28px; }

  .wl-grid-2, .wl-grid-3 {
    grid-template-columns: 1fr;
  }

  .wl-auth-card {
    padding: 28px 20px;
  }

  .wl-content { padding: 16px; }
  .wl-topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .wl-quick-actions { gap: 8px; }
  .wl-action-btn { padding: 10px 12px; min-width: 60px; }
  .wl-stats-grid { grid-template-columns: 1fr 1fr; }
  .wl-otp-box input { width: 40px; height: 48px; font-size: 18px; }
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-muted   { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-accent  { color: var(--accent) !important; }
.text-center  { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.w-100  { width: 100%; }
