/* ═══════════════════════════════════════════
   GLOBAL & LANDING
═══════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.3s ease;
}

/* ── Page System ── */
.page {
  display: none;
  min-height: 100vh;
}
.page.active {
  display: block;
}

/* ── Particle Canvas ── */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Landing Nav ── */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  background: rgba(15,23,42,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}

.nav-brand .brand-icon {
  font-size: 1.6rem;
}

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

.nav-link {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--accent); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 120px 60px 80px;
  position: relative;
  z-index: 1;
  gap: 60px;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 24px;
  animation: fadeIn 0.6s ease both;
}

.badge-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.5s ease infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 20px;
  animation: fadeIn 0.6s 0.1s ease both;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--purple, #a78bfa));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 36px;
  animation: fadeIn 0.6s 0.2s ease both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  animation: fadeIn 0.6s 0.3s ease both;
}

.hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  animation: fadeIn 0.6s 0.4s ease both;
}

.stat-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text);
  font-size: 0.95rem;
}

/* ── Hero Visual ── */
.hero-visual {
  flex: 0 0 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  animation: fadeIn 0.6s 0.2s ease both;
}

.vault-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.vault-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  animation: glow 3s ease-in-out infinite;
}

.vault-body {
  position: relative;
  width: 180px;
  height: 200px;
  background: linear-gradient(145deg, #2a3a50, #1a2a3a);
  border-radius: 20px;
  border: 2px solid rgba(56,189,248,0.3);
  box-shadow: 0 0 40px rgba(56,189,248,0.1);
  overflow: hidden;
  animation: float 6s ease-in-out infinite;
}

.vault-door {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 120px;
  background: linear-gradient(145deg, #2d4060, #1a2940);
  border-radius: 10px;
  border: 1.5px solid rgba(56,189,248,0.4);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.vault-wheel {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3a5070, #1e3050);
  border: 2.5px solid rgba(56,189,248,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: spinSlow 8s linear infinite;
}

.wheel-spoke {
  position: absolute;
  width: 2px;
  height: 60%;
  background: rgba(56,189,248,0.5);
  border-radius: 2px;
}
.wheel-spoke:nth-child(1) { transform: rotate(0deg); }
.wheel-spoke:nth-child(2) { transform: rotate(45deg); }
.wheel-spoke:nth-child(3) { transform: rotate(90deg); }
.wheel-spoke:nth-child(4) { transform: rotate(135deg); }

.vault-handle {
  width: 14px;
  height: 32px;
  background: linear-gradient(to bottom, #4a7090, #2a4060);
  border-radius: 0 6px 6px 0;
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(56,189,248,0.4);
}

.vault-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(to top, rgba(56,189,248,0.7), rgba(56,189,248,0.3));
  transition: height 1.5s ease;
}

/* Floating Coins */
.floating-coins {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  pointer-events: none;
}

.coin {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  animation: float 4s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(245,158,11,0.3);
}
.coin.c1 { top: 20%; left: 10%; animation-delay: 0s; }
.coin.c2 { top: 60%; left: 5%; animation-delay: -1s; }
.coin.c3 { top: 30%; right: 10%; animation-delay: -2s; }
.coin.c4 { top: 70%; right: 15%; animation-delay: -0.5s; }
.coin.c5 { top: 10%; right: 25%; animation-delay: -1.5s; }

/* ── Features Section ── */
.features-section {
  padding: 100px 60px;
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 48px;
  line-height: 1.2;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(56,189,248,0.05), transparent);
  transition: left 0.4s ease;
}

.feature-card:hover::before { left: 100%; }

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

.feature-icon {
  font-size: 1.5rem;
  width: 52px;
  height: 52px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text2);
  line-height: 1.6;
}

/* ── How It Works ── */
.how-section {
  padding: 80px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.steps-container {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 48px;
}

.step {
  flex: 1;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.7;
  line-height: 1;
  flex-shrink: 0;
}

.step-content h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.step-content p {
  font-size: 0.84rem;
  color: var(--text2);
  line-height: 1.5;
}

.step-connector {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0.4;
  flex-shrink: 0;
}

.cta-center {
  text-align: center;
}

/* ── Landing Footer ── */
.landing-footer {
  padding: 40px 60px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text2);
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text3);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0F172A;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-large {
  padding: 16px 28px;
  font-size: 0.95rem;
  border-radius: 14px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  background: transparent;
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text2);
  background: var(--surface);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--danger);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
}

/* ── Form ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
}

.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.form-row .form-group {
  flex: 1;
}

.form-row .form-group.flex-1 {
  flex: 2;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

textarea.form-input {
  resize: vertical;
  min-height: 70px;
}

.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.input-with-prefix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input-prefix {
  padding: 10px 12px;
  color: var(--text2);
  font-weight: 600;
  background: var(--surface);
  border-right: 1px solid var(--border);
  font-size: 0.9rem;
}
.input-with-prefix input {
  border: none;
  background: transparent;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  flex: 1;
}

/* Emoji picker */
.emoji-picker {
  position: relative;
}

.emoji-input {
  font-size: 1.3rem;
  text-align: center;
  width: 56px;
  padding: 8px;
  cursor: pointer;
}

.emoji-options {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: none;
  width: 240px;
  font-size: 1.3rem;
  line-height: 1.8;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  letter-spacing: 2px;
}
.emoji-options.show { display: block; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-sm { max-width: 400px; }
.modal-xs { max-width: 320px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}
.modal-close:hover { color: var(--text); background: var(--bg); }

.modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Transaction Modal */
.tx-type-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
}

.tx-type-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tx-type-btn.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}
.tx-type-btn.active.withdrawal {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.goal-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.gp-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 8px;
}

.gp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.gp-bar {
  flex: 1;
  height: 6px;
  background: var(--surface2);
  border-radius: 6px;
  overflow: hidden;
}

.gp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #86efac);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.gp-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.gp-amounts {
  font-size: 0.78rem;
  color: var(--text2);
}

/* Confirm modal */
.confirm-icon {
  font-size: 2.5rem;
  color: var(--warning);
  text-align: center;
  margin-bottom: 8px;
}

#confirm-message {
  text-align: center;
  color: var(--text2);
  font-size: 0.9rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }
