/* ═══════════════════════════════════════════════════════════════
   SBLTT WALLET — Stylesheet Unificado v5.0
   Paleta: Azul Balott + Rojo Peruano + Oro
   03 may 2026 — clean rewrite
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=Space+Mono:wght@400;700&display=swap');

/* ── VARIABLES ───────────────────────────────────────────────── */
:root {
  /* Colores logo Balott */
  --balott-blue:  #0d1a6e;
  --balott-blue2: #1a2875;
  --balott-red:   #6e0d0d;
  --balott-red2:  #8b1515;

  /* Oro */
  --gold:        #d4a032;
  --gold-bright: #e8ba44;
  --gold-dim:    #a07820;
  --gold-glow:   rgba(212,160,50,.20);

  /* Fondos */
  --bg-void:  #060810;
  --bg-deep:  #0a0d1c;
  --bg-card:  #0f1428;
  --bg-card2: #141b35;
  --bg-input: #18203d;
  --bg-hover: #1e2a50;

  /* Bordes */
  --border:        rgba(212,160,50,.18);
  --border-soft:   rgba(255,255,255,.08);
  --border-strong: rgba(212,160,50,.4);

  /* Semáforos */
  --green:      #00d68f;
  --green-glow: rgba(0,214,143,.15);
  --red:        #ff4757;
  --red-glow:   rgba(255,71,87,.15);
  --blue:       #4dabf7;
  --orange:     #ff922b;

  /* Texto */
  --text-primary:   #f0e8d0;
  --text-secondary: #8fa0c8;
  --text-muted:     #4a5878;

  /* Tipografía */
  --font-display: 'Cinzel', serif;
  --font-ui:      'DM Sans', sans-serif;
  --font-mono:    'Space Mono', monospace;

  /* Forma */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 4px 32px rgba(0,0,0,.55);
  --transition:  all .2s cubic-bezier(.4,0,.2,1);
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: linear-gradient(180deg, #050816 0%, #07091c 60%, #0a0a18 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── BACKGROUND PATTERN ──────────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(212,160,50,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,160,50,.02) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: .6;
}

/* ── LAYOUT WRAPPERS ─────────────────────────────────────────── */
.app-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 1180px; width: 100%; margin: 0 auto; padding: 0 16px; }
.container-narrow { max-width: 720px; width: 100%; margin: 0 auto; padding: 0 16px; }

/* ── TOPBAR ──────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,12,28,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  color: var(--gold); text-decoration: none;
}
.topbar-brand img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gold); }
.topbar-domain { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
}
.user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── NAVIGATION (header bar) ─────────────────────────────────── */
.nav-bar {
  background: rgba(10,12,28,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 6px 14px;
  position: sticky; top: 60px; z-index: 99;
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.nav-bar::-webkit-scrollbar { height: 4px; }
.nav-bar::-webkit-scrollbar-thumb { background: rgba(212,160,50,.3); border-radius: 4px; }
.nav-link {
  background: transparent; border: none; color: rgba(255,255,255,.55);
  padding: 8px 14px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: var(--transition);
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui);
}
.nav-link:hover { background: rgba(212,160,50,.1); color: var(--gold-bright); }
.nav-link.active {
  background: rgba(212,160,50,.16); color: var(--gold-bright);
  font-weight: 700; box-shadow: 0 0 0 1px rgba(212,160,50,.35);
}

/* Hamburger (móvil) */
.nav-hamburger {
  display: none;
  background: rgba(212,160,50,.18); border: 1px solid rgba(212,160,50,.4);
  border-radius: 10px; padding: 8px; cursor: pointer;
  width: 40px; height: 40px; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
}
.nav-hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--gold); border-radius: 2px;
}

/* ── MAIN CONTENT ────────────────────────────────────────────── */
.main-content { flex: 1; padding: 18px 0 80px; }
.page-title {
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  color: var(--gold); margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.card.gold {
  border-color: var(--border-strong);
  background: linear-gradient(135deg, rgba(212,160,50,.05), rgba(13,26,110,.15));
}

/* ── PORTFOLIO CARD ──────────────────────────────────────────── */
.portfolio-card {
  background: linear-gradient(135deg, rgba(13,26,110,.5), rgba(110,13,13,.3));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: visible;
}
.portfolio-label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(212,160,50,.7); margin-bottom: 6px; font-weight: 700;
}
.portfolio-total {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 700;
  color: #fff; line-height: 1.1;
}
.portfolio-sub {
  font-size: 13px; color: var(--text-secondary);
  margin-top: 4px;
}
.portfolio-sbltt {
  display: inline-block;
  font-size: 14px; font-weight: 700; color: var(--gold);
  font-family: var(--font-mono); margin-top: 8px;
}

/* Address inline */
.addr-inline {
  margin-top: 12px;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(212,160,50,.18);
}
.addr-inline .pa-label {
  font-size: 9px; font-weight: 700; color: rgba(212,160,50,.7);
  letter-spacing: 1.2px; text-transform: uppercase;
}
.addr-inline .pa-text {
  flex: 1; min-width: 0;
  font-family: var(--font-mono);
  font-size: 11px; color: rgba(255,255,255,.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
.addr-inline .pa-text.revealed {
  color: #fff; white-space: normal; word-break: break-all;
}
.addr-inline .pa-btn {
  background: none; border: 1px solid rgba(212,160,50,.25);
  border-radius: 7px; padding: 5px 10px;
  font-size: 11px; font-weight: 700;
  color: rgba(212,160,50,.8); cursor: pointer;
}
.addr-inline .pa-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(212,160,50,.08); }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: 26px;
  border: none;
  cursor: pointer;
  font-size: 13px; font-weight: 700;
  font-family: var(--font-ui);
  transition: var(--transition);
  text-decoration: none;
  min-height: 42px;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #000;
  box-shadow: 0 4px 16px rgba(212,160,50,.3);
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-green {
  background: linear-gradient(135deg, var(--green), #059669);
  color: #000;
}
.btn-red {
  background: linear-gradient(135deg, var(--red), #dc2626);
  color: #fff;
}
.btn-ghost {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-outline {
  background: transparent; border: 1px solid var(--border-strong); color: var(--gold);
}
.btn-outline:hover { background: var(--gold-glow); }
.btn-sm { padding: 8px 14px; font-size: 12px; min-height: 36px; }
.btn-lg { padding: 14px 24px; font-size: 14px; min-height: 50px; }
.btn-block { width: 100%; }

/* ── INPUTS ──────────────────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-ui);
  transition: var(--transition);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,160,50,.12);
}
.input-label {
  display: block;
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: rgba(212,160,50,.7);
  margin-bottom: 6px;
}
.input-group { margin-bottom: 14px; }

/* ── ALERTS / TOAST ──────────────────────────────────────────── */
.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
  margin-bottom: 12px;
  border: 1px solid;
}
.alert.show { display: flex; align-items: center; gap: 8px; }
.alert-error   { background: var(--red-glow);   border-color: rgba(255,71,87,.3);  color: #fca5a5; }
.alert-success { background: var(--green-glow); border-color: rgba(0,214,143,.3);  color: #6ee7b7; }
.alert-info    { background: rgba(77,171,247,.1); border-color: rgba(77,171,247,.3); color: #93c5fd; }

#toast-container {
  position: fixed; top: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 99999; pointer-events: none;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.6);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  animation: toastIn .25s ease;
  pointer-events: auto;
  max-width: 320px;
}
.toast.success { border-color: rgba(0,214,143,.4); }
.toast.error   { border-color: rgba(255,71,87,.4); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ── SPINNER ─────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(212,160,50,.3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

/* ── ASSET GRID ──────────────────────────────────────────────── */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  transition: var(--transition);
}
.asset-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.asset-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}
.asset-info { flex: 1; min-width: 0; }
.asset-name { font-size: 13px; font-weight: 700; }
.asset-amount { font-size: 13px; color: var(--text-secondary); font-family: var(--font-mono); }
.asset-usd { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.asset-change { font-size: 11px; font-weight: 700; text-align: right; }
.asset-change.up   { color: var(--green); }
.asset-change.down { color: var(--red); }

/* ── PRICE TICKER ────────────────────────────────────────────── */
.ticker-bar {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 14px;
  background: rgba(10,12,28,.7);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  font-size: 11px;
}
.ticker-bar::-webkit-scrollbar { height: 0; }
.ticker-item {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.ticker-icon { font-weight: 700; font-size: 14px; }
.ticker-price { font-weight: 700; }
.ticker-change.up   { color: var(--green); }
.ticker-change.down { color: var(--red); }

/* ── AUTH (LOGIN / REGISTER) ─────────────────────────────────── */
.auth-screen {
  position: fixed; inset: 0; z-index: 99999;
  background: linear-gradient(135deg, #080b1a 0%, #0d0618 55%, #1a060a 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.auth-screen[hidden] { display: none !important; }
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 420px; width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,.85);
}
.auth-logo {
  width: 70px; height: 70px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  margin: 0 auto 18px;
  overflow: hidden;
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--gold);
  text-align: center; margin-bottom: 6px;
}
.auth-sub { text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 24px; }
.auth-link { color: var(--gold); cursor: pointer; text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }

/* ── HISTORY LIST ────────────────────────────────────────────── */
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.history-item:last-child { border-bottom: none; }
.history-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.history-icon.in  { background: var(--green-glow); color: var(--green); }
.history-icon.out { background: rgba(212,160,50,.12); color: var(--gold); }
.history-info { flex: 1; min-width: 0; }
.history-title { font-weight: 600; font-size: 13px; }
.history-meta  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.history-amount { font-weight: 700; font-size: 13px; text-align: right; font-family: var(--font-mono); }
.history-amount.in  { color: var(--green); }
.history-amount.out { color: var(--gold); }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-msg  { font-size: 13px; }

/* ── FORM HELPERS ────────────────────────────────────────────── */
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 200px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-gold { color: var(--gold); }
.font-mono { font-family: var(--font-mono); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }

/* ── LOADING OVERLAY ─────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg-void);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
}
.loading-overlay[hidden] { display: none; }
.loading-coin {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  overflow: hidden;
  animation: pulse 2s ease-in-out infinite;
}
.loading-coin img { width: 100%; height: 100%; object-fit: cover; }
.loading-text {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
}
.loading-sub { font-size: 12px; color: var(--text-muted); }
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212,160,50,.4); }
  50%      { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(212,160,50,0); }
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 10px 12px; padding-right: 56px; }
  .topbar-domain { display: none; }
  .nav-bar { display: none; padding-right: 70px; }
  .nav-bar.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(80vw, 280px);
    z-index: 1500;
    padding: 70px 14px 20px;
    background: rgba(8,10,22,.98);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    border-bottom: none;
    overflow-y: auto;
  }
  .nav-bar.open .nav-link {
    padding: 12px 14px; border-radius: 10px;
    justify-content: flex-start;
  }
  .nav-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6); z-index: 1400;
    backdrop-filter: blur(3px);
  }
  .nav-overlay.open { display: block; }
  .nav-hamburger {
    display: flex !important;
    position: fixed; top: 12px; right: 14px; z-index: 1600;
  }
  .portfolio-total { font-size: 26px; }
  .page-title { font-size: 20px; }
  .container, .container-narrow { padding: 0 12px; }
  .main-content { padding: 14px 0 80px; }
}

@media (max-width: 400px) {
  .topbar-brand { font-size: 14px; }
  .auth-box { padding: 24px 20px; }
}
