/* ==========================================================================
   ZARABA EXCHANGE - DESIGN SYSTEM
   Refined Obsidian — exchange-grade UI palette
   ========================================================================== */

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================================================== */

:root {
  /* ===== COLOR PALETTE =====
     Refined Obsidian — Exchange-grade dark palette */
  
  /* Backgrounds - Layered depth system */
  --bg-primary: #0A0D12;       /* App canvas */
  --bg-secondary: #11161D;     /* Layout zones */
  --bg-tertiary: #161C26;      /* Trading panels */
  --bg-elevated: #1F2633;      /* Modals / dropdowns */
  --bg-surface: #2A3343;       /* Hover states */
  
  /* Text hierarchy */
  --text-primary: #E8ECF2;     /* Key numbers, balances */
  --text-secondary: #A5ADBA;   /* Labels */
  --text-tertiary: #8B92A0;    /* Descriptions */
  --text-muted: #6B7280;       /* Metadata */
  
  /* Brand & Accent colors */
  --accent-primary: #3B82F6;          /* Primary blue */
  --accent-primary-hover: #2563EB;    /* Interactive states */
  --accent-primary-muted: rgba(59, 130, 246, 0.18);
  --accent-secondary: #60A5FA;        /* Accent glow / highlight */
  --accent-sky: #60A5FA;              /* Focus / highlight */
  --accent-teal: #34D399;             /* Success indicator */
  --accent-pink: #F472B6;             /* Notification accent */
  --accent-yellow: #FBBF24;           /* Warning */
  
  /* Trading colors */
  --color-buy: #16C784;        /* Buy / Positive */
  --color-buy-hover: #22D68F;
  --color-buy-muted: rgba(22, 199, 132, 0.15);
  --color-buy-subtle: rgba(22, 199, 132, 0.08);
  
  --color-sell: #EA3943;       /* Sell / Negative */
  --color-sell-hover: #FF5B6A;
  --color-sell-muted: rgba(234, 57, 67, 0.15);
  --color-sell-subtle: rgba(234, 57, 67, 0.08);
  
  /* Neutral trading indicator */
  --color-neutral: #FBBF24;    /* Warning / Neutral */
  --color-neutral-muted: rgba(251, 191, 36, 0.15);
  
  /* Borders & Dividers */
  --border-primary: #242C3A;   /* Standard border */
  --border-secondary: #2A3343; /* Heavier border */
  --border-subtle: rgba(232, 236, 242, 0.06);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  
  /* ===== TYPOGRAPHY SCALE =====
     Montserrat for UI, Fira Code for numbers */
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'SF Mono', 'IBM Plex Mono', monospace;
  
  /* Type scale - Minor third (1.2) */
  --text-xs: 0.694rem;    /* 11px */
  --text-sm: 0.833rem;    /* 13px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.2rem;      /* 19px */
  --text-xl: 1.44rem;     /* 23px */
  --text-2xl: 1.728rem;   /* 28px */
  --text-3xl: 2.074rem;   /* 33px */
  
  /* Font weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  
  /* Line heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  
  /* Letter spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  
  /* ===== SPACING SCALE =====
     8px base unit system */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  
  /* ===== BORDER RADIUS ===== */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  
  /* ===== TRANSITIONS ===== */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-slower: 500ms ease;
  
  /* ===== Z-INDEX SCALE ===== */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-tooltip: 600;
}

/* ==========================================================================
   2. CSS RESET & BASE STYLES
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
}

/* Selection styling */
::selection {
  background-color: var(--accent-primary-muted);
  color: var(--text-primary);
}

/* Focus visible - accessibility */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Links */
a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lists */
ul, ol {
  list-style: none;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
  color: var(--text-secondary);
}

small {
  font-size: var(--text-sm);
}

/* Monospace numbers for financial data */
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
}

/* Price displays */
.price {
  font-family: var(--font-mono);
  font-weight: var(--font-medium);
  letter-spacing: var(--tracking-tight);
}

.price-up { color: var(--color-buy); }
.price-down { color: var(--color-sell); }
.price-neutral { color: var(--text-primary); }

/* ==========================================================================
   4. LAYOUT COMPONENTS
   ========================================================================== */

/* Main container */
main {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-6);
}

/* ==========================================================================
   5. SITE HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-6);
}

/* --- Left: Brand + Nav group --- */
.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

/* --- Navigation links --- */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.header-nav--desktop {
  display: none;
}

@media (min-width: 1024px) {
  .header-nav--desktop {
    display: flex;
  }
}

.header-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.header-nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.header-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--accent-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.header-nav-link:hover::after {
  width: 70%;
}

/* --- Brand --- */
.header-brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-0);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  transition: color var(--transition-fast);
}

.header-brand-link:hover {
  color: var(--accent-primary);
}

.header-brand-logo {
  width: 55px;
  height: 55px;
  object-fit: contain;
  flex-shrink: 0;
}

/* --- Right: Action buttons --- */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-left: auto;
}

.header-actions--desktop {
  display: none;
}

@media (min-width: 768px) {
  .header-actions--desktop {
    display: inline-flex;
  }
}

.header-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-secondary);
}

.header-logout-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

/* ===== Avatar ===== */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: var(--font-semibold);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
}

.avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.avatar--md {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

/* ===== Profile Popover ===== */
.profile-popover-wrap {
  position: relative;
}

.avatar-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.avatar-trigger:hover {
  border-color: var(--border-secondary);
}

.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 248px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  z-index: calc(var(--z-sticky) + 10);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(-4px);
  transform-origin: top right;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  overflow: hidden;
}

.popover.is-open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.popover-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-primary);
}

.popover-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.popover-header-info {
  min-width: 0;
}

.popover-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popover-description {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popover-body {
  padding: 6px 8px;
}

.popover-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 8px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.popover-link:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.popover-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.popover-footer {
  padding: 8px;
  border-top: 1px solid var(--border-primary);
}

.popover-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-sticky) - 1);
}

.popover-backdrop.is-open {
  display: block;
}

/* ===== Mobile profile header ===== */
.mobile-profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-4) 0;
}

.mobile-profile-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.mobile-profile-email {
  font-size: 11px;
  color: var(--text-tertiary);
}

.mobile-nav-divider {
  height: 1px;
  background-color: var(--border-primary);
  margin-bottom: var(--space-2);
}

/* Outline button variant for navbar */
.btn-outline {
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid var(--border-secondary);
}

.btn-outline:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  border-color: var(--text-tertiary);
}

/* --- Mobile hamburger toggle --- */
.header-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin-left: auto;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.header-mobile-toggle:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

@media (min-width: 1024px) {
  .header-mobile-toggle {
    display: none;
  }
}

.header-mobile-toggle .icon-close {
  display: none;
}

.header-mobile-toggle.is-active .icon-menu {
  display: none;
}

.header-mobile-toggle.is-active .icon-close {
  display: block;
}

/* --- Mobile dropdown menu --- */
.header-mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
}

.header-mobile-menu.is-open {
  display: block;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.header-mobile-menu-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-2);
  font-size: var(--text-lg);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.mobile-nav-link:hover {
  background-color: var(--bg-tertiary);
}

.mobile-nav-link svg {
  color: var(--text-muted);
}

.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-4);
  margin-top: var(--space-2);
  border-top: 1px solid var(--border-primary);
}

/* ==========================================================================
   6. BUTTONS
   ========================================================================== */

/* Base button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1;
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  background-color: var(--bg-elevated);
  border-color: var(--text-tertiary);
}

.btn:active {
  transform: translateY(1px);
}

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

/* Primary button */
.btn-primary {
  color: #0A0D12;
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.btn-primary:hover {
  color: #0A0D12;
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

/* Buy button */
.btn-buy,
.buy-btn {
  color: #fff;
  background-color: var(--color-buy);
  border-color: var(--color-buy);
}

.btn-buy:hover,
.buy-btn:hover {
  background-color: var(--color-buy-hover);
  border-color: var(--color-buy-hover);
}

/* Sell button */
.btn-sell,
.sell-btn {
  color: #fff;
  background-color: var(--color-sell);
  border-color: var(--color-sell);
}

.btn-sell:hover,
.sell-btn:hover {
  background-color: var(--color-sell-hover);
  border-color: var(--color-sell-hover);
}

/* Ghost button */
.btn-ghost {
  color: var(--text-secondary);
  background-color: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

/* Small button */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

/* Large button */
.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
}

/* Full width button */
.btn-block {
  width: 100%;
}

/* ==========================================================================
   7. FORM ELEMENTS
   ========================================================================== */

/* Form group */
.form-group {
  margin-bottom: var(--space-4);
}

/* Labels */
label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

/* Input fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-secondary);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--accent-primary-muted);
}

/* Number inputs - monospace for precision */
input[type="number"] {
  font-family: var(--font-mono);
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Checkbox & Radio */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Submit buttons */
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: #0A0D12;
  background-color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

input[type="submit"]:hover {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

/* Error state */
.error {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-sell);
}

label.error {
  margin-bottom: var(--space-2);
}

input.error,
select.error {
  border-color: var(--color-sell);
}

/* ==========================================================================
   8. CARDS & PANELS
   ========================================================================== */

.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-primary);
}

.card-header h3 {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-primary);
  background-color: var(--bg-tertiary);
}

/* Panel variant - more subtle */
.panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}

.panel-title {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  border-bottom: 1px solid var(--border-primary);
}

/* ==========================================================================
   9. TABLES
   ========================================================================== */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  background-color: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
  white-space: nowrap;
}

th:first-child {
  border-top-left-radius: var(--radius-md);
}

th:last-child {
  border-top-right-radius: var(--radius-md);
}

td {
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}

/* Table number cells */
td.num {
  font-family: var(--font-mono);
  text-align: right;
}

/* Hoverable rows */
tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: var(--bg-tertiary);
}

/* Clickable rows */
tbody tr.clickable {
  cursor: pointer;
}

/* Alternating rows - optional */
.table-striped tbody tr:nth-child(even) {
  background-color: var(--bg-tertiary);
}

/* ==========================================================================
   10. TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-tooltip);
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 320px;
  max-width: 420px;
  padding: var(--space-4);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

.toast--success {
  border-color: rgba(22, 199, 132, 0.4);
  background: linear-gradient(140deg, rgba(22, 199, 132, 0.13), var(--bg-secondary) 45%);
}

.toast--error {
  border-color: rgba(234, 57, 67, 0.45);
  background: linear-gradient(140deg, rgba(234, 57, 67, 0.14), var(--bg-secondary) 45%);
}

.toast--warning {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(140deg, rgba(251, 191, 36, 0.16), var(--bg-secondary) 45%);
}

.toast--info {
  border-color: rgba(59, 130, 246, 0.45);
  background: linear-gradient(140deg, rgba(59, 130, 246, 0.14), var(--bg-secondary) 45%);
}

.toast--exit {
  animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
}

.toast-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-buy);
  margin-top: 1px;
}

.toast--success .toast-icon,
.toast--success .toast-title {
  color: var(--color-buy);
}

.toast--error .toast-icon,
.toast--error .toast-title {
  color: var(--color-sell);
}

.toast--warning .toast-icon,
.toast--warning .toast-title {
  color: var(--color-neutral);
}

.toast--info .toast-icon,
.toast--info .toast-title {
  color: var(--accent-primary);
}

.toast-body {
  min-width: 0;
}

.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
}

.toast-description {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: var(--leading-normal);
}

.toast-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

/* Auto-dismiss progress bar */
.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background-color: var(--accent-primary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  animation: toastTimer 5s linear forwards;
}

.toast--success::after {
  background-color: var(--color-buy);
}

.toast--error::after {
  background-color: var(--color-sell);
}

.toast--warning::after {
  background-color: var(--color-neutral);
}

.toast--info::after {
  background-color: var(--accent-primary);
}

@keyframes toastTimer {
  from { width: 100%; }
  to   { width: 0%; }
}

@media (max-width: 480px) {
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
  }
  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

/* ==========================================================================
   11. TRADE PAGE STYLES
   ========================================================================== */

/* Trade page layout - Professional exchange grid */
.trade-layout {
  display: grid;
  grid-template-columns: 1fr 320px 340px;
  grid-template-rows: auto 1fr;
  gap: var(--space-4);
  min-height: calc(100vh - 100px);
}

/* Market header */
.trade-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-4) var(--space-5);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}

.trade-header .symbol-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.trade-header .symbol-name {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.trade-header .symbol-price {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.trade-header .price-change {
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-sm);
}

.trade-header .price-change.positive {
  color: var(--color-buy);
  background-color: var(--color-buy-subtle);
}

.trade-header .price-change.negative {
  color: var(--color-sell);
  background-color: var(--color-sell-subtle);
}

.trade-header .stat-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.trade-header .stat-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.trade-header .stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

/* Symbol header - simplified for current template */
.heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-4) var(--space-5);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
}

.heading .symbol-name {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.heading .symbol-price {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.heading .symbol-price.price-up-tick {
  color: var(--color-buy);
}

.heading .symbol-price.price-down-tick {
  color: var(--color-sell);
}

.heading .price-change {
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-sm);
}

.heading .price-change.positive {
  color: var(--color-buy);
  background-color: var(--color-buy-subtle);
}

.heading .price-change.negative {
  color: var(--color-sell);
  background-color: var(--color-sell-subtle);
}

.heading h1:first-child {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.heading h1:last-child {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

/* Chart container */
.tradingview-widget-container {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 0;
}

.tradingview-widget-container__widget {
  height: 100%;
}

.tradingview-widget-copyright {
  display: none;
}

/* Orderbook & Trades - Middle column */
.market-data {
  grid-column: 2 / 3;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}

/* Orderbook */
.orderbook {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.orderbook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-primary);
}

.orderbook-header h3 {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.orderbook-cols {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  border-bottom: 1px solid var(--border-subtle);
}

.orderbook-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  position: relative;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.orderbook-row:hover {
  background-color: var(--bg-tertiary);
}

.orderbook-row .price {
  font-weight: var(--font-medium);
}

.orderbook-row.ask .price { color: var(--color-sell); }
.orderbook-row.bid .price { color: var(--color-buy); }

.orderbook-row .size,
.orderbook-row .total {
  color: var(--text-secondary);
}

.orderbook-row .depth-bar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  opacity: 0.15;
}

.orderbook-row.ask .depth-bar { background-color: var(--color-sell); }
.orderbook-row.bid .depth-bar { background-color: var(--color-buy); }

.orderbook-spread {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  background-color: var(--bg-tertiary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.orderbook-spread .spread-value {
  font-family: var(--font-mono);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.orderbook-asks,
.orderbook-bids {
  min-height: 0;
  overflow: hidden;
}

.orderbook-asks::-webkit-scrollbar,
.orderbook-bids::-webkit-scrollbar,
.trades-list::-webkit-scrollbar,
.trade-panel-body::-webkit-scrollbar {
  width: 8px;
}

.orderbook-asks::-webkit-scrollbar-thumb,
.orderbook-bids::-webkit-scrollbar-thumb,
.trades-list::-webkit-scrollbar-thumb,
.trade-panel-body::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 999px;
}

/* Recent trades */
.recent-trades {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.recent-trades-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-primary);
}

.recent-trades-header h3 {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.trades-cols {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  border-bottom: 1px solid var(--border-subtle);
}

.trades-list {
  overflow: hidden;
}

.trade-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-1) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.trade-row .price.buy { color: var(--color-buy); }
.trade-row .price.sell { color: var(--color-sell); }

.trade-row .size { color: var(--text-secondary); }
.trade-row .time { color: var(--text-muted); }

/* ==========================================================================
   12. TRADE PANEL (Order Form)
   ========================================================================== */

.trade-panel {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.trade-panel-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-primary);
}

/* Order type toggle - Buy/Sell switch */
.order-type-toggle {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-1);
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.toggle-btn {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  background-color: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.toggle-btn:hover {
  color: var(--text-secondary);
  background-color: var(--bg-elevated);
}

.trade-panel-body {
  flex: 1;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  overflow-y: auto;
}

.trade-panel-actions {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding-top: var(--space-3);
  background: linear-gradient(to bottom, rgba(17, 22, 29, 0), var(--bg-secondary) 30%);
  z-index: 2;
}

@media (min-width: 1201px) {
  .market-data,
  .trade-panel,
  .tradingview-widget-container {
    height: calc(100vh - 200px);
    min-height: 640px;
  }

  .orderbook {
    height: 420px;
  }

  .recent-trades {
    min-height: 220px;
  }
}

/* Order type selector - Limit/Market */
.order-type-selector {
  display: flex;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.radio-option input[type="radio"] {
  width: 16px;
  height: 16px;
}

.radio-option span {
  transition: color var(--transition-fast);
}

.radio-option input:checked + span {
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

/* Margin info display */
.margin-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.margin-info .label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.margin-info .value {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

/* Input group */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-group label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: 0;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  padding-right: 60px;
}

.input-suffix {
  position: absolute;
  right: var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  pointer-events: none;
}

/* Percentage buttons */
.percentage-buttons {
  display: flex;
  gap: var(--space-2);
}

.percent-btn {
  flex: 1;
  padding: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.percent-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-secondary);
  background-color: var(--bg-elevated);
}

.percent-btn.active {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background-color: var(--accent-primary-muted);
}

/* Total display */
.total-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
}

.total-info .label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.total-info .value {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

/* Action buttons */
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 0;
}

.action-btn.buy-btn {
  color: #fff;
  background-color: var(--color-buy);
}

.action-btn.buy-btn:hover {
  background-color: var(--color-buy-hover);
}

.action-btn.sell-btn {
  color: #fff;
  background-color: var(--color-sell);
}

.action-btn.sell-btn:hover {
  background-color: var(--color-sell-hover);
}

.action-btn.add-funds-btn {
  color: var(--bg-primary);
  background-color: var(--accent-primary);
  text-decoration: none;
}

.action-btn.add-funds-btn:hover {
  background-color: var(--accent-primary-hover);
}

/* Trade history link */
.trade-history-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-decoration: none;
  border-top: 1px solid var(--border-primary);
  transition: all var(--transition-fast);
}

.trade-history-link:hover {
  color: var(--accent-primary);
  background-color: var(--bg-tertiary);
}

.trade-history-link::after {
  content: '→';
}

/* ==========================================================================
   13. MARKETS PAGE — Financial Table
   ========================================================================== */

.markets-container {
  max-width: 1200px;
  margin: 0 auto;
}

.markets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.markets-header h1 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

.markets-search {
  position: relative;
  width: 280px;
}

.markets-search input {
  padding-left: 40px;
}

.markets-search::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2371717a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
}

/* --- Financial Table Container --- */
.ft-table {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* --- Grid Layout --- */
.ft-header,
.ft-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(100px, 1fr) minmax(120px, 1fr) minmax(100px, 1fr) 80px;
  column-gap: var(--space-2);
  padding: 0 var(--space-6);
  align-items: center;
}

/* --- Header Row --- */
.ft-header {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  background-color: rgba(232, 236, 242, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

/* --- Data Row --- */
.ft-row {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  animation: ftRowIn 0.4s ease-out both;
}

.ft-row:last-child {
  border-bottom: none;
}

.ft-row:hover {
  background-color: rgba(232, 236, 242, 0.04);
}

/* Staggered entrance animation */
@keyframes ftRowIn {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* --- Column Cells --- */
.ft-col {
  display: flex;
  align-items: center;
  min-width: 0;
}

.ft-col-market {
  gap: var(--space-3);
}

.ft-col-action {
  justify-content: flex-end;
}

/* --- Symbol Icon --- */
.ft-symbol-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary-muted), rgba(96, 165, 250, 0.15));
  border: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--accent-primary);
  flex-shrink: 0;
}

.ft-symbol-info {
  min-width: 0;
}

.ft-symbol-name {
  font-weight: var(--font-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ft-symbol-ticker {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* --- Price --- */
.ft-price {
  font-family: var(--font-mono);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

/* --- Change Badge (pill) --- */
.ft-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border: 1px solid transparent;
  line-height: 1.4;
}

.ft-badge--positive {
  color: var(--color-buy);
  background-color: var(--color-buy-subtle);
  border-color: rgba(22, 199, 132, 0.25);
}

.ft-badge--negative {
  color: var(--color-sell);
  background-color: var(--color-sell-subtle);
  border-color: rgba(234, 57, 67, 0.25);
}

/* --- Volume --- */
.ft-value {
  font-family: var(--font-mono);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

/* --- Trade Button (row action) --- */
.ft-trade-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
}

.ft-row:hover .ft-trade-btn {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent-primary);
}

/* --- Price Flash (reused from before) --- */
.price-flash-up {
  animation: flashGreen 0.6s ease-out;
}

.price-flash-down {
  animation: flashRed 0.6s ease-out;
}

@keyframes flashGreen {
  0% {
    background-color: var(--color-buy-muted);
    color: var(--color-buy);
    transform: scale(1.05);
  }
  100% {
    background-color: transparent;
    color: var(--text-primary);
    transform: scale(1);
  }
}

@keyframes flashRed {
  0% {
    background-color: var(--color-sell-muted);
    color: var(--color-sell);
    transform: scale(1.05);
  }
  100% {
    background-color: transparent;
    color: var(--text-primary);
    transform: scale(1);
  }
}

/* --- Filter Tabs --- */
.market-filters {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.filter-tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-secondary);
}

.filter-tab.active {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  border-color: var(--border-primary);
}

/* --- Empty State --- */
.empty-state {
  padding: var(--space-16) var(--space-8);
  text-align: center;
}

.empty-state p {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
}

/* --- Responsive: Horizontal scroll on small screens --- */
@media (max-width: 768px) {
  .ft-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ft-header,
  .ft-row {
    min-width: 640px;
  }

  .markets-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .markets-search {
    width: 100%;
  }
}

/* ==========================================================================
   14. AUTH PAGES (Login/Signup) — Modern Animated Design
   ========================================================================== */

/* --- Layout --- */
.auth-container {
  display: flex;
  min-height: calc(100vh - 140px);
  align-items: center;
  justify-content: center;
}

.auth-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 1060px;
  min-height: 640px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* --- Left Side: Visual with Ripple + Orbits --- */
.auth-visual {
  position: relative;
  background: #0A0D12;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Ambient color glow behind ripples */
.auth-visual::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(96, 165, 250, 0.06) 50%, transparent 70%);
  animation: ambient-glow 6s ease-in-out infinite alternate;
}

.auth-visual::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  top: 60%;
  left: 30%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.10) 0%, rgba(52, 211, 153, 0.05) 50%, transparent 70%);
  animation: ambient-glow 8s ease-in-out 2s infinite alternate;
}

@keyframes ambient-glow {
  0%   { transform: scale(1) translate(0, 0); opacity: 0.6; }
  100% { transform: scale(1.3) translate(10px, -10px); opacity: 1; }
}

/* Ripple rings */
.auth-ripple {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ripple-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.08);
  animation: auth-ripple 3s ease infinite;
}

.ripple-circle:nth-child(1) { width: 120px; height: 120px; animation-delay: 0s; border-color: rgba(59, 130, 246, 0.12); }
.ripple-circle:nth-child(2) { width: 190px; height: 190px; animation-delay: 0.12s; border-color: rgba(96, 165, 250, 0.10); }
.ripple-circle:nth-child(3) { width: 260px; height: 260px; animation-delay: 0.24s; border-color: rgba(59, 130, 246, 0.08); }
.ripple-circle:nth-child(4) { width: 330px; height: 330px; animation-delay: 0.36s; border-color: rgba(59, 130, 246, 0.07); }
.ripple-circle:nth-child(5) { width: 400px; height: 400px; animation-delay: 0.48s; border-style: dashed; border-color: rgba(52, 211, 153, 0.06); }
.ripple-circle:nth-child(6) { width: 470px; height: 470px; animation-delay: 0.60s; border-color: rgba(59, 130, 246, 0.05); }
.ripple-circle:nth-child(7) { width: 540px; height: 540px; animation-delay: 0.72s; border-style: dashed; border-color: rgba(96, 165, 250, 0.04); }

@keyframes auth-ripple {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(0.92); opacity: 0.25; }
}

/* Orbiting icons */
.auth-orbit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.orbit-ring.orbit-ring-1 {
  animation: auth-orbit 20s linear infinite;
}
.orbit-ring.orbit-ring-2 {
  animation: auth-orbit 25s linear infinite reverse;
}
.orbit-ring.orbit-ring-3 {
  animation: auth-orbit 30s linear infinite;
}
.orbit-ring.orbit-reverse {
  animation-direction: reverse;
  animation-duration: 22s;
}

.orbit-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.1);
}

.orbit-ring-1 .orbit-icon { top: 15%; left: 50%; transform: translate(-50%, -50%); }
.orbit-ring-2 .orbit-icon { bottom: 20%; right: 10%; }
.orbit-ring-3 .orbit-icon { top: 50%; left: 8%; transform: translateY(-50%); }
.orbit-reverse .orbit-icon { bottom: 12%; left: 25%; }

@keyframes auth-orbit {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Center brand text */
.auth-visual-text {
  position: relative;
  z-index: 1;
  pointer-events: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.auth-brand-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.auth-brand-text {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-tight);
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 40%, #60A5FA 70%, #60A5FA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.2));
}

/* --- Right Side: Form --- */
.auth-form-section {
  padding: var(--space-10) var(--space-10);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

.auth-form-header {
  margin-bottom: var(--space-6);
}

.auth-form-header h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.auth-form-header p {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* --- Box Reveal Animation --- */
.box-reveal {
  position: relative;
  overflow: hidden;
  width: fit-content;
}

.auth-form .box-reveal,
.auth-form-section > .box-reveal {
  width: 100%;
}

.box-reveal > * {
  animation: box-reveal-content 0.5s ease forwards;
  animation-delay: 0.25s;
  opacity: 0;
  transform: translateY(20px);
}

.box-reveal::after {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  right: 100%;
  background: var(--accent-primary);
  border-radius: 3px;
  z-index: 20;
  animation: box-reveal-slide 0.5s ease forwards;
  animation-delay: 0.1s;
}

.box-reveal-delay-1 > * { animation-delay: 0.4s; }
.box-reveal-delay-1::after { animation-delay: 0.25s; }
.box-reveal-delay-2 > * { animation-delay: 0.55s; }
.box-reveal-delay-2::after { animation-delay: 0.4s; }
.box-reveal-delay-3 > * { animation-delay: 0.7s; }
.box-reveal-delay-3::after { animation-delay: 0.55s; }
.box-reveal-delay-4 > * { animation-delay: 0.85s; }
.box-reveal-delay-4::after { animation-delay: 0.7s; }

@keyframes box-reveal-content {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes box-reveal-slide {
  0%   { left: 0; right: 100%; }
  50%  { left: 0; right: 0; }
  100% { left: 100%; right: 0; }
}

/* --- Auth Form Styles --- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.auth-field label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  line-height: 1;
}

.required-star {
  color: var(--color-sell);
}

/* Glowing input wrapper */
.auth-input-wrap {
  border-radius: var(--radius-lg);
  padding: 2px;
  transition: all 300ms ease;
  background: transparent;
}

.auth-input-wrap:hover {
  background: radial-gradient(
    100px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    var(--accent-primary),
    transparent 80%
  );
}

.auth-input-wrap input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: #11161D;
  border: none;
  border-radius: calc(var(--radius-lg) - 1px);
  transition: all 200ms ease;
  box-shadow: 0px 0px 0px 1px #242C3A;
}

.auth-input-wrap input::placeholder {
  color: var(--text-muted);
}

.auth-input-wrap input:focus {
  outline: none;
  box-shadow: 0px 0px 0px 2px rgba(59, 130, 246, 0.4),
              0 0 12px rgba(59, 130, 246, 0.08);
  background-color: #161C26;
}

/* Field error */
.auth-field-error {
  font-size: var(--text-xs);
  color: var(--color-sell);
  min-height: 1em;
}

/* Error banner for non-field errors */
.auth-error-banner {
  background-color: var(--color-sell-muted);
  color: var(--color-sell);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

/* --- Animated Submit Button --- */
.auth-submit-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: #0A0D12;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  overflow: hidden;
  transition: all 200ms ease;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.2);
}

.auth-submit-btn:hover {
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

/* Bottom gradient line on hover */
.btn-gradient-bottom {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, #60A5FA, transparent);
  opacity: 0;
  transition: opacity 500ms;
}

.auth-submit-btn:hover .btn-gradient-bottom {
  opacity: 1;
}

/* Inner glow on hover */
.btn-gradient-glow {
  position: absolute;
  bottom: -1px;
  left: 25%;
  right: 25%;
  height: 2px;
  background: linear-gradient(to right, transparent, #3B82F6, transparent);
  filter: blur(6px);
  opacity: 0;
  transition: opacity 500ms;
}

.auth-submit-btn:hover .btn-gradient-glow {
  opacity: 1;
}

/* --- Auth Footer --- */
.auth-footer {
  margin-top: var(--space-6);
  text-align: center;
}

.auth-footer p {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.auth-footer a {
  color: var(--accent-primary);
  font-weight: var(--font-medium);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .auth-visual {
    display: none;
  }

  .auth-form-section {
    padding: var(--space-8) var(--space-6);
    max-width: 100%;
  }
}

/* Fallback for pages without the wrapper */
form:not(.auth-form):not(.header-logout-form) {
  max-width: 400px;
  margin: 0 auto;
  padding: var(--space-8);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}

form:not(.auth-form):not(.header-logout-form) > div {
  margin-bottom: var(--space-4);
}

/* ==========================================================================
   15. WALLET PAGE
   ========================================================================== */

.wallet-container {
  max-width: 800px;
  margin: 0 auto;
}

.wallet-header {
  margin-bottom: var(--space-8);
}

.wallet-header h1 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-2);
}

.wallet-header p {
  color: var(--text-tertiary);
}

/* Balance overview cards */
.balance-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.balance-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--transition-fast);
}

.balance-card:hover {
  border-color: var(--border-secondary);
}

.balance-card.primary {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-color: var(--accent-primary);
}

.balance-card .label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-2);
}

.balance-card .amount {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.balance-card .currency {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-left: var(--space-2);
}

.balance-card.locked .amount {
  color: var(--color-neutral);
}

/* Wallet actions */
.wallet-actions {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.wallet-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  font-weight: var(--font-medium);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.wallet-action-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

.wallet-action-btn.primary {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--bg-primary);
}

.wallet-action-btn.primary:hover {
  background-color: var(--accent-primary-hover);
}

.wallet-action-btn.withdraw {
  background-color: var(--color-sell-muted);
  border-color: var(--color-sell);
  color: var(--color-sell);
}

.wallet-action-btn.withdraw:hover {
  background-color: var(--color-sell-subtle);
  border-color: var(--color-sell-hover);
}

/* ==========================================================================
   16. ACCOUNT PAGE
   ========================================================================== */

.account-container {
  max-width: 600px;
  margin: 0 auto;
}

.account-header {
  margin-bottom: var(--space-8);
}

.account-header h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

.account-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.account-card table {
  margin: 0;
}

.account-card th {
  width: 140px;
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  background-color: transparent;
  border-bottom: 1px solid var(--border-subtle);
  text-transform: none;
  letter-spacing: normal;
}

.account-card th:last-child {
  width: auto;
  color: var(--text-primary);
  font-weight: var(--font-normal);
}

.account-card tr:last-child th {
  border-bottom: none;
}

.account-actions {
  margin-top: var(--space-6);
}

/* Password change form */
.password-form {
  max-width: 400px;
}

.password-form h2 {
  margin-bottom: var(--space-6);
}

/* ==========================================================================
   17. UTILITY CLASSES
   ========================================================================== */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* Gap */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Margin */
.m-0 { margin: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Padding */
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* Text */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }
.text-buy { color: var(--color-buy); }
.text-sell { color: var(--color-sell); }
.text-accent { color: var(--accent-primary); }

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Border radius */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* Transitions */
.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* ==========================================================================
   18. RESPONSIVE DESIGN
   ========================================================================== */

/* Large screens (desktops) */
@media (max-width: 1400px) {
  .trade-layout {
    grid-template-columns: 1fr 280px 320px;
  }
}

/* Medium screens (tablets) */
@media (max-width: 1200px) {
  .trade-layout {
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto auto auto;
  }
  
  .tradingview-widget-container {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
  }
  
  .trade-panel {
    grid-column: 2 / 3;
    grid-row: 2 / 4;
  }
  
  .market-data {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
    flex-direction: row;
  }
  
  .auth-wrapper {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  
  .auth-visual {
    display: none;
  }
  
  .balance-cards {
    grid-template-columns: 1fr;
  }
}

/* Small screens (mobile) */
@media (max-width: 768px) {
  :root {
    --space-6: 1rem;
    --space-8: 1.5rem;
  }
  
  main {
    padding: var(--space-4);
  }
  
  .header-container {
    padding: 0 var(--space-4);
    min-height: 56px;
  }
  
  .header-brand-link {
    font-size: var(--text-base);
  }
  
  .trade-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    gap: var(--space-3);
  }
  
  .heading {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
  
  .tradingview-widget-container {
    grid-column: 1;
    grid-row: 2;
    min-height: 350px;
  }
  
  .trade-panel {
    grid-column: 1;
    grid-row: 3;
    height: auto;
  }
  
  .market-data {
    grid-column: 1;
    grid-row: 4;
    flex-direction: column;
    height: auto;
  }
  
  .markets-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }
  
  .markets-search {
    width: 100%;
  }
  
  .wallet-actions {
    flex-direction: column;
  }
  
  form:not(.auth-form) {
    padding: var(--space-5);
  }
  
  table {
    font-size: var(--text-xs);
  }
  
  th, td {
    padding: var(--space-2) var(--space-3);
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .percentage-buttons {
    flex-wrap: wrap;
  }
  
  .percent-btn {
    flex: 1 1 calc(50% - var(--space-1));
  }
  
  .order-type-selector {
    flex-direction: column;
    gap: var(--space-2);
  }

  .radio-option {
    min-height: unset;
  }
}

/* ==========================================================================
   19. ANIMATIONS
   ========================================================================== */

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* Slide up */
@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out;
}

/* Slide in from left */
@keyframes slideInLeft {
  from { 
    opacity: 0;
    transform: translateX(-20px);
  }
  to { 
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-left {
  animation: slideInLeft 0.4s ease-out;
}

/* Scale in */
@keyframes scaleIn {
  from { 
    opacity: 0;
    transform: scale(0.95);
  }
  to { 
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-in {
  animation: scaleIn 0.3s ease-out;
}

/* Pulse - for price updates */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

.animate-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Glow pulse - for active elements */
@keyframes glowPulse {
  0%, 100% { 
    box-shadow: 0 0 5px rgba(20, 184, 166, 0.3);
  }
  50% { 
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.6);
  }
}

.animate-glow {
  animation: glowPulse 2s ease-in-out infinite;
}

/* Price flash animations */
@keyframes flashGreen {
  0% { background-color: var(--color-buy-muted); }
  100% { background-color: transparent; }
}

@keyframes flashRed {
  0% { background-color: var(--color-sell-muted); }
  100% { background-color: transparent; }
}

.flash-green {
  animation: flashGreen 0.5s ease-out;
}

.flash-red {
  animation: flashRed 0.5s ease-out;
}

/* Shimmer loading effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-elevated) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Bounce */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.animate-bounce {
  animation: bounce 0.6s ease-in-out;
}

/* ==========================================================================
   ZARABA VAULT LOADER
   Brand-centric page transition — Z stroke draw, orbital rings, glow pulse
   ========================================================================== */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  background: radial-gradient(ellipse at center, rgba(22, 28, 38, 0.97), rgba(10, 13, 18, 0.99) 70%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.page-loader.is-active {
  display: flex;
}

/* --- Core container (logo + rings) --- */
.loader-core {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Orbital rings --- */
.loader-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: rgba(59, 130, 246, 0.7);
  border-right-color: rgba(59, 130, 246, 0.15);
  animation: loader-spin 2s linear infinite;
  will-change: transform;
}

.loader-orbit--inner {
  inset: 10px;
  border-top-color: rgba(59, 130, 246, 0.6);
  border-right-color: rgba(59, 130, 246, 0.12);
  border-left-color: transparent;
  border-bottom-color: transparent;
  animation: loader-spin 3s linear infinite reverse;
}

/* --- Z Logo SVG --- */
.loader-logo {
  width: 56px;
  height: 56px;
  z-index: 2;
  filter: drop-shadow(0 0 14px rgba(59, 130, 246, 0.35));
}

.loader-logo__base {
  opacity: 1;
}

.loader-logo__z {
  stroke-dasharray: 185;
  stroke-dashoffset: 185;
  animation: z-stream 2.2s ease-in-out infinite;
}

/* --- Glow pulse behind logo --- */
.loader-glow {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
  animation: loader-glow-pulse 2.5s ease-in-out infinite;
  z-index: 1;
}

/* --- Keyframes --- */
@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

@keyframes z-stream {
  0%   { stroke-dashoffset: 185; }
  40%  { stroke-dashoffset: 0; }
  60%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -185; }
}

@keyframes loader-glow-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.25; }
  50%      { transform: scale(1.5); opacity: 0.06; }
}

/* Entry animations for page elements */
.card {
  animation: slideUp 0.4s ease-out;
}

.markets-table {
  animation: fadeIn 0.5s ease-out;
}

.balance-cards .balance-card {
  animation: scaleIn 0.4s ease-out backwards;
}

.balance-cards .balance-card:nth-child(1) { animation-delay: 0.1s; }
.balance-cards .balance-card:nth-child(2) { animation-delay: 0.2s; }
.balance-cards .balance-card:nth-child(3) { animation-delay: 0.3s; }

/* Trade panel mode transitions */
.trade-panel {
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.trade-panel.buy-mode {
  border-color: var(--color-buy);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.15), inset 0 1px 0 rgba(34, 197, 94, 0.1);
}

.trade-panel.sell-mode {
  border-color: var(--color-sell);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15), inset 0 1px 0 rgba(239, 68, 68, 0.1);
}

/* Toggle button transition */
.toggle-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.toggle-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.toggle-btn:active::after {
  width: 200px;
  height: 200px;
}

.toggle-btn.active[data-side="buy"] {
  color: #fff;
  background-color: var(--color-buy);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  transform: scale(1.02);
}

.toggle-btn.active[data-side="sell"] {
  color: #fff;
  background-color: var(--color-sell);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  transform: scale(1.02);
}

/* Action button animations */
.action-btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.action-btn:hover::before {
  left: 100%;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.action-btn:active {
  transform: translateY(0);
}

/* Percent button animations */
.percent-btn {
  transition: all 0.2s ease;
}

.percent-btn:hover {
  transform: translateY(-1px);
}

.percent-btn.active {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

/* Input focus animations */
input:focus,
select:focus {
  animation: scaleIn 0.2s ease-out;
}

/* Table row hover animation */
tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  transform: translateX(4px);
  background-color: var(--bg-tertiary);
}

/* Auth page animations */
.auth-wrapper {
  animation: scaleIn 0.5s ease-out;
}

.auth-visual-content {
  animation: slideInLeft 0.6s ease-out 0.2s backwards;
}

.auth-form-section {
  animation: slideUp 0.5s ease-out 0.1s backwards;
}



/* ==========================================================================
   20. SCROLLBAR STYLING
   ========================================================================== */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-secondary) var(--bg-tertiary);
}

/* ==========================================================================
   21. PRINT STYLES
   ========================================================================== */

/* ==========================================================================
   FUNDS PANEL STYLES (Deposit / Withdraw)
   ========================================================================== */

.funds-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* --- Tabs --- */
.funds-tabs {
  display: flex;
  background-color: var(--bg-tertiary);
  padding: var(--space-2);
  gap: var(--space-2);
  border-bottom: 1px solid var(--border-primary);
}

.funds-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.funds-tab:hover {
  color: var(--text-secondary);
  background-color: var(--bg-elevated);
}

.funds-tab.active {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  border-color: var(--border-primary);
  box-shadow: var(--shadow-sm);
}

.funds-tab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.funds-tab-icon.deposit-icon {
  color: var(--color-buy);
}

.funds-tab-icon.withdraw-icon {
  color: var(--color-sell);
}

/* --- Body / Form --- */
.funds-body {
  padding: var(--space-8) var(--space-6);
}

.funds-form {
  max-width: 480px;
  margin: 0 auto;
}

/* Balance strip (withdraw only) */
.funds-balance-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-6);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.funds-balance-strip span:last-child {
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

/* Amount section */
.funds-amount-section {
  margin-bottom: var(--space-4);
}

.funds-amount-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.funds-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.funds-currency-badge {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--accent-primary);
  background-color: var(--accent-primary-muted);
  padding: var(--space-1) var(--space-3);
  border-radius: 9999px;
  letter-spacing: var(--tracking-wide);
}

/* Input box */
.funds-input-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-1) var(--space-4);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.funds-input-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-muted);
}

.funds-dollar {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  margin-right: var(--space-1);
  user-select: none;
}

.funds-amount-input {
  flex: 1;
  background: none;
  border: none;
  padding: var(--space-3) 0;
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  outline: none;
  min-width: 0;
}

.funds-amount-input::placeholder {
  color: var(--text-muted);
  font-weight: var(--font-normal);
}

.funds-amount-input::-webkit-outer-spin-button,
.funds-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.funds-amount-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Quick amount chips */
.funds-quick-amounts {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.funds-chip {
  flex: 1;
  padding: var(--space-2) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  background-color: transparent;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.funds-chip:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

.funds-chip-max {
  color: var(--accent-primary);
  border-color: var(--accent-primary-muted);
}

.funds-chip-max:hover {
  background-color: var(--accent-primary-muted);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Submit buttons — Slide to confirm */
.slide-btn {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 3.25rem;
  border-radius: 9999px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: default;
}

/* Inset track */
.slide-btn__track {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}

.slide-btn--deposit .slide-btn__track {
  background-color: rgba(22, 199, 132, 0.10);
  border: 1px solid rgba(22, 199, 132, 0.15);
}

.slide-btn--withdraw .slide-btn__track {
  background-color: rgba(234, 57, 67, 0.10);
  border: 1px solid rgba(234, 57, 67, 0.15);
}

/* Progress fill that follows the thumb */
.slide-btn__fill {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  width: 0;
  transition: none;
}

.slide-btn--deposit .slide-btn__fill {
  background: linear-gradient(90deg, rgba(22, 199, 132, 0.25), rgba(22, 199, 132, 0.08));
}

.slide-btn--withdraw .slide-btn__fill {
  background: linear-gradient(90deg, rgba(234, 57, 67, 0.25), rgba(234, 57, 67, 0.08));
}

/* Spring-back on the fill */
.slide-btn__fill.animate-back {
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Label text */
.slide-btn__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: var(--tracking-wide);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.slide-btn--deposit .slide-btn__label {
  color: var(--color-buy);
}

.slide-btn--withdraw .slide-btn__label {
  color: var(--color-sell);
}

/* Chevron hint animation */
.slide-btn__chevrons {
  display: inline-flex;
  gap: 0;
  margin-left: var(--space-2);
  animation: chevron-pulse 1.5s ease-in-out infinite;
}

.slide-btn__chevrons svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.slide-btn__chevrons svg:nth-child(2) { opacity: 0.4; margin-left: -6px; }
.slide-btn__chevrons svg:nth-child(3) { opacity: 0.2; margin-left: -6px; }

@keyframes chevron-pulse {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(4px); opacity: 0.6; }
}

/* Draggable thumb */
.slide-btn__thumb {
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: grab;
  transition: box-shadow var(--transition-fast), transform 0s;
  will-change: transform;
}

.slide-btn__thumb:active {
  cursor: grabbing;
}

.slide-btn__thumb.animate-back {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow var(--transition-fast);
}

.slide-btn--deposit .slide-btn__thumb {
  background: var(--color-buy);
  box-shadow: 0 2px 12px rgba(22, 199, 132, 0.4);
}

.slide-btn--deposit .slide-btn__thumb:hover {
  box-shadow: 0 2px 18px rgba(22, 199, 132, 0.6);
}

.slide-btn--withdraw .slide-btn__thumb {
  background: var(--color-sell);
  box-shadow: 0 2px 12px rgba(234, 57, 67, 0.4);
}

.slide-btn--withdraw .slide-btn__thumb:hover {
  box-shadow: 0 2px 18px rgba(234, 57, 67, 0.6);
}

.slide-btn__thumb svg {
  width: 18px;
  height: 18px;
  color: var(--bg-primary);
  flex-shrink: 0;
  pointer-events: none;
}

/* Completed state — collapses to status icon */
.slide-btn.is-completed .slide-btn__thumb,
.slide-btn.is-completed .slide-btn__label,
.slide-btn.is-completed .slide-btn__fill {
  display: none;
}

.slide-btn__status {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  color: var(--bg-primary);
  animation: status-fade-in 0.3s ease;
}

.slide-btn.is-completed .slide-btn__status {
  display: flex;
}

.slide-btn--deposit .slide-btn__status { background: var(--color-buy); }
.slide-btn--withdraw .slide-btn__status { background: var(--color-sell); }

.slide-btn__status svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  pointer-events: none;
}

.slide-btn__status .spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes status-fade-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.funds-fine-print {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-3);
  text-align: center;
}

@media (max-width: 768px) {
  .funds-body {
    padding: var(--space-6) var(--space-4);
  }
  .funds-quick-amounts {
    flex-wrap: wrap;
  }
  .funds-chip {
    min-width: calc(33% - var(--space-2));
  }
}

/* Legacy deposit form compat */
.deposit-form {
  max-width: 600px;
}

.form-row {
  display: flex;
  gap: var(--space-4);
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group-inline {
  flex: 1;
  min-width: 250px;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-3);
  margin-bottom: 0;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* Smooth scroll for anchor links */
html {
  scroll-behavior: smooth;
}

#funds-section:target {
  animation: highlight 1s ease;
}

@keyframes highlight {
  0% {
    box-shadow: 0 0 0 4px var(--accent-primary-muted);
  }
  100% {
    box-shadow: 0 0 0 0 var(--accent-primary-muted);
  }
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-content {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: var(--z-modal);
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-primary);
}

.modal-header h2 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-6);
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: var(--bg-tertiary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.btn {
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #0A0D12;
}

.btn-primary:hover {
  color: #0A0D12;
  background-color: var(--accent-primary-hover);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-secondary);
}

.btn-secondary:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

/* ==========================================================================
   BACKGROUND PATTERNS
   Dot, grid, stripe, and other subtle background patterns
   ========================================================================== */

/* Base pattern layer — positioned behind all content */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: -10;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --- Pattern variants --- */
.bg-pattern--dots {
  background-image: radial-gradient(rgba(232, 236, 242, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bg-pattern--grid {
  background-image:
    linear-gradient(to right, rgba(232, 236, 242, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(232, 236, 242, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bg-pattern--diagonal-stripes {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(232, 236, 242, 0.07),
    rgba(232, 236, 242, 0.07) 1px,
    transparent 1px,
    transparent 24px
  );
}

.bg-pattern--horizontal-lines {
  background-image: linear-gradient(to bottom, rgba(232, 236, 242, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bg-pattern--vertical-lines {
  background-image: linear-gradient(to right, rgba(232, 236, 242, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

.bg-pattern--checkerboard {
  background-image:
    linear-gradient(45deg, rgba(232, 236, 242, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(232, 236, 242, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(232, 236, 242, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(232, 236, 242, 0.06) 75%);
  background-size: 24px 24px;
}

/* --- Mask variants (fade effects) --- */
.bg-pattern--mask-fade-edges {
  -webkit-mask-image: radial-gradient(ellipse at center, var(--bg-primary), transparent);
  mask-image: radial-gradient(ellipse at center, var(--bg-primary), transparent);
}

.bg-pattern--mask-fade-center {
  -webkit-mask-image: radial-gradient(ellipse at center, transparent, var(--bg-primary));
  mask-image: radial-gradient(ellipse at center, transparent, var(--bg-primary));
}

.bg-pattern--mask-fade-top {
  -webkit-mask-image: linear-gradient(to bottom, transparent, var(--bg-primary));
  mask-image: linear-gradient(to bottom, transparent, var(--bg-primary));
}

.bg-pattern--mask-fade-bottom {
  -webkit-mask-image: linear-gradient(to bottom, var(--bg-primary), transparent);
  mask-image: linear-gradient(to bottom, var(--bg-primary), transparent);
}

.bg-pattern--mask-fade-left {
  -webkit-mask-image: linear-gradient(to right, transparent, var(--bg-primary));
  mask-image: linear-gradient(to right, transparent, var(--bg-primary));
}

.bg-pattern--mask-fade-right {
  -webkit-mask-image: linear-gradient(to right, var(--bg-primary), transparent);
  mask-image: linear-gradient(to right, var(--bg-primary), transparent);
}

.bg-pattern--mask-fade-x {
  -webkit-mask-image: linear-gradient(to right, transparent, var(--bg-primary), transparent);
  mask-image: linear-gradient(to right, transparent, var(--bg-primary), transparent);
}

.bg-pattern--mask-fade-y {
  -webkit-mask-image: linear-gradient(to bottom, transparent, var(--bg-primary), transparent);
  mask-image: linear-gradient(to bottom, transparent, var(--bg-primary), transparent);
}

/* ==========================================================================
   MAGNETIC BUTTON
   Spring-like magnetic hover effect — vanilla CSS/JS port of framer-motion
   ========================================================================== */

.magnetic-wrap {
  display: inline-flex;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* ==========================================================================
   NOT FOUND (404) PAGE
   Matches the 21st.dev not-found-2 component design
   ========================================================================== */

.nf-root {
  position: relative;
  display: flex;
  min-height: calc(100vh - 80px);
  width: 100%;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.nf-empty {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  text-wrap: balance;
}

@media (min-width: 768px) {
  .nf-empty {
    padding: var(--space-12);
  }
}

.nf-header {
  display: flex;
  max-width: 24rem;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.nf-title {
  font-size: clamp(6rem, 12vw, 9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  -webkit-mask-image: linear-gradient(to bottom, transparent 20%, var(--text-primary) 80%);
  mask-image: linear-gradient(to bottom, transparent 20%, var(--text-primary) 80%);
}

.nf-description {
  margin-top: -2rem;
  white-space: nowrap;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.nf-content {
  display: flex;
  width: 100%;
  max-width: 24rem;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  text-wrap: balance;
}

.nf-actions {
  display: flex;
  gap: var(--space-2);
}

.nf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  white-space: nowrap;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  padding: 0.625rem 1rem;
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  line-height: 1;
}

.nf-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.nf-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  pointer-events: none;
}

.nf-btn--primary {
  background-color: var(--accent-primary);
  color: var(--bg-primary);
}

.nf-btn--primary:hover {
  background-color: var(--accent-primary-hover);
  color: var(--bg-primary);
}

.nf-btn--outline {
  border: 1px solid var(--border-secondary);
  background-color: transparent;
  color: var(--text-primary);
}

.nf-btn--outline:hover {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

@media print {
  body {
    background: white;
    color: black;
  }
  
  .site-header,
  .trade-panel,
  .tradingview-widget-container {
    display: none;
  }
}

/* ==========================================================================
   LANDING PAGE
   Crypto exchange landing — elegant, immersive, conversion-optimized
   ========================================================================== */

/* Override main container constraints for landing page */
main:has(.landing-page) {
  max-width: none;
  padding: 0;
}

.landing-page {
  width: 100%;
  overflow-x: hidden;
}

/* ------------------------------------------------------------------
   HERO SECTION
   ------------------------------------------------------------------ */
.landing-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* Hero canvas (WebGL terrain background) */
.landing-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ---- Ripple cell grid (top band) ---- */
.landing-cells {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 22rem;
  overflow: hidden;
  z-index: 1;
  pointer-events: auto;
}

.landing-cells__base,
.landing-cells__spot {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
}

.landing-cells__base { z-index: 1; opacity: 0.35; }

.landing-cells__spot {
  z-index: 2;
  mask-image: radial-gradient(75px circle at var(--spot-x, -999px) var(--spot-y, -999px), white, transparent);
  -webkit-mask-image: radial-gradient(75px circle at var(--spot-x, -999px) var(--spot-y, -999px), white, transparent);
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}

.landing-cells__col {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.landing-cells__cell {
  width: 48px;
  height: 48px;
  box-sizing: border-box;
  border-left: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
  position: relative;
}

.landing-cells__spot .landing-cells__cell {
  border-color: var(--accent-primary);
}

.landing-cells__cell-inner {
  width: 100%;
  height: 100%;
  background-color: transparent;
  transition: background-color 0.15s ease;
}

.landing-cells__cell:hover .landing-cells__cell-inner {
  background-color: rgba(59, 130, 246, 0.10);
}

.landing-cells__cell-inner.ripple {
  animation: cell-ripple 0.6s ease-out forwards;
}

@keyframes cell-ripple {
  0%   { background-color: transparent; }
  40%  { background-color: rgba(59, 130, 246, 0.22); }
  100% { background-color: transparent; }
}

/* Soft glow following cursor */
.landing-cells__glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(203,166,247,0.06) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 3;
  left: var(--spot-x, -999px);
  top: var(--spot-y, -999px);
}

/* Gradient fade toward bottom */
.landing-cells__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 10%, var(--bg-primary) 92%);
  pointer-events: none;
  z-index: 4;
}

/* Particle typography area */
.landing-hero__particles {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 900px);
  height: 260px;
  z-index: 5;
  touch-action: none;
}

.landing-hero__particles-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Hero text content */
.landing-hero__content {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-6);
  margin-top: 160px;
  max-width: 720px;
}

.landing-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid var(--border-primary);
  background-color: rgba(22, 28, 38, 0.7);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.landing-hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-buy);
  animation: landing-pulse 2s ease-in-out infinite;
}

@keyframes landing-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.landing-hero__title {
  font-family: var(--font-sans);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-5);
}

.landing-hero__title-accent {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-sky));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero__subtitle {
  font-size: var(--text-base);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
  max-width: 520px;
  margin-bottom: var(--space-8);
}

.landing-hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

.landing-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.landing-hero__cta--outline {
  border: 1px solid var(--border-secondary);
  background-color: transparent;
  color: var(--text-primary);
}

.landing-hero__cta--outline:hover {
  background-color: var(--bg-elevated);
  border-color: var(--accent-primary-muted);
}

.landing-hero__scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  animation: landing-float 3s ease-in-out infinite;
}

@keyframes landing-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ------------------------------------------------------------------
   MARQUEE STATS BAR
   ------------------------------------------------------------------ */
.landing-marquee {
  width: 100%;
  border-top: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
  background-color: rgba(10, 13, 18, 0.85);
  backdrop-filter: blur(12px);
  overflow: hidden;
  padding: 14px 0;
}

.landing-marquee__track {
  display: flex;
  width: max-content;
  animation: landing-marquee-scroll 30s linear infinite;
}

@keyframes landing-marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.landing-marquee__track:hover {
  animation-play-state: paused;
}

.landing-marquee__content {
  display: flex;
  gap: var(--space-8);
  padding: 0 var(--space-4);
}

.landing-marquee__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  white-space: nowrap;
}

.landing-marquee__value {
  font-family: var(--font-mono);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  color: var(--accent-primary);
  letter-spacing: var(--tracking-wide);
}

.landing-marquee__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.landing-marquee__icon {
  display: inline-flex;
  color: var(--accent-primary);
  opacity: 0.6;
}

/* ------------------------------------------------------------------
   SECTION BADGE (reusable)
   ------------------------------------------------------------------ */
.landing-section-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border-primary);
  background-color: rgba(22, 28, 38, 0.6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.landing-section-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  animation: landing-pulse 2s ease-in-out infinite;
}

/* ------------------------------------------------------------------
   SCROLL REVEAL ANIMATION
   ------------------------------------------------------------------ */
.landing-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------------------------------------------
   GLOBE SECTION
   ------------------------------------------------------------------ */
.landing-globe {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
}

.landing-globe__inner {
  display: flex;
  align-items: center;
  gap: var(--space-10);
  border: 1px solid var(--border-primary);
  border-radius: 20px;
  background-color: var(--bg-secondary);
  overflow: hidden;
  position: relative;
}

/* Ambient glow */
.landing-globe__inner::before {
  content: "";
  position: absolute;
  top: 0;
  right: 25%;
  width: 384px;
  height: 384px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.04);
  filter: blur(80px);
  pointer-events: none;
}

.landing-globe__content {
  flex: 1;
  padding: var(--space-10) var(--space-8);
  position: relative;
  z-index: 1;
}

.landing-globe__title {
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-5);
}

.landing-globe__title-accent {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-sky));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-globe__desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
  max-width: 440px;
  margin-bottom: var(--space-8);
}

.landing-globe__stats {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.landing-globe__stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.landing-globe__stat-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.landing-globe__stat-divider {
  width: 1px;
  height: 40px;
  background-color: var(--border-primary);
}

.landing-globe__canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  min-height: 400px;
}

.landing-globe__canvas {
  max-width: 100%;
  height: auto;
}

/* ------------------------------------------------------------------
   FEATURES SECTION
   ------------------------------------------------------------------ */
.landing-features {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
}

.landing-features__header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.landing-features__title {
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
}

.landing-features__title-accent {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-features__subtitle {
  font-size: var(--text-base);
  color: var(--text-tertiary);
  max-width: 480px;
  margin: 0 auto;
}

.landing-features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

/* Feature Card */
.landing-feature-card {
  position: relative;
  padding: var(--space-8);
  border-radius: 16px;
  border: 1px solid var(--border-primary);
  background-color: var(--bg-secondary);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.landing-feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.landing-feature-card:hover {
  border-color: var(--border-secondary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.landing-feature-card:hover::before {
  opacity: 1;
}

.landing-feature-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: var(--space-5);
}

.landing-feature-card__icon--mauve {
  background-color: var(--accent-primary-muted);
  color: var(--accent-primary);
}

.landing-feature-card__icon--green {
  background-color: var(--color-buy-muted);
  color: var(--color-buy);
}

.landing-feature-card__icon--sky {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--accent-sky);
}

.landing-feature-card__icon--teal {
  background-color: rgba(52, 211, 153, 0.15);
  color: var(--accent-teal);
}

.landing-feature-card__icon--pink {
  background-color: rgba(244, 114, 182, 0.15);
  color: var(--accent-pink);
}

.landing-feature-card__icon--yellow {
  background-color: rgba(249, 226, 175, 0.15);
  color: var(--accent-yellow);
}

.landing-feature-card__title {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.landing-feature-card__desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
}

/* ------------------------------------------------------------------
   CTA SECTION
   ------------------------------------------------------------------ */
.landing-cta {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-6);
}

.landing-cta__bg {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: linear-gradient(135deg,
    rgba(59, 130, 246, 0.06),
    rgba(96, 165, 250, 0.04),
    rgba(59, 130, 246, 0.03)
  );
  border: 1px solid var(--border-primary);
}

.landing-cta__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-12) var(--space-8);
}

.landing-cta__title {
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-4);
}

.landing-cta__desc {
  font-size: var(--text-base);
  color: var(--text-tertiary);
  max-width: 480px;
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

.landing-cta__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

/* ------------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------------ */
.landing-footer {
  width: 100%;
  border-top: 1px solid var(--border-primary);
  background-color: var(--bg-secondary);
  margin-top: var(--space-12);
}

.landing-footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-10);
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
}

.landing-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.landing-footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.landing-footer__logo-text {
  font-family: var(--font-sans);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.landing-footer__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  max-width: 320px;
}

.landing-footer__col-title {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.landing-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.landing-footer__links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.landing-footer__links a:hover {
  color: var(--accent-primary);
}

/* Social Icons Bar */
.landing-social {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: 16px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-primary);
  position: relative;
}

.landing-social__link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.landing-social__link:hover {
  color: var(--text-primary);
  background-color: rgba(232, 236, 242, 0.08);
}

.landing-social__icon {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.landing-social__link:hover .landing-social__icon {
  transform: scale(1.1);
}

/* Tooltip */
.landing-social__tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 10px;
  border-radius: 8px;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  font-size: 11px;
  font-weight: var(--font-medium);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.landing-social__link:hover .landing-social__tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.landing-social__tooltip-arrow {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background-color: var(--text-primary);
}

/* Active indicator line */
.landing-social__link::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  height: 2px;
  border-radius: 1px;
  background-color: var(--text-primary);
  width: 0;
  opacity: 0;
  transition: all 0.3s ease;
}

.landing-social__link:hover::after {
  width: 12px;
  opacity: 1;
}

/* Footer bottom bar */
.landing-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border-primary);
}

.landing-footer__copyright {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.landing-footer__bottom-links {
  display: flex;
  gap: var(--space-5);
}

.landing-footer__bottom-links a {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.landing-footer__bottom-links a:hover {
  color: var(--text-tertiary);
}

/* ------------------------------------------------------------------
   LANDING PAGE RESPONSIVE
   ------------------------------------------------------------------ */
@media (max-width: 1024px) {
  .landing-globe__inner {
    flex-direction: column;
    text-align: center;
  }

  .landing-globe__content {
    padding: var(--space-8) var(--space-6) 0;
  }

  .landing-globe__desc {
    max-width: none;
  }

  .landing-globe__stats {
    justify-content: center;
  }

  .landing-features__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .landing-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 640px) {
  .landing-hero__particles {
    height: 180px;
    width: 95vw;
  }

  .landing-hero__content {
    margin-top: 100px;
    padding: var(--space-6) var(--space-4);
  }

  .landing-globe__canvas-wrap {
    padding: var(--space-4);
    min-height: 300px;
  }

  .landing-globe__canvas-wrap canvas {
    width: 300px !important;
    height: 300px !important;
  }

  .landing-globe__stats {
    flex-direction: column;
    gap: var(--space-4);
  }

  .landing-globe__stat-divider {
    width: 40px;
    height: 1px;
  }

  .landing-features__grid {
    grid-template-columns: 1fr;
  }

  .landing-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .landing-footer__bottom {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }

  .landing-marquee__content {
    gap: var(--space-6);
  }

  .landing-hero__scroll-hint {
    bottom: 20px;
  }
}

/* ==========================================================================
   RAINBOW BUTTON
   Animated gradient border button with glow effect
   ========================================================================== */

:root {
  --color-1: 0 100% 63%;
  --color-2: 270 100% 63%;
  --color-3: 210 100% 63%;
  --color-4: 195 100% 63%;
  --color-5: 90 100% 63%;
  --rainbow-speed: 2s;
}

@keyframes rainbow {
  0%   { background-position: 0%; }
  100% { background-position: 200%; }
}

.rainbow-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  padding: 0 32px;
  border: calc(0.08 * 1rem) solid transparent;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  letter-spacing: var(--tracking-wide);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);

  /* Triple-layer background:
     1. Solid inner fill
     2. Fade-out overlay for border blending
     3. Rainbow gradient (visible at edges through transparent border) */
  background:
    linear-gradient(var(--bg-primary), var(--bg-primary)),
    linear-gradient(var(--bg-primary) 50%, rgba(17,17,27,0.6) 80%, rgba(17,17,27,0)),
    linear-gradient(90deg,
      hsl(var(--color-1)),
      hsl(var(--color-5)),
      hsl(var(--color-3)),
      hsl(var(--color-4)),
      hsl(var(--color-2))
    );
  background-size: 200%;
  background-origin: border-box;
  background-clip: padding-box, border-box, border-box;

  animation: rainbow var(--rainbow-speed) infinite linear;
}

/* Glow underneath */
.rainbow-btn::before {
  content: "";
  position: absolute;
  bottom: -20%;
  left: 50%;
  z-index: -1;
  width: 60%;
  height: 20%;
  transform: translateX(-50%);
  background: linear-gradient(90deg,
    hsl(var(--color-1)),
    hsl(var(--color-5)),
    hsl(var(--color-3)),
    hsl(var(--color-4)),
    hsl(var(--color-2))
  );
  background-size: 200%;
  filter: blur(calc(0.8 * 1rem));
  animation: rainbow var(--rainbow-speed) infinite linear;
}

.rainbow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.15);
}

.rainbow-btn:active {
  transform: translateY(0);
}
