/* ═══════════════════════════════════════════════════════════════
   OmniaCoin · Quantum Neural — Design System
   Built from: omniacoin-design-specs.md v2
   Fonts: Rajdhani (display) · Outfit (body) · JetBrains Mono
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   1a ── RESET GLOBALE
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════════
   1b ── CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   Quantum Neural Design Specs v2 — COMPLIANT
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* ── BACKGROUNDS (specs §2) ── */
  --bg0: #040608;
  --bg1: #060A0C;
  --bg: #040608;
  --bg2: #080c12;
  --bg3: #0e1420;

  /* ── TESTI (specs §2) ── */
  --text: #E9F2F2;
  --muted: #A6B7B7;
  --t: #E9F2F2;
  --ts: #A6B7B7;
  --tm: #78909C;

  /* ── BORDI (specs §2) ── */
  --line: rgba(255,255,255,0.08);
  --line2: rgba(255,255,255,0.14);
  --br: rgba(255,255,255,0.08);
  --brb: rgba(255,255,255,0.14);

  /* ── SUPERFICI (specs §2) ── */
  --glass: rgba(255,255,255,0.025);
  --card: rgba(6,10,16,0.65);
  --hover: rgba(16,24,38,0.85);

  /* ── BRAND COLORS (specs §2) ── */
  --a: #00DCA0;
  --b: #5484FF;
  --c: #0BE6B6;
  --g: #00DCA0;
  --gd: rgba(0,220,160,0.12);

  /* ── SEMANTIC COLORS (specs §2) ── */
  --warn: #FFB020;
  --red: #FF4560;
  --r: #FF4560;
  --rd: rgba(255,69,96,0.12);
  --orange: #FF6B35;
  --p: #A855F7;
  --cy: #0BE6B6;
  --o: #FFB020;
  --y: #fbbf24;

  /* ── SHADOWS & EFFECTS (specs §2) ── */
  --shadow: 0 18px 50px rgba(0,0,0,0.5);

  /* ── BORDER RADIUS (specs §2) — NO collision ── */
  --radius: 22px;
  --radius2: 16px;
  --r2: 16px;

  /* ── MAX WIDTH (specs §2) ── */
  --maxw: 1440px;

  /* ── TIPOGRAFIA (specs §1) ── */
  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --fd: 'Rajdhani', sans-serif;
  --fb: 'Outfit', sans-serif;
  --fm: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════════════════
   1c ── STILI BASE BODY
   Specs §8 Step 3: body bg #040608, color #E9F2F2, Outfit+Rajdhani
   ═══════════════════════════════════════════════════════════════ */
body {
  font-family: var(--font-body);
  background: var(--bg0);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  touch-action: pan-y;
  font-size: 16px;
  position: relative;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg0); }
::-webkit-scrollbar-thumb { background: rgba(0,220,160,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,220,160,0.35); }
a { color: inherit; text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════
   1d ── BACKGROUND LAYERS
   Atmospheric QN glow + grid + vignette
   ═══════════════════════════════════════════════════════════════ */

#neuralCanvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}

.bg-w {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-g {
  position: absolute;
  width: 100%; height: 100%;
  background:
    radial-gradient(700px 500px at 15% 25%, rgba(0,220,160,0.10), transparent 60%),
    radial-gradient(600px 400px at 85% 75%, rgba(84,132,255,0.07), transparent 70%),
    radial-gradient(800px 600px at 50% 40%, rgba(0,220,160,0.04), transparent 50%);
  animation: gs 25s ease infinite;
}
@media (max-width: 768px) {
  .bg-g {
    background:
      radial-gradient(400px 300px at 10% 15%, rgba(0,220,160,0.055), transparent 70%),
      radial-gradient(350px 250px at 90% 80%, rgba(84,132,255,0.04), transparent 70%),
      radial-gradient(500px 400px at 50% 50%, rgba(0,220,160,0.02), transparent 60%);
    animation: gs-mob 30s ease infinite;
  }
  @keyframes gs-mob {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.04); opacity: 0.8; }
  }
}
.grid-o {
  position: absolute;
  width: 200%; height: 200%;
  background-image:
    linear-gradient(rgba(0,220,160,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84,132,255,0.012) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gm 40s linear infinite;
  opacity: 0.6;
}
.bg-w::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(4,6,8,0.6) 100%);
  pointer-events: none;
}
.content { position: relative; z-index: 1; width: 100%; overflow-x: hidden; }

/* ═══════════════════════════════════════════════════════════════
   1e ── KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes gs {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08) rotate(2deg); opacity: 0.85; }
}
@keyframes gm {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}
@keyframes pu {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,220,160,0.7); }
  50% { box-shadow: 0 0 0 8px rgba(0,220,160,0); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 8px var(--a); }
  50% { box-shadow: 0 0 22px var(--a), 0 0 35px rgba(0,220,160,0.3); }
}
@keyframes shimmerBtn {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes scanLine {
  0% { top: 0%; opacity: 0.8; }
  100% { top: 100%; opacity: 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scr {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes fi {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes flashGreen {
  0% { background: var(--gd); box-shadow: 0 0 20px rgba(0,220,160,0.5); }
  50% { background: rgba(0,220,160,0.3); box-shadow: 0 0 35px rgba(0,220,160,0.8); }
  100% { background: var(--gd); box-shadow: 0 0 20px rgba(0,220,160,0.5); }
}
@keyframes flashRed {
  0% { background: var(--rd); box-shadow: 0 0 20px rgba(255,69,96,0.5); }
  50% { background: rgba(255,69,96,0.3); box-shadow: 0 0 35px rgba(255,69,96,0.8); }
  100% { background: var(--rd); box-shadow: 0 0 20px rgba(255,69,96,0.5); }
}
.flash-green { animation: flashGreen 1.2s ease-out; }
.flash-red { animation: flashRed 1.2s ease-out; }

/* ═══════════════════════════════════════════════════════════════
   1f ── QN GLASS MORPHISM — specs §3
   ═══════════════════════════════════════════════════════════════ */
.qn-glass {
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  position: relative;
  overflow: hidden;
}
.qn-glass::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(500px 150px at 50% 0%, rgba(0,220,160,0.07), transparent 60%);
  pointer-events: none;
}
.qn-glass > * { position: relative; z-index: 1; }

.qn-glass-purple::before {
  background: radial-gradient(500px 150px at 50% 0%, rgba(168,85,247,0.07), transparent 60%);
}
.qn-glass-blue::before {
  background: radial-gradient(500px 150px at 50% 0%, rgba(84,132,255,0.07), transparent 60%);
}
.qn-glass-warn::before {
  background: radial-gradient(500px 150px at 50% 0%, rgba(255,176,32,0.07), transparent 60%);
}

.qn-panel {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
}

/* ═══════════════════════════════════════════════════════════════
   1g ── QN BADGE / PILL — specs §4 status-badge
   ═══════════════════════════════════════════════════════════════ */
.qn-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 900; letter-spacing: 0.3px;
}
.qn-badge-green { border: 1px solid rgba(0,220,160,0.25); background: rgba(0,220,160,0.07); color: var(--a); }
.qn-badge-blue { border: 1px solid rgba(84,132,255,0.25); background: rgba(84,132,255,0.07); color: var(--b); }
.qn-badge-purple { border: 1px solid rgba(168,85,247,0.25); background: rgba(168,85,247,0.07); color: var(--p); }
.qn-badge-warn { border: 1px solid rgba(255,176,32,0.3); background: rgba(255,176,32,0.07); color: var(--warn); }
.qn-badge-red { border: 1px solid rgba(255,69,96,0.3); background: rgba(255,69,96,0.07); color: var(--red); }

/* ═══════════════════════════════════════════════════════════════
   1h ── QN PULSE DOT — specs §3 live-dot
   ═══════════════════════════════════════════════════════════════ */
.qn-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--a);
  box-shadow: 0 0 8px var(--a);
  animation: pulseGlow 2s infinite;
}
.qn-dot-blue { background: var(--b); box-shadow: 0 0 8px var(--b); }
.qn-dot-purple { background: var(--p); box-shadow: 0 0 8px var(--p); }
.qn-dot-warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.qn-dot-red { background: var(--red); box-shadow: 0 0 8px var(--red); }

/* ═══════════════════════════════════════════════════════════════
   1i ── QN CTA BUTTON — specs §3 shimmer
   ═══════════════════════════════════════════════════════════════ */
.qn-cta {
  padding: 16px 30px; border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 900; font-size: 14px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  transition: transform 0.3s, box-shadow 0.3s;
  letter-spacing: 0.3px; text-transform: uppercase;
  position: relative; overflow: hidden; border: none;
  text-decoration: none; color: var(--text);
}
.qn-cta-primary {
  background: linear-gradient(135deg, rgba(0,220,160,0.35), rgba(84,132,255,0.18));
  border: 1px solid rgba(0,220,160,0.5);
  box-shadow: 0 12px 30px rgba(0,220,160,0.2);
}
.qn-cta-primary::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: translateX(-100%); animation: shimmerBtn 3s infinite;
}
.qn-cta-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 45px rgba(0,220,160,0.35); }
.qn-cta-ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.qn-cta-ghost:hover { transform: translateY(-2px); background: rgba(255,255,255,0.07); }
.qn-cta-warn {
  background: linear-gradient(135deg, rgba(255,176,32,0.25), rgba(255,107,53,0.15));
  border: 1px solid rgba(255,176,32,0.4);
  color: var(--warn);
  box-shadow: 0 12px 30px rgba(255,176,32,0.15);
}
.qn-cta-warn:hover { transform: translateY(-3px); box-shadow: 0 18px 45px rgba(255,176,32,0.3); }

/* ═══════════════════════════════════════════════════════════════
   1j ── QN DIVIDER
   ═══════════════════════════════════════════════════════════════ */
.qn-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line2), transparent);
  margin: 40px 0;
}

/* ═══════════════════════════════════════════════════════════════
   1k ── QN METRIC BOX — specs §4
   ═══════════════════════════════════════════════════════════════ */
.metric-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.metric-label {
  font-size: 10px; color: var(--muted); font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 5px;
}
.metric-value {
  font-family: var(--font-mono);
  font-size: 21px; font-weight: 900; line-height: 1.1;
}
.metric-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ═══════════════════════════════════════════════════════════════
   1l ── QN DARK INPUT / SELECT — specs §4
   ═══════════════════════════════════════════════════════════════ */
.dark-input, .dark-select {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px; font-weight: 500;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 100%;
}
.dark-input:focus, .dark-select:focus {
  outline: none;
  border-color: var(--a);
  box-shadow: 0 0 0 3px rgba(0,220,160,0.1);
}

/* ═══════════════════════════════════════════════════════════════
   1m ── QN TERMINAL — specs §4
   ═══════════════════════════════════════════════════════════════ */
.terminal {
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  height: 200px;
  overflow-y: auto;
}
.terminal::-webkit-scrollbar { width: 4px; }
.terminal::-webkit-scrollbar-thumb { background: var(--a); border-radius: 2px; }
.t-green  { color: var(--a); }
.t-blue   { color: var(--b); }
.t-yellow { color: var(--warn); }
.t-red    { color: var(--red); }
.t-gray   { color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════
   1n ── ASSET LOGOS (preserved)
   ═══════════════════════════════════════════════════════════════ */
.stk-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; background: #fff; padding: 2px; flex-shrink: 0; }
.stk-logo-wrap { width: 30px; height: 30px; border-radius: 7px; background: rgba(255,255,255,0.95); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.stk-logo-wrap img { width: 24px; height: 24px; object-fit: contain; }
.flag-logo { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; background: rgba(255,255,255,0.08); line-height: 1; }
.com-logo { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; background: rgba(255,215,0,0.15); }
.com-logo.silver { background: linear-gradient(135deg, rgba(192,192,192,0.3), rgba(220,220,220,0.2)); filter: grayscale(0); }
.com-logo.copper { background: rgba(184,115,51,0.15); }
.fx-flags { position: relative; width: 38px; height: 28px; flex-shrink: 0; }
.fx-flag { width: 24px; height: 16px; border-radius: 3px; position: absolute; top: 0; left: 0; border: 1.5px solid rgba(0,0,0,0.3); box-shadow: 0 1px 2px rgba(0,0,0,0.3); object-fit: cover; }
.fx-flag2 { left: 12px; top: 6px; z-index: 1; }
.idx-flag { width: 32px; height: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.idx-flag img { border: 1.5px solid rgba(255,255,255,0.15); box-shadow: 0 1px 3px rgba(0,0,0,0.3); width: 24px; height: 16px; border-radius: 2px; object-fit: cover; }

/* ═══════════════════════════════════════════════════════════════
   1o ── RESPONSIVE TYPOGRAPHY SCALE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  body { font-size: 15px; }
}
