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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0e27;
  color: #ffffff;
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
}

/* Top navigation bar */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #020617;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.9);
  z-index: 1100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

/* Hamburger only in top bar; dmaxtrade.com appears inside the open menu panel */
.nav-hamburger-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: fixed;
  left: 20px;
  top: 20px;
  z-index: 1000;
}

/* Hamburger Menu Button */
.menu-toggle {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 6px;
  padding: 8px 12px;
  color: #e5e7eb;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.menu-toggle:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(148, 163, 184, 0.8);
}

/* Homepage Menu Dropdown */
.homepage-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 180px;
  background: #020617;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.9);
  overflow: hidden;
  z-index: 1200;
  display: flex;
  flex-direction: column;
}

.homepage-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.menu-item-icon {
  font-size: 18px;
  line-height: 1;
}

.homepage-menu-item:hover {
  background: rgba(15, 23, 42, 0.9);
}

.homepage-menu-item:not(:last-child) {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.nav-links {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(15, 23, 42, 0.85);
}

.nav-link-active {
  background: radial-gradient(circle at top left, #0f172a, #020617 70%);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.7);
  position: relative;
}

.nav-link-active::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(to right, #3b82f6, #2563eb);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px; /* Smaller gap on mobile */
  flex-shrink: 0; /* Prevent shrinking */
  justify-content: flex-end; /* Align items to the right */
}

/* Support styles are in components/support/support.css */

/* Top-right strip: Deposit button + Balance, to the left of profile */
.top-right-strip {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 20px; /* 20px space between Deposit and Balance */
  z-index: 1000;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  /* Ensure Home item is visible in hamburger menu on mobile. */
  #homepageMenu #menuHome {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Top navigation: Adjust layout on mobile */
  .top-nav {
    height: 64px;
    padding: 0 12px;
  }

  .nav-left {
    gap: 8px;
    flex: 1;
  }

  .nav-hamburger-stack {
    position: static !important;
    left: auto !important;
    top: auto !important;
  }

  /* Logo: Minimized and positioned top-left on mobile */
  .logo {
    position: static !important; /* Remove fixed positioning on mobile */
    order: 2; /* After hamburger */
    top: auto !important;
    left: auto !important;
    display: flex;
    align-items: center;
    pointer-events: auto !important; /* Enable clicks on mobile */
  }

  /* Reduce logo mark and increase brand text on mobile */
  .logo-mark {
    width: 26px;
    height: 26px;
    margin-right: 6px;
    transform: none !important;
  }

  .logo-text {
    font-size: 36px !important;
    letter-spacing: 0.08em !important;
    font-weight: 900 !important;
  }

  .logo-text-main {
    font-size: 36px !important;
    font-weight: 900 !important;
  }

  .logo-text-accent {
    font-size: 30px !important;
    font-weight: 900 !important;
  }
  
  /* When logged in on mobile: Show only "D" in white on blue tile (matches hamburger menu brand), right of hamburger */
  .logo[data-logged-in="true"] {
    margin-left: 60px !important; /* 60px gap from hamburger (30px + 30px) */
  }
  
  .logo[data-logged-in="true"] .logo-text {
    font-size: 24px !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%) !important; /* Blue card — matches hamburger D */
    color: #ffffff !important; /* White text */
    padding: 8px 12px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    line-height: 1 !important;
  }
  
  .logo[data-logged-in="true"] .logo-text-main {
    color: #ffffff !important; /* White color */
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    background-clip: unset !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    overflow: hidden !important;
    width: 1ch !important; /* Only show first character "D" */
    display: inline-block !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
  }
  
  .logo[data-logged-in="true"] .logo-text-accent {
    display: none !important; /* Hide "trade" part */
  }

  /* Nav links: Hide on mobile (moved to hamburger menu) */
  .nav-links {
    display: none !important;
  }

  /* Nav right: Ensure auth buttons are visible and positioned */
  .nav-right {
    gap: 6px;
    align-items: center;
  }

  /* Top-right strip: Stack vertically on mobile */
  .top-right-strip {
    top: 10px;
    right: 10px;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
  }
  
  /* Profile button: Adjust position on mobile */
  .profile-button {
    width: 40px;
    height: 40px;
    padding: 8px;
    top: 12px;
    right: 12px;
  }
  
  /* Balance display: Minimized to 12px on mobile - only shown when logged in */
  .balance-display {
    padding: 6px 10px;
    font-size: 12px !important;
    display: none !important; /* Hidden by default on mobile too */
  }
  
  /* Show balance only when user is logged in (JavaScript will set display: flex) */
  .balance-display[data-logged-in="true"] {
    display: flex !important;
  }
  
  .balance-label {
    font-size: 12px !important;
  }
  
  .balance-amount {
    font-size: 12px !important;
  }
  
  /* Deposit button: Minimized to 12px on mobile */
  .top-deposit-button {
    padding: 2px 10px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: unset !important;
    border-radius: 6px !important;
  }
  
  /* Auth buttons: Minimized and on right side on mobile - only show when not logged in */
  .nav-auth-buttons {
    flex-direction: row; /* Keep horizontal */
    gap: 6px; /* Smaller gap */
    width: auto;
    margin: 0 !important;
    align-items: center;
  }
  
  /* Hide auth buttons when user is logged in (respects JavaScript display: none) */
  .nav-auth-buttons[style*="display: none"],
  .nav-auth-buttons[data-logged-in="true"],
  #authButtons[style*="display: none"],
  #authButtons[data-logged-in="true"] {
    display: none !important;
  }
  
  /* Only show auth buttons when user is NOT logged in */
  .nav-auth-buttons:not([data-logged-in="true"]):not([style*="display: none"]) {
    display: flex !important;
  }
  
  .nav-auth-buttons #btnRegister {
    padding: 5px 12px !important; /* Compact padding for Register */
    font-size: 12px !important; /* Strictly 12px */
    min-width: auto;
    white-space: nowrap;
    min-height: auto !important;
    line-height: 1.2 !important;
    border-radius: 8px !important;
  }
  
  .nav-auth-buttons .btn-auth:not(#btnRegister) {
    padding: 6px 12px !important; /* Minimized padding for Login */
    font-size: 12px !important; /* Smaller font */
    min-width: auto;
    white-space: nowrap;
    min-height: 32px; /* Ensure touch target */
  }

  /* Keep regular auth-buttons (not in nav) stacked if they exist elsewhere */
  .auth-buttons:not(.nav-auth-buttons) {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
  }
  
  .auth-buttons:not(.nav-auth-buttons) button {
    width: 100%;
  }
  
  /* Hero content: Better mobile spacing */
  .hero-content {
    padding: 20px 16px;
    gap: 24px;
  }
  
  .hero-title {
    font-size: 28px;
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: 14px;
  }

  /* Hero stats: Single column on mobile */
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 80px 10px 8px;
    padding: 0;
  }
  
  .hero-stat-card {
    padding: 16px 14px;
  }

  .hero-stat-value {
    font-size: 20px;
  }

  .hero-stat-label {
    font-size: 11px;
  }
  
  /* Modals: Full width on mobile with proper padding */
  .modal-overlay {
    padding: 16px;
  }
  
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px 16px;
    margin: 0;
  }
  
  /* Profile modal: Mobile adjustments */
  .profile-modal-content {
    width: 100%;
    max-width: 100%;
    padding: 20px 16px;
  }

  #profileModal.modal-overlay {
    padding: 16px;
    align-items: center;
    justify-content: center;
  }

  #profileModal .modal-content {
    max-width: 100%;
  }
  
  /* Balance mode menu: Adjust position on mobile */
  .balance-mode-menu {
    right: 0;
    left: auto;
    min-width: 200px;
  }
  
  /* Buttons: Ensure minimum touch target size (44x44px) */
  button, .button, a.button {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Input fields: Larger touch targets */
  input, textarea, select {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Extra small devices (phones in portrait, < 480px) */
@media (max-width: 480px) {
  .top-nav {
    height: 56px;
    padding: 0 8px;
  }

  .nav-left {
    gap: 6px;
  }

  /* Logo: Smaller icon but larger text on phones */
  .logo {
    position: static !important;
  }

  .logo-mark {
    width: 22px;
    height: 22px;
    margin-right: 5px;
  }

  .logo-text {
    font-size: 20px !important;
    letter-spacing: 0.06em !important;
  }

  .logo-text-main {
    font-size: 20px !important;
  }

  .logo-text-accent {
    font-size: 18px !important;
  }

  /* Extra small: further minimize subtitle */
  .logo-subtitle {
    font-size: 9px;
    letter-spacing: 0.06em;
    top: -9px; /* moved 3px downward */
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 12px;
  }

  .top-right-strip {
    top: 8px;
    right: 8px;
    gap: 6px;
  }

  .profile-button {
    width: 36px;
    height: 36px;
    top: 10px;
    right: 10px;
  }

  .balance-display {
    padding: 5px 8px;
    font-size: 12px !important;
    display: none !important; /* Hidden by default on very small screens too */
  }
  
  /* Show balance only when user is logged in (JavaScript will set display: flex) */
  .balance-display[data-logged-in="true"] {
    display: flex !important;
  }

  .balance-label {
    font-size: 12px !important;
  }

  .balance-amount {
    font-size: 12px !important;
  }

  .top-deposit-button {
    padding: 2px 10px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: unset !important;
    border-radius: 6px !important;
  }

  /* Auth buttons: Even smaller on very small screens */
  .nav-auth-buttons #btnRegister {
    padding: 4px 10px !important; /* Very compact for Register */
    font-size: 11px !important; /* Slightly smaller on very small screens */
    line-height: 1.2 !important;
  }
  
  .nav-auth-buttons .btn-auth:not(#btnRegister) {
    padding: 5px 10px !important;
    font-size: 11px !important;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .hero-stat-card {
    padding: 14px 12px;
  }

  .hero-stat-value {
    font-size: 18px;
  }

  .hero-stat-label {
    font-size: 10px;
  }

  .hero-title {
    font-size: 24px;
  }
  
  .trading-chart {
    height: 180px;
    min-height: 180px;
  }
  
  .top-right-strip {
    gap: 6px;
  }
  
  .balance-display {
    padding: 5px 8px;
    font-size: 12px !important;
    display: none !important; /* Hidden by default on very small screens too */
  }
  
  /* Show balance only when user is logged in (JavaScript will set display: flex) */
  .balance-display[data-logged-in="true"] {
    display: flex !important;
  }
  
  .balance-label {
    font-size: 12px !important;
  }
  
  .balance-amount {
    font-size: 12px !important;
  }
  
  .top-deposit-button {
    padding: 2px 10px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: unset !important;
    border-radius: 6px !important;
  }
}

/* Balance Display - Top Right */
.balance-display {
  position: relative;
  display: none; /* Hidden by default, shown only after login/register */
  align-items: center;
  z-index: 100;
}

.balance-toggle-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 2px 8px;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  z-index: 101;
  pointer-events: auto;
  user-select: none;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  height: auto;
  min-height: unset;
}

/* Minimized state - smaller and more compact */
.balance-display.minimized .balance-toggle-btn {
  padding: 2px 8px;
  gap: 3px;
  border-radius: 6px;
}

.balance-display.minimized .balance-toggle-icon {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

.balance-display.minimized .balance-toggle-amount {
  font-size: 11px;
  min-width: 50px;
}

.balance-display.minimized .balance-toggle-arrow {
  font-size: 8px;
}

/* Balance display starts minimized by default */
.balance-display:not(.expanded) .balance-toggle-btn {
  padding: 2px 8px;
  gap: 3px;
  border-radius: 6px;
}

.balance-display:not(.expanded) .balance-toggle-icon {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

.balance-display:not(.expanded) .balance-toggle-amount {
  font-size: 11px;
  min-width: 50px;
}

.balance-display:not(.expanded) .balance-toggle-arrow {
  font-size: 8px;
}

.balance-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.balance-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgba(37, 99, 235, 0.2);
  border-radius: 4px;
  color: #60a5fa;
  font-size: 10px;
  font-weight: 700;
}

/* Demo icon in red */
.balance-toggle-btn.demo-active .balance-toggle-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.balance-toggle-amount {
  font-size: 11px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  min-width: 50px;
}

.balance-toggle-amount.real-balance {
  color: #60a5fa;
}

.balance-toggle-amount.demo-balance {
  color: #ef4444;
}

.balance-toggle-arrow {
  font-size: 8px;
  color: #94a3b8;
  transition: transform 0.3s ease;
  cursor: pointer;
  padding: 2px;
  transform: rotate(0deg) !important; /* Default state - always down */
}

.balance-toggle-btn.active .balance-toggle-arrow {
  transform: rotate(180deg) !important;
}

/* Force arrow to reset when active class is removed */
.balance-toggle-btn:not(.active) .balance-toggle-arrow {
  transform: rotate(0deg) !important;
}

.balance-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(30, 41, 59, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1002;
  display: none !important; /* Hidden by default */
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
  transition: none !important; /* Remove transition for instant hide */
}

.balance-dropdown[hidden],
.balance-dropdown[style*="display: none"],
.balance-dropdown[style*="display:none"],
.balance-dropdown.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.balance-account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
  width: 100%;
  text-align: left;
  pointer-events: auto;
  z-index: 1;
}

.balance-account-item:hover {
  background: rgba(148, 163, 184, 0.1);
}

.balance-account-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.balance-account-dot.real-dot {
  background: #3b82f6;
}

.balance-account-dot.demo-dot {
  background: #ef4444;
}

.balance-account-text {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.balance-account-status {
  font-size: 11px;
  font-weight: 600;
  color: #93c5fd;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.25);
}

.balance-account-status.inactive {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.2);
}

.balance-reset-btn {
  background: rgba(239, 68, 68, 0.3);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 4px;
  color: #ef4444;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
  flex-shrink: 0;
  z-index: 1004;
  position: relative;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  isolation: isolate;
}

.balance-reset-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
  transform: rotate(180deg);
}

.balance-reset-btn:active {
  transform: rotate(360deg);
}

/* Top-right Deposit button (20px to the left of balance box) */
.top-deposit-button {
  padding: 2px 10px;
  border-radius: 6px;
  border: none;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  line-height: 1.2;
  height: auto;
  min-height: unset;
}

.top-deposit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.45);
}

.balance-mode-toggle {
  margin-left: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.balance-mode-caret {
  font-size: 10px;
}

.balance-mode-menu {
  position: absolute;
  top: 52px;
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 14px;
  border: 1px solid rgba(30, 64, 175, 0.5);
  padding: 6px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.balance-mode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
  min-width: 200px;
}

.balance-mode-item-active {
  background: rgba(30, 64, 175, 0.5);
}

.balance-mode-item:hover {
  background: rgba(30, 64, 175, 0.35);
}

.balance-mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.balance-mode-dot-real {
  background: #3b82f6;
}

.balance-mode-dot-demo {
  background: #ef4444;
}

.balance-mode-text {
  flex: 1;
  text-align: left;
}

.balance-mode-status {
  font-size: 11px;
  font-weight: 600;
  color: #93c5fd;
}

.balance-mode-status-inactive {
  color: transparent;
}

.balance-mode-reset {
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: #60a5fa;
  font-size: 10px;
  cursor: pointer;
  display: none; /* only visible when demo is active */
}

.balance-mode-reset:hover {
  border-color: #93c5fd;
  color: #93c5fd;
}

.profile-button {
  display: none !important; /* profile moved to hamburger → Account settings */
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  color: #ffffff;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.profile-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.profile-button svg {
  width: 20px;
  height: 20px;
}

/* Hamburger — sits inside .nav-hamburger-stack (stack is fixed on desktop) */
.nav-hamburger-stack .menu-toggle {
  position: static !important;
  left: auto !important;
  top: auto !important;
}

.menu-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  width: 48px;
  height: 48px;
}

/* Logo — to the right of hamburger */
.logo {
  position: fixed;
  top: -20px; /* moved 20px more up on desktop */
  left: 88px; /* desktop default position */
  z-index: 1001; /* Above hamburger menu */
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* allow subtitle to sit below */
  pointer-events: none; /* Allow clicks to pass through to elements behind */
}

/* Distinctive logo mark left of text */
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  margin-right: 8px;
  transform: none !important;
  background: conic-gradient(from 200deg, #6366f1, #3b82f6, #60a5fa, #6366f1);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: auto; /* allow hover glow */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.logo-mark:hover {
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.55);
}

.logo-mark svg {
  width: 100%;
  height: 100%;
}

/* Hide the logo icon when user is logged in */
.logo[data-logged-in="true"] .logo-mark {
  display: none !important;
}

/* Desktop logo size - large and bold (increased further) */
.logo-text {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
}

.logo-text-main {
  font-size: 56px;
  font-weight: 900;
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 40%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text-accent {
  font-size: 42px;
  font-weight: 900;
  color: #e5e7eb;
}

/* Logo subtitle under the brand */
.logo-subtitle {
  display: block;
  margin-left: 42px; /* align under text (mark 34px + 8px gap) */
  margin-top: 0;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.12em;
  text-transform: none !important;
  position: relative;
  top: -18px; /* moved upward ~20px */
  flex-basis: 100%; /* new line under the main text */
}

/* Show subtitle only before authentication */
.logo[data-logged-in="true"] .logo-subtitle {
  display: none !important;
}

/* Desktop (PC) adjustments: bigger icon, smaller wordmark */
@media (min-width: 769px) {
  .logo {
    top: -10px; /* move another 5px downward from -15px */
    left: 18px !important; /* move another 35px left on PC only */
  }
  .logo-mark {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    transform: none !important;
  }
  .logo-text {
    font-size: 34px;
    letter-spacing: 0.08em;
  }
  .logo-text-main {
    font-size: 34px;
  }
  .logo-text-accent {
    font-size: 26px;
  }
}

@media (max-width: 768px) {
  .logo-subtitle {
    margin-left: 42px;
    font-size: 10px;
    letter-spacing: 0.08em;
    top: -11px; /* moved 3px downward */
  }
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.homepage-menu {
  position: fixed;
  top: 78px; /* Below fixed hamburger */
  left: 20px; /* Align with hamburger menu position */
  background: rgba(10, 14, 39, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(10px);
}

.homepage-menu .menu-panel-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

/* Same “D” badge as mobile header logo (logged-in): blue rounded tile, white letter */
.homepage-menu .menu-panel-brand-d {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.homepage-menu .menu-panel-brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #e2e8f0;
}

.homepage-menu-item.homepage-menu-item-logout {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  color: #fca5a5;
}

.homepage-menu-item.homepage-menu-item-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-item-refer {
  color: #a855f7;
}

.menu-item-refer:hover {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
}

.menu-item-danger {
  color: #ef4444;
}

.menu-item-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

/* Profile Modal Content */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-value {
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
}

/* Refer & Earn Modal */
.refer-earn-modal {
  max-width: 500px;
  padding: 0;
  overflow: hidden;
}

.refer-earn-header {
  position: relative;
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 50%, #7e22ce 100%);
  padding: 32px 24px 24px;
  text-align: center;
  color: #ffffff;
}

.refer-earn-header-content {
  position: relative;
  z-index: 2;
}

.refer-earn-title {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 0;
  text-align: center;
}

.refer-earn-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  text-align: center;
}

.refer-earn-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s ease;
  z-index: 10;
}

.refer-earn-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.refer-earn-gift-icon {
  position: absolute;
  top: 20px;
  right: 60px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 0.9;
  z-index: 1;
}

.refer-earn-body {
  padding: 24px;
  background: rgba(10, 14, 39, 0.98);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.how-it-works-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.how-it-works-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.how-it-works-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #a855f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
}

.step-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.step-description {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.5;
}

.referral-link-section-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.referral-link-section-modal label {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  text-transform: none;
  letter-spacing: 0;
}

.referral-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.referral-link-row input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  font-family: ui-monospace, monospace;
}

.referral-link-row input:focus {
  outline: none;
  border-color: #a855f7;
}

.copy-link-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-link-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.share-whatsapp-btn {
  width: 100%;
  padding: 16px 24px;
  background: #25d366;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.share-whatsapp-btn:hover {
  background: #20ba5a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.referrals-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.referrals-label {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.referrals-count {
  font-size: 20px;
  font-weight: 700;
  color: #a855f7;
}

.profile-value.password-value {
  color: #94a3b8;
  letter-spacing: 2px;
}

.page {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.hero-section {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  height: 100%;
  flex: 1;
}

@media (max-width: 968px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

/* Hero Left Section */
.hero-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  height: 100%;
  flex: 1;
}

/* Hero stats strip (cards) */
.hero-stats {
  width: 100%;
  margin: 80px -20px 8px; /* 80px top margin to move cards down, stretch cards from edge to edge of screen */
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 1024px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(370px, calc(100% - 20px));
    max-width: 370px;
    gap: 7px;               /* keep current horizontal gap */
    row-gap: 5px;           /* set vertical gap to 5px as requested */
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    justify-content: center;
    justify-items: center;
    transform: translateX(-30px);
  }
  .hero-stat-card {
    width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
    padding: 8px 6px;
    border-radius: 9px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.5);
    gap: 4px;
  }
  .hero-stat-icon { font-size: 16px; margin-bottom: 2px; }
  .hero-stat-value { font-size: 14px; line-height: 1.1; }
  .hero-stat-label { font-size: 8px; line-height: 1.1; }
}

/* Extra small phones */
@media (max-width: 480px) {
  .hero-stats {
    width: min(370px, calc(100% - 20px));
    max-width: 370px;
    gap: 6px;               /* keep current horizontal gap */
    row-gap: 5px;           /* force vertical gap to 5px */
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    justify-content: center;
    justify-items: center;
    transform: translateX(-30px);
  }
  .hero-stat-card {
    padding: 7px 5px;
    border-radius: 8px;
    gap: 3px;
  }
  .hero-stat-icon { font-size: 14px; margin-bottom: 1px; }
  .hero-stat-value { font-size: 13px; line-height: 1.05; }
  .hero-stat-label { font-size: 7px; line-height: 1.05; }
}

/* Very small phones (e.g., 360-390px width) */
@media (max-width: 390px) {
  .hero-stats {
    width: min(370px, calc(100% - 20px)); /* keep ~10px edges */
    max-width: 370px;
    gap: 4px;               /* keep current horizontal gap */
    row-gap: 5px;           /* ensure vertical gap is 5px */
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    justify-items: center;
    transform: translateX(-30px);
  }
  .hero-stat-card {
    padding: 6px 4px;
    border-radius: 6px;
    gap: 3px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.45);
  }
  .hero-stat-icon { font-size: 12px; margin-bottom: 1px; }
  .hero-stat-value { font-size: 12px; line-height: 1.05; }
  .hero-stat-label { font-size: 7px; line-height: 1.05; }
}

.hero-stat-card {
  background: rgba(10, 14, 39, 0.95);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.8);
  padding: 20px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-stat-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.hero-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #38bdf8;
}

.hero-stat-label {
  font-size: 14px;
  color: #d1d5db;
}

.hero-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  width: fit-content;
}

.badge-blue {
  background: #3b82f6;
  color: #ffffff;
}

.hero-title {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  margin: 0;
}

/* Form Section */
.form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
  width: 100%;
  height: 100%;
  flex: 1;
  padding: 20px;
}

.form-title {
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.form-toggle {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 12px;
  width: 100%;
  margin: 0;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
}

.tab-btn.active {
  background: #2563eb;
  color: #ffffff;
}

.tab-btn:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.form-instruction {
  color: #94a3b8;
  font-size: 14px;
  margin: 0;
  text-align: center;
}

/* Login Welcome Message */
.login-welcome {
  margin-bottom: 24px;
  text-align: center;
}

.welcome-title {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.welcome-subtitle {
  color: #94a3b8;
  font-size: 16px;
  margin: 0;
}

.form-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 24px;
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Form Fields */
.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
}

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

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 18px;
  z-index: 1;
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.input-with-icon input::placeholder {
  color: #64748b;
}

.input-with-icon input:focus {
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.08);
}

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

.password-input-wrapper .input-with-icon {
  flex: 1;
}

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #94a3b8;
  font-size: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: #ffffff;
}

.eye-icon {
  display: inline-block;
  user-select: none;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Top nav Log in — same blue family as primary CTAs */
#btnLogin.btn-secondary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

#btnLogin.btn-secondary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  width: auto;
}

/* Auth Buttons */
.auth-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
  margin-top: -50px; /* move Register / Login buttons 50px up when inside form */
  justify-content: flex-end;
}

.btn-auth {
  width: auto !important;
  flex: none !important;
  min-width: auto;
  max-width: none;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 12px;
}

/* Get Started (register) button — blue */
#btnRegister {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  width: auto !important;
  padding: 8px 16px !important; /* Compact padding */
  font-size: 12px !important; /* Desktop 12px */
  font-weight: 600 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1.2 !important;
}

/* Auth buttons when placed in the top navigation bar (top-right) - Desktop default */
.nav-auth-buttons {
  width: auto;
  margin-top: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: row;
  gap: 12px;
  order: 1; /* Ensure auth buttons appear first in nav-right */
}

/* Register button - ensure it's on the rightmost position */
#btnRegister {
  order: 2; /* Register appears after Login (rightmost) */
}

/* Desktop: Register button 12px */
.top-nav .nav-auth-buttons #btnRegister {
  padding: 8px 16px !important; /* Compact padding */
  font-size: 12px !important; /* Desktop 12px */
  font-weight: 600 !important;
  border-radius: 10px !important;
  line-height: 1.2 !important;
}

/* Desktop: Keep Login button normal size */
.top-nav .nav-auth-buttons .btn-auth:not(#btnRegister) {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
}

/* Ensure auth buttons are hidden when user is logged in */
.nav-auth-buttons[style*="display: none"],
#authButtons[style*="display: none"] {
  display: none !important;
}

@media (min-width: 769px) {
  .top-nav .nav-auth-buttons {
    display: flex;
  }
  
  /* Hide auth buttons on desktop when logged in */
  .top-nav .nav-auth-buttons[style*="display: none"],
  #authButtons[style*="display: none"] {
    display: none !important;
  }
  
  .top-nav .nav-auth-buttons #btnRegister {
    padding: 8px 16px !important;
    font-size: 12px !important; /* Desktop 12px */
  }
  
  .top-nav .nav-auth-buttons .btn-auth:not(#btnRegister) {
    padding: 10px 20px;
    font-size: 14px;
  }
}

#btnRegister:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%) !important;
  filter: brightness(1.05);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Status Text */
.status-text {
  margin-top: 12px;
  font-size: 14px;
  text-align: center;
}

.status-text.ok {
  color: #60a5fa;
}

.status-text.err {
  color: #ef4444;
}

/* Hero Right Section - Friend Cards */
.hero-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  max-width: 800px;
}

@media (max-width: 968px) {
  .hero-right {
    grid-template-columns: 1fr;
  }
}

.friend-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-radius: 16px;
  min-height: 200px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.friend-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.friend-card-invite {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.friend-card-onboard {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
}

.friend-avatar {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.avatar-circle svg {
  width: 32px;
  height: 32px;
  stroke-width: 2.5;
}

.avatar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.friend-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  width: 100%;
}

.friend-card-title {
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.friend-card-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.friend-card-button {
  width: 100%;
  padding: 12px 24px;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto;
}

.friend-card-button:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.friend-card-text {
  display: none; /* Hide old text, using new structure */
}

/* Modal Overlay Styles - for blurred background */
#profileModal.modal-overlay {
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 80px;
  padding-right: 20px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-content {
  background: #0a0e27;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

/* Make profile modal panel a bit narrower in the top-right */
#profileModal .modal-content {
  max-width: 360px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #ffffff;
}

/* Dashboard styles moved to components/dashboard/dashboard.css */

/* Ensure deposit method modal is always above smart trading bot modal */
#depositMethodModal.modal-overlay {
  z-index: 20000 !important;
}

/* Ensure M-Pesa deposit modal stays visible during deposit process */
#depositModal.modal-overlay {
  z-index: 20001 !important;
}

/* Ensure bank deposit modal stays visible during deposit process */
#bankDepositModal.modal-overlay {
  z-index: 20001 !important;
}

.transaction-history-modal {
  max-width: 460px;
  padding: 0;
  overflow: hidden;
}

/* When support is opened, hide homepage sections and lock scroll */
body.support-open {
  overflow: hidden !important;
}
body.support-open #homepage,
body.support-open #homepageHeadline,
body.support-open .page {
  display: none !important;
}
/* Single full-height live chat panel below fixed top nav (hamburger Live chat) */
body.support-open #supportSection.support-section {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  top: calc(72px + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  height: auto;
  overflow: hidden;
  background: #020617;
  box-sizing: border-box;
}

body.support-open #supportSection .support-grid {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
}

body.support-open #supportSection .support-card:not(.support-card-livechat) {
  display: none !important;
}

body.support-open #supportLiveChatCard.support-card-livechat {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: 0;
  border: none;
  padding: 12px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

body.support-open #supportInAppChatWrap.support-inapp-wrap--embedded {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

body.support-open #supportInAppChatWrap .live-chat-shell {
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.support-open .live-chat-thread {
  flex: 1 1 0%;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

body.support-open #supportLiveChatGuest.support-livechat-guest {
  flex: 1;
  min-height: 0;
  justify-content: center;
}

/* Phone: live chat fills the entire viewport (covers balance, hamburger, top bar) */
@media (max-width: 768px) {
  body.support-open #supportSection.support-section {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    background: #ffffff;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
  }

  body.support-open #supportSection .support-grid {
    flex: 1 1 0%;
    min-height: 0;
  }

  body.support-open #supportLiveChatCard.support-card-livechat {
    flex: 1 1 0%;
    min-height: 0;
    background: #ffffff;
    border: none;
    box-shadow: none;
    padding: max(10px, env(safe-area-inset-top, 0px))
      max(16px, env(safe-area-inset-right, 0px))
      max(16px, env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
  }

  body.support-open #supportLiveChatCard .support-title {
    color: #111827;
  }

  body.support-open #supportLiveChatCard .support-subtitle {
    color: #6b7280;
  }

  body.support-open #supportLiveChatGuest .support-livechat-guest-text {
    color: #6b7280;
  }

  body.support-open #supportInAppChatWrap.support-inapp-wrap--embedded {
    flex: 1 1 0%;
    min-height: 0;
  }

  body.support-open #supportInAppChatWrap .live-chat-shell {
    flex: 1 1 0%;
    min-height: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  body.support-open .live-chat-thread {
    flex: 1 1 0%;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  body.support-open .live-chat-composer {
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Keep homepage headline block centered while sentence animation runs */
#homepageHeadline {
  width: 100%;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  contain: layout;
}

/* Reserve vertical space so typing / sentence rotation does not shift the page */
#homepageHeadline .homepage-header-title {
  min-height: 4.2em;
  box-sizing: border-box;
  contain: layout;
}

#homepageHeadline .homepage-header-title,
#homepageHeadline .homepage-header-subtitle {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Ensure subtitle centers nicely on all screens */
#homepageHeadline .homepage-header-subtitle {
  max-width: 900px;
}

@media (max-width: 768px) {
  #homepageHeadline .homepage-header-subtitle {
    max-width: 92%;
  }
}

.transaction-history-modal .modal-header {
  padding: 20px 20px 10px;
  margin-bottom: 0;
}

.transaction-history-tabs {
  display: flex;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.history-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  font-weight: 600;
  padding: 14px 12px;
  cursor: pointer;
}

.history-tab-btn.active {
  color: #2dd4bf;
  border-bottom: 3px solid #2dd4bf;
}

.transaction-history-list {
  max-height: 420px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.history-amount {
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
}

.history-meta {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 4px;
}

.history-status {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  text-transform: lowercase;
  background: rgba(30, 64, 175, 0.35);
  color: #93c5fd;
}


/* Move rotating referral cards 10px left on mobile */
@media (max-width: 768px) {
  #homepage .hero-right .friend-card {
    position: relative !important;
    left: -10px !important;
  }
}

/* Absolute final mobile nudge: hero stat cards 20px left */
@media (max-width: 768px) {
  #homepage .hero-stats,
  .hero-stats {
    position: relative !important;
    left: 0 !important;
    transform: translateX(-20px) !important;
    display: grid !important;
    gap: 0 7px !important;
    column-gap: 7px !important;
    row-gap: 0 !important;
  }
}

/* Absolute final mobile nudge: homepage start cards 30px left */
@media (max-width: 768px) {
  #homepage .homepage-images-container,
  #homepage .homepage-images-container .homepage-image-wrapper {
    position: relative !important;
    left: 0 !important;
    transform: translateX(-30px) !important;
  }
  #homepage .homepage-images-container {
    row-gap: 7px !important;
  }
  #homepage .homepage-images-container .homepage-image-wrapper {
    margin-bottom: 7px !important;
  }
}

/* Global stability lock: stop page shaking by disabling motion that shifts layout */
* {
  animation: none !important;
  transition: none !important;
}
/* Remove hover lifts/shifts that can cause jitter */
.menu-toggle:hover,
.top-deposit-button:hover,
.profile-button:hover,
.copy-link-btn:hover,
.share-whatsapp-btn:hover,
.friend-card:hover,
.friend-card-button:hover,
.btn-primary:hover,
.btn-secondary:hover,
#btnRegister:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Final logo position lock: phone-only move */

@media (max-width: 480px) {
  .top-nav .logo {
    transform: translateX(5px) !important;
    margin-left: 0 !important;
  }
  .top-nav .logo[data-logged-in="true"] {
    transform: translateX(5px) !important;
    margin-left: 0 !important;
  }
}

/* Real phone override (covers wider phone CSS widths too) */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
  .top-nav .logo {
    transform: translateX(5px) !important;
    margin-left: 0 !important;
  }
  .top-nav .logo[data-logged-in="true"] {
    transform: translateX(5px) !important;
    margin-left: 0 !important;
  }
}

/* Keep page container neutral; homepage.css controls exact 60px trim */
main.page {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

#homepage.form-card {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Final site tone: bluish background from top logo area to footer */
html,
body,
main.page,
.hero-section,
.hero-content,
.hero-left,
#homepage,
#homepage .homepage-content,
#siteFooter,
.site-footer {
  background:
    radial-gradient(120% 120% at 50% -10%, rgba(56, 189, 248, 0.11) 0%, rgba(2, 6, 23, 0) 60%),
    linear-gradient(180deg, #0c1730 0%, #0a1327 58%, #09101f 100%) !important;
}


