* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0b0e14;
  color: #e8edf5;
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── FONTS ──────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

/* ─── UTILITY ────────────────────────────────────────────────── */
.text-gray-400 { color: #9aa4b8; }
.text-red-400 { color: #f87171; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }

/* ─── ANIMATIONS ────────────────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-slideUp {
  animation: slideUp 0.5s ease forwards;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes lock-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

/* ─── GRADIENT & GLASS ──────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.glass-effect {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.card-gradient {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.2s;
}
.card-gradient:hover {
  border-color: rgba(59, 130, 246, 0.2);
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: #2a3346;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 500;
}
.btn-secondary:hover {
  background: #3b4a66;
}

/* ─── AUTH WRAPPER ──────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at 50% 10%, #1a2332 0%, #0b0e14 70%);
}
.auth-box {
  max-width: 440px;
  width: 100%;
  padding: 2.5rem;
  background: #161d2b;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.auth-header .subtitle {
  color: #9aa4b8;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* ─── AUTH TABS ─────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  background: #212b3d;
  padding: 0.3rem;
  border-radius: 14px;
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  padding: 0.6rem;
  border: none;
  background: transparent;
  color: #9aa4b8;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
}
.auth-tab.active {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.auth-tab:not(.active):hover {
  color: #e8edf5;
  background: rgba(255, 255, 255, 0.05);
}

/* ─── AUTH FORM ─────────────────────────────────────────────── */
#auth-form input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 10px;
  background: #212b3d;
  color: #e8edf5;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  transition: 0.2s;
  border: 1px solid transparent;
}
#auth-form input::placeholder { color: #6a7a92; }
#auth-form input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #2a3448;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.name-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
#signup-fields { display: block; }
#confirm-password-wrapper { display: block; }
.auth-message {
  margin-top: 1rem;
  padding: 0.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
  min-height: 2rem;
}
.auth-message.success { color: #4ade80; }
.auth-message.error { color: #f87171; }
.auth-message.warning { color: #fbbf24; }

/* ─── NAVBAR ────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: rgba(11, 14, 20, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.nav-brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Desktop navigation */
.nav-links.desktop {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav-link {
  background: none;
  border: none;
  color: #9aa4b8;
  cursor: pointer;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: 0.2s;
  font-size: 0.95rem;
}
.nav-link.active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
}
.nav-link:hover:not(.active) {
  color: #e8edf5;
  background: rgba(255, 255, 255, 0.05);
}
.logout-btn {
  color: #f87171;
}
.logout-btn:hover {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.1);
}

/* Mobile toggle button */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #e8edf5;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  transition: transform 0.3s ease, background 0.2s;
}
.mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}
.mobile-toggle.active {
  transform: rotate(90deg);
}

/* Mobile navigation - HIDDEN by default */
.mobile-nav {
  display: none !important;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 0.75rem;
}
.mobile-nav.active {
  display: flex !important;
}
.mobile-nav .nav-link {
  padding: 0.75rem 1rem;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  font-size: 1rem;
}
.mobile-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
}
.mobile-nav .nav-link.active {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}
.mobile-nav .logout-btn {
  color: #f87171;
}
.mobile-nav .logout-btn:hover {
  background: rgba(248, 113, 113, 0.1);
}

/* ─── PAGE CONTENT ──────────────────────────────────────────── */
.page-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.page { 
  display: none; 
  position: relative;
  min-height: 400px;
}
.page.active { display: block; }
.page h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: -0.3px;
}

/* ─── DASHBOARD ─────────────────────────────────────────────── */
.dashboard-header {
  margin-bottom: 1.5rem;
}
.dashboard-header h2 {
  margin-bottom: 0.25rem;
}
.total-card {
  text-align: center;
  padding: 2rem;
}
.total-card h1 {
  font-size: 3.2rem;
  font-weight: 700;
  color: #4ade80;
  margin-top: 0.25rem;
  letter-spacing: -1px;
}
.assets-card table {
  width: 100%;
  border-collapse: collapse;
}
.assets-card th, .assets-card td {
  padding: 0.7rem 0.25rem;
  text-align: left;
  border-bottom: 1px solid #212b3d;
}
.assets-card th {
  color: #9aa4b8;
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.assets-card td {
  font-weight: 500;
}
.transactions-card .tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #212b3d;
}
.tx-item .tx-type {
  font-weight: 600;
  text-transform: capitalize;
}
.tx-item .tx-details {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.tx-item .tx-meta {
  color: #9aa4b8;
  font-size: 0.8rem;
}
.tx-item .tx-amount {
  font-weight: 600;
}

/* ─── FORM CARDS ────────────────────────────────────────────── */
.form-card {
  padding: 1.5rem;
  border-radius: 16px;
}
.form-group {
  margin-bottom: 1.2rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  color: #9aa4b8;
  font-weight: 500;
  font-size: 0.9rem;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: none;
  border-radius: 10px;
  background: #212b3d;
  color: #e8edf5;
  font-size: 0.95rem;
  transition: 0.2s;
  border: 1px solid transparent;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  background: #2a3448;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-group input::placeholder {
  color: #6a7a92;
}

/* ─── FEE SUMMARY ───────────────────────────────────────────── */
.fee-summary {
  background: #212b3d;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin: 1rem 0;
}
.fee-summary > div {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}
.fee-summary > div span:last-child {
  font-weight: 500;
}

/* ─── DEPOSIT ADDRESS ───────────────────────────────────────── */
.deposit-address-box {
  background: #212b3d;
  padding: 1.2rem;
  border-radius: 12px;
  text-align: center;
  margin: 1rem 0;
}
.address-display {
  display: block;
  font-family: 'Courier New', monospace;
  background: #0b0e14;
  padding: 0.6rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  word-break: break-all;
  font-size: 0.85rem;
  color: #e8edf5;
  border: 1px solid #2a3448;
}

/* ─── EXCHANGE GRID ─────────────────────────────────────────── */
.exchange-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: start;
}
.exchange-swap-icon {
  font-size: 2rem;
  text-align: center;
  cursor: pointer;
  padding: 0.5rem;
  color: #60a5fa;
  align-self: center;
  transition: 0.2s;
}
.exchange-swap-icon:hover {
  color: #93bbfc;
  transform: scale(1.1);
}

/* ─── FROZEN BADGE ──────────────────────────────────────────── */
.freeze-badge {
  background: #ef4444;
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 12px;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  animation: pulse-badge 2s infinite;
}

.nav-frozen-badge {
  background: #ef4444;
  color: white;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse-badge 2s infinite;
  display: inline-block;
  white-space: nowrap;
}

/* ─── FROZEN OVERLAY ─────────────────────────────────────────── */
.frozen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 14, 20, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: 16px;
  padding: 2rem;
  min-height: 400px;
}
.frozen-overlay .frozen-lock-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: lock-pulse 2s ease-in-out infinite;
}
.frozen-overlay h2 {
  color: #f87171;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.frozen-overlay p {
  color: #9aa4b8;
  text-align: center;
  max-width: 400px;
  margin-bottom: 0.5rem;
}

/* ─── DISABLED FORM ELEMENTS ─────────────────────────────────── */
.frozen-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}
.frozen-disabled input,
.frozen-disabled select,
.frozen-disabled button {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */
/* Tablets and smaller screens */
@media (max-width: 1024px) {
  .nav-links.desktop {
    gap: 0.35rem;
  }
  .nav-links.desktop .nav-link {
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  .nav-links.desktop {
    display: none !important;
  }
  .mobile-toggle {
    display: block;
  }
  .mobile-nav {
    display: none !important;
  }
  .mobile-nav.active {
    display: flex !important;
  }
  .auth-box { padding: 1.5rem; }
  .page-content { padding: 1rem; }
  .page { min-height: 300px; }
  .exchange-grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .exchange-swap-icon { transform: rotate(90deg); }
  .name-fields { grid-template-columns: 1fr; }
  .total-card h1 { font-size: 2.4rem; }
  .nav-brand { font-size: 1.2rem; }
  .navbar { padding: 0.5rem 0.75rem; }
  .frozen-overlay {
    min-height: 300px;
    padding: 1.5rem;
    border-radius: 12px;
  }
  .frozen-overlay .frozen-lock-icon { font-size: 3rem; }
  .frozen-overlay h2 { font-size: 1.5rem; }
  .frozen-overlay p { font-size: 0.9rem; }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .nav-brand { font-size: 1rem; }
  .nav-frozen-badge {
    font-size: 0.55rem;
    padding: 2px 8px;
  }
  .mobile-nav .nav-link {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* Desktop - ensure mobile nav is hidden */
@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
  .mobile-toggle { display: none !important; }
  .nav-links.desktop { display: flex !important; }
}