/* ═══════════════════════════════════════════════════════════
   pulse. — design system
   A signals/copy-trading platform. Dark navy trading-desk base,
   candlestick green/red as the ONLY functional color, a pulse
   waveform as the one recurring brand motif.
   ═══════════════════════════════════════════════════════════ */

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

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

:root {
  /* Base */
  --bg:        #0a0e14;
  --surface:   #10161f;
  --surface2:  #161d28;
  --border:    rgba(232, 236, 241, 0.08);
  --border-hi: rgba(232, 236, 241, 0.16);

  /* Text */
  --white:     #e8ecf1;
  --muted:     #8993a6;
  --faint:     #4d5666;

  /* Functional — gains/losses only. Never decorative. */
  --up:        #2ed9a8;
  --up-dim:    rgba(46, 217, 168, 0.12);
  --up-border: rgba(46, 217, 168, 0.3);
  --down:      #f0554a;
  --down-dim:  rgba(240, 85, 74, 0.12);
  --down-border: rgba(240, 85, 74, 0.3);
  --red: #d81f27;
  --amber:     #e8a944;

  /* Fonts */
  --font-display: 'Archivo', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-data:    'IBM Plex Mono', monospace;
}

html { background: var(--bg); color: var(--white); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; line-height: 1.5; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.mono { font-family: var(--font-data); }

/* ═══ LAYOUT SHELL ═══ */
.shell { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo-mark {
  width: 26px; height: 26px;
  position: relative;
}
.nav-logo-mark svg { width: 100%; height: 100%; }
.nav-logo-text {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nav-logo-text .dot { color: var(--up); }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link { font-size: 14px; color: var(--muted); transition: color 0.15s; }
.nav-link:hover { color: var(--white); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.btn-primary { background: var(--up); color: #05130f; }
.btn-primary:hover { opacity: 0.88; }
.btn-ghost { background: transparent; color: var(--white); border: 1px solid var(--border-hi); }
.btn-ghost:hover { background: var(--surface); }
.btn-block { width: 100%; padding: 14px; font-size: 15px; }

/* ═══ PULSE WAVEFORM MOTIF ═══
   The single recurring brand device. Used sparingly — hero
   background and section dividers only, never decoratively
   scattered. */
.pulse-line { width: 100%; height: 48px; opacity: 0.5; }
.pulse-line path {
  fill: none;
  stroke: var(--up);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pulse-divider { padding: 4px 0 0; overflow: hidden; }

/* ═══ SIGNAL CARD — the core product unit, reused everywhere ═══ */
.signal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px 22px;
}
.signal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.signal-pair {
  display: flex;
  align-items: center;
  gap: 10px;
}
.signal-pair-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}
.signal-dir {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 9px;
}
.signal-dir.long  { background: var(--up-dim);   color: var(--up);   border: 1px solid var(--up-border); }
.signal-dir.short { background: var(--down-dim); color: var(--down); border: 1px solid var(--down-border); }

.signal-status {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.signal-status.live::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--amber);
  border-radius: 50%;
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.signal-stat { background: var(--bg); padding: 10px 12px; }
.signal-stat-label {
  font-family: var(--font-data);
  font-size: 9px;
  color: var(--faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.signal-stat-val {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 600;
}

.signal-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.signal-result-label { font-size: 12px; color: var(--muted); }
.signal-result-val {
  font-family: var(--font-data);
  font-size: 16px;
  font-weight: 600;
}
.signal-result-val.up { color: var(--up); }
.signal-result-val.down { color: var(--down); }

/* ═══ SECTION LABEL ═══ */
.section-label {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

/* ═══ STAT ROW ═══ */
.stat-row { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.stat-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.stat-cell { background: var(--surface); padding: 18px 20px; }
.stat-cell-label { font-family: var(--font-data); font-size: 10px; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 6px; }
.stat-cell-val { font-family: var(--font-data); font-size: 24px; font-weight: 600; }
.stat-cell-val.up { color: var(--up); }

/* ═══ FORMS ═══ */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 7px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-hi);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--up); }
input::placeholder { color: var(--faint); }

/* ═══ MOBILE ═══ */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .shell { padding: 0 18px; }
  .signal-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   DEMO TRADING — added components
   ═══════════════════════════════════════════════════════════ */

/* ── The permanent, unmissable DEMO badge ──
   This must appear on every page in the demo section. It is
   deliberately loud — amber, not a quiet grey label — because
   the entire legitimacy of this feature rests on nobody ever
   mistaking it for a real account. */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amber);
  color: #1a1200;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
}
.demo-badge::before {
  content: '●';
  font-size: 8px;
}
.demo-strip {
  background: var(--amber);
  color: #1a1200;
  text-align: center;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 7px 12px;
}

/* ── App shell for the 5-tab demo section ── */
.app-body { padding-bottom: 84px; min-height: 100vh; }

.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
}
.balance-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-family: var(--font-data);
  font-size: 14px; font-weight: 600;
}
.topbar-icons { display: flex; align-items: center; gap: 16px; color: var(--muted); }

.bottom-tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(5, 1fr);
  z-index: 100;
}
.tab-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 10px 4px;
  background: none; border: none; cursor: pointer; text-decoration: none;
  color: var(--faint);
}
.tab-item svg { width: 21px; height: 21px; }
.tab-item span { font-size: 10px; font-weight: 500; }
.tab-item.active { color: var(--up); }

/* ── Balance hero card (Home) ── */
.balance-hero-card {
  margin: 0 20px 20px;
  padding: 24px 22px;
  background: linear-gradient(135deg, #131a2a 0%, #0d1420 100%);
  border: 1px solid var(--border-hi);
  position: relative;
  overflow: hidden;
}
.balance-hero-card::before {
  content: '';
  position: absolute; top: -40%; right: -20%;
  width: 60%; height: 180%;
  background: radial-gradient(circle, rgba(46,217,168,0.10), transparent 70%);
  pointer-events: none;
}
.balance-hero-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; position: relative;
}
.balance-hero-label {
  font-family: var(--font-data); font-size: 11px; color: var(--muted);
  letter-spacing: 0.04em;
}
.balance-hero-amount {
  font-family: var(--font-data); font-size: 38px; font-weight: 600;
  letter-spacing: -0.02em; margin-bottom: 4px; position: relative;
}
.balance-hero-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; position: relative; }
.balance-hero-actions { display: flex; gap: 10px; position: relative; }
.balance-hero-actions .btn { flex: 1; }

.quick-actions {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; padding: 0 20px; margin-bottom: 28px;
}
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; color: var(--white);
  background: none; border: none; cursor: pointer;
}
.quick-action-icon {
  width: 48px; height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--up);
}
.quick-action span { font-size: 11px; text-align: center; }

/* ── Market rows ── */
.market-list { display: flex; flex-direction: column; }
.market-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--white);
}
.market-row-left { display: flex; align-items: center; gap: 12px; }
.market-icon {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-data); font-size: 11px; font-weight: 700;
  color: var(--up);
}
.market-name { font-size: 15px; font-weight: 600; }
.market-sub { font-size: 12px; color: var(--faint); margin-top: 1px; }
.market-row-right { text-align: right; }
.market-price { font-family: var(--font-data); font-size: 15px; font-weight: 600; }
.market-change { font-family: var(--font-data); font-size: 12px; margin-top: 2px; }
.market-change.up { color: var(--up); }
.market-change.down { color: var(--down); }

/* ── Trade screen ── */
.trade-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; }
.trade-symbol { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.trade-price-row { display: flex; align-items: baseline; gap: 10px; padding: 0 20px 16px; }
.trade-price { font-family: var(--font-data); font-size: 26px; font-weight: 600; }

.chart-wrap { padding: 0 20px 20px; }
.chart-canvas-box {
  background: var(--surface);
  border: 1px solid var(--border);
  height: 220px;
  position: relative;
}

.symbol-tabs { display: flex; gap: 1px; background: var(--border); border: 1px solid var(--border); margin: 0 20px 20px; overflow-x: auto; }
.symbol-tab {
  flex: 1; padding: 10px; text-align: center;
  background: var(--surface); border: none; cursor: pointer;
  font-family: var(--font-data); font-size: 12px; font-weight: 600;
  color: var(--muted); white-space: nowrap;
  text-decoration: none;
}
.symbol-tab.active { color: var(--up); background: var(--surface2); }

.trade-panel { padding: 0 20px; }
.size-input-wrap {
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border-hi);
  margin-bottom: 14px;
}
.size-input-wrap span { padding: 0 14px; color: var(--muted); font-family: var(--font-data); }
.size-input-wrap input {
  border: none; background: none; flex: 1;
  font-family: var(--font-data); font-size: 18px; font-weight: 600;
  padding: 14px 14px 14px 0; color: var(--white); outline: none;
}
.buy-sell-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trade-btn {
  padding: 16px; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.trade-btn.sell { background: var(--down-dim); color: var(--down); border: 1px solid var(--down-border); }
.trade-btn.buy  { background: var(--up-dim);   color: var(--up);   border: 1px solid var(--up-border); }
.trade-btn small { font-family: var(--font-data); font-size: 12px; font-weight: 500; opacity: 0.85; }

/* ── Portfolio ── */
.portfolio-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); margin: 0 20px 20px; }
.ptab { padding: 12px; text-align: center; background: var(--surface); border: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.ptab.active { background: var(--surface2); color: var(--white); }
.ptab-panel { display: none; }
.ptab-panel.active { display: block; }

.position-card { background: var(--surface); border: 1px solid var(--border); margin: 0 20px 10px; padding: 16px 18px; }
.position-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.position-symbol { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.position-meta { font-family: var(--font-data); font-size: 11px; color: var(--faint); margin-top: 2px; }
.position-pnl { font-family: var(--font-data); font-size: 17px; font-weight: 700; }
.position-actions { margin-top: 12px; }
.btn-close-position { width: 100%; padding: 10px; background: var(--surface2); border: 1px solid var(--border-hi); color: var(--white); font-size: 13px; font-weight: 600; cursor: pointer; }

.empty-portfolio { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty-portfolio-icon { width: 64px; height: 64px; margin: 0 auto 16px; opacity: 0.4; }

/* ── More grid ── */
.more-section-label { padding: 20px 20px 12px; font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 20px; margin-bottom: 8px; }
.more-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--white); background: var(--surface); border: 1px solid var(--border); padding: 18px 10px; text-align: center; }
.more-tile-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--up); }
.more-tile span { font-size: 12px; font-weight: 500; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 17px;
  top: 0;
  backdrop-filter: blur(16px);
  z-index: 50;
}

.top svg {
  height: 22px;
  width: 22px;
  color: var(--muted);
  font-weight: 700;
}

.top-head {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.coin-grid {
  display: grid;
  gap: 4px;
  border-radius: 10px;
  padding: 1px 2px 1px;
  margin: 0 10px 0px;
}

.coin-grid.cols-2 {
  grid-template-columns: 1fr 1fr;
}
.coin-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.coin-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}
.coin-grid.inset {
  margin: 0 20px 20px;
}

.coin-btn {
  background: var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.2s;
  border-left: 2px solid transparent;
}

.coin-btn:has(input:checked) {
  background: var(--darkgreen);
}

.coin-btn img {
  height: 33px;
  width: 33px;
}

.coin-name {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
}

.coin-network {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-top: 2px;
}

.submit-btn {
  margin: 6px 12px;
  display: block;
  width: calc(100% - 24px);
  padding: 14px;
  background: var(--down);
  color: var(--white);
  border-radius: 10px;
  border: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.submit-btn:hover {
  opacity: 0.85;
}

.submit-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.error-msg {
  margin: 8px 12px 0 12px;
  border-radius: 5px;
  padding: 12px 16px;
  background: var(--red-dim);
  border: 1px solid var(--red-border);
  font-size: 13px;
  color: var(--red);
}

.section-label {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 15px 20px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}