/* Nexion Design System - Shared styles matching landing page */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #06080d;
  --bg-secondary: #0c1018;
  --bg-card: #111822;
  --bg-card-hover: rgba(17, 24, 34, 0.9);
  --accent: #00e5a0;
  --accent-dim: rgba(0, 229, 160, 0.12);
  --accent-glow: rgba(0, 229, 160, 0.25);
  --accent-hover: #00cc8e;
  --text-primary: #e8ecf1;
  --text-secondary: #8b95a5;
  --text-muted: #5a6578;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(0, 229, 160, 0.15);
  --danger: #ff4757;
  --danger-dim: rgba(255, 71, 87, 0.12);
  --warning: #ffa502;
  --warning-dim: rgba(255, 165, 2, 0.12);
  --success: #00e5a0;
  --success-dim: rgba(0, 229, 160, 0.12);
  --info: #3b82f6;
  --info-dim: rgba(59, 130, 246, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Noise texture overlay */
.noise {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* Layout */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* Top Navigation */
.top-nav {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.card:hover::before { opacity: 1; }

.card-clickable {
  cursor: pointer;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-for {
  background: var(--success-dim);
  color: var(--success);
}

.badge-against {
  background: var(--danger-dim);
  color: var(--danger);
}

.badge-abstain {
  background: var(--info-dim);
  color: var(--info);
}

.badge-active {
  background: var(--success-dim);
  color: var(--success);
}

.badge-closed {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}

.badge-pending {
  background: var(--warning-dim);
  color: var(--warning);
}

.badge-low { background: var(--success-dim); color: var(--success); }
.badge-medium { background: var(--warning-dim); color: var(--warning); }
.badge-high { background: var(--danger-dim); color: var(--danger); }
.badge-critical { background: var(--danger-dim); color: var(--danger); }

/* Proposal Grid */
.proposals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.proposal-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.proposal-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dao-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}

.dao-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proposal-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dao-name {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.proposal-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.proposal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proposal-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proposal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.recommendation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.confidence-score {
  font-size: 12px;
  color: var(--text-muted);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar select,
.filter-bar input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--accent);
}

.filter-bar input {
  flex: 1;
  min-width: 200px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.stat-value span { color: var(--accent); }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Detail Page */
.detail-header {
  margin-bottom: 32px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--accent); }

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.detail-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.detail-proposer {
  font-size: 14px;
  color: var(--text-muted);
}

/* Analysis Section */
.analysis-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.analysis-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.analysis-card.full-width {
  grid-column: 1 / -1;
}

.analysis-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.key-changes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.key-changes-list li {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
}

/* Vote Bars */
.vote-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vote-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vote-bar-label {
  font-size: 14px;
  min-width: 80px;
  color: var(--text-secondary);
}

.vote-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.vote-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s;
}

.vote-bar-fill.for { background: var(--accent); }
.vote-bar-fill.against { background: var(--danger); }
.vote-bar-fill.abstain { background: var(--info); }

.vote-bar-pct {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}

/* Proposal Body */
.proposal-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.proposal-body h1,
.proposal-body h2,
.proposal-body h3 {
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  margin-top: 24px;
  margin-bottom: 12px;
}

/* Pricing Page */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
}

.pricing-card.featured {
  border-color: var(--accent);
  position: relative;
}

.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-plan-name {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.pricing-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -2px;
  margin-bottom: 4px;
}

.pricing-price span {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
}

.pricing-features {
  list-style: none;
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.pricing-features li {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

/* Crypto Payment Section */
.crypto-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 32px;
}

.crypto-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.crypto-section p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.crypto-addresses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.crypto-address-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.crypto-chain-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crypto-address {
  font-family: 'Space Grotesk', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
  padding: 10px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
  border: 1px solid var(--border);
}

.crypto-address:hover {
  border-color: var(--accent);
}

.copy-btn {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Loading States */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 12px;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-primary);
  z-index: 1000;
  animation: slideUp 0.3s ease;
  max-width: 400px;
}

.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--danger); }

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

/* Footer */
.app-footer {
  padding: 32px 0;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-footer p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .top-nav { flex-wrap: wrap; gap: 12px; }
  .nav-left { gap: 16px; }
  .nav-links { gap: 4px; }
  .proposals-grid { grid-template-columns: 1fr; }
  .analysis-section { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-bar input { min-width: unset; width: 100%; }
  .pricing-grid { grid-template-columns: 1fr; }
  .detail-title { font-size: 22px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .app-footer { flex-direction: column; gap: 8px; text-align: center; }
}

/* Recommendation large badge */
.recommendation-large {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.recommendation-large.for { background: var(--success-dim); }
.recommendation-large.against { background: var(--danger-dim); }
.recommendation-large.abstain { background: var(--info-dim); }

.recommendation-icon {
  font-size: 32px;
}

.recommendation-text h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.recommendation-text p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Analyze button animation */
.btn-analyze {
  position: relative;
  overflow: hidden;
}

.btn-analyze.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-analyze.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0,229,160,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Collapsible sections */
.collapsible-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.collapsible-header::after {
  content: '\25BC';
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.collapsible-header.open::after {
  transform: rotate(180deg);
}

.collapsible-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.collapsible-body.open {
  max-height: 2000px;
}

/* Wallet connect section on pricing */
.wallet-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  margin-bottom: 32px;
}

.wallet-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  margin-bottom: 8px;
}

.wallet-section p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.wallet-options {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.wallet-option {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-width: 140px;
}

.wallet-option:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.wallet-option-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.wallet-option-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.wallet-option-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Wallet Connection Modal */
.wallet-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wallet-modal-overlay.open {
  display: flex;
}

.wallet-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  animation: modalSlideUp 0.25s ease;
}

@keyframes modalSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.wallet-modal-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.wallet-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.wallet-modal-close:hover {
  color: var(--text-primary);
}

.wallet-modal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-modal-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
}

.wallet-modal-option:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.wallet-modal-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 12px;
  flex-shrink: 0;
}

.wallet-modal-name {
  font-size: 15px;
  font-weight: 600;
}

.wallet-modal-chain {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Connected wallet button state */
.wallet-connect-btn.connected {
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
}

/* ═══════════════════════════════════════════════
   AUTH MODAL — Dual auth: Email + Wallet
═══════════════════════════════════════════════ */

.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-modal-overlay.open {
  display: flex;
}

.auth-modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: modalIn 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

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

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.auth-tab.active {
  background: var(--card-bg);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.auth-tab:not(.active):hover {
  color: var(--text-secondary);
}

/* Panels */
.auth-panel {
  min-height: 200px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* Wallet options */
.auth-wallet-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-wallet-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
}

.auth-wallet-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.wallet-icon {
  font-size: 28px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.wallet-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.wallet-chain {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Status messages */
.auth-status {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.auth-status-info {
  background: rgba(0, 229, 160, 0.08);
  border: 1px solid rgba(0, 229, 160, 0.2);
  color: var(--accent);
}

.auth-status-error {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #ff6b6b;
}

/* Email form */
.auth-form-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px;
}

.auth-field {
  margin-bottom: 14px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.auth-field input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
}

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

.auth-error {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: #ff6b6b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

.auth-submit-btn {
  width: 100%;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  margin-top: 4px;
}

.auth-submit-btn:hover:not(:disabled) {
  background: #00ffb3;
  transform: translateY(-1px);
}

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

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 14px 0 0;
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .auth-modal-content {
    padding: 20px;
    border-radius: 12px;
  }

  .auth-tabs {
    margin-bottom: 18px;
  }
}
