:root {
  --bg: #0a0e17;
  --bg-card: #111827;
  --bg-input: #1a2234;
  --border: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #f0b90b;
  --primary-hover: #d4a009;
  --success: #22c55e;
  --error: #ef4444;
  --info: #3b82f6;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.navbar {
  background: rgba(17, 24, 39, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-icon {
  color: var(--primary);
  font-size: 1.4rem;
}

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

.wallet-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.wallet-addr {
  color: var(--primary);
  font-weight: 500;
}

.wallet-bal {
  margin-left: 10px;
  padding: 2px 8px;
  background: var(--bg-input);
  border-radius: 6px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.hero-desc strong { color: var(--primary); }

.referral-banner {
  width: 100%;
  margin: 16px 0 8px;
  padding: 16px 18px;
  text-align: left;
  background: linear-gradient(135deg, rgba(240, 185, 11, 0.1), rgba(17, 24, 39, 0.9));
  border: 1px solid rgba(240, 185, 11, 0.35);
  border-radius: 12px;
  box-sizing: border-box;
}

.referral-banner h3 {
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 8px;
}

.referral-banner p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.referral-banner ul {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.referral-banner li {
  font-size: 0.9rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.referral-banner li span {
  color: var(--primary);
  font-weight: 600;
}

.referral-banner ul li:last-child {
  border-bottom: none;
}

.invite-row {
  display: flex;
  gap: 8px;
  margin: 10px 0 6px;
}

.invite-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8rem;
}

.invite-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

#refTip:not(.hidden) {
  color: var(--success);
  margin-bottom: 6px;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: stretch;
}

.form-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.form-card .btn-lg {
  margin-top: auto;
}

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

.form-card h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 10px;
}

.mode-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.mode-tab.active {
  background: var(--primary);
  color: #000;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

textarea {
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.feature-desc-panel {
  width: 100%;
  margin: 8px 0 20px;
  padding: 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.feature-desc-panel h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.feature-desc-panel .hint {
  margin-bottom: 12px;
}

.feature-desc-input {
  display: block;
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feature-desc-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.12);
}

.feature-desc-input::placeholder {
  color: #64748b;
  opacity: 0.9;
}

.info-box {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
}

.info-box h4 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.info-box ul {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.info-box li::before {
  content: "✓ ";
  color: var(--success);
}

.feature-preview {
  margin-top: 16px;
  padding: 16px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
}

.feature-preview h4 {
  color: var(--success);
  margin-bottom: 8px;
}

.preview-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.preview-list {
  list-style: none;
  font-size: 0.85rem;
}

.preview-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary {
  background: var(--primary);
  color: #000;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-lg {
  padding: 16px;
  font-size: 1rem;
  margin-top: 8px;
}

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

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline.connected { border-color: var(--success); color: var(--success); }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
  margin-top: 10px;
}

.btn-secondary:hover:not(:disabled) { border-color: var(--primary); }

.btn-analyze {
  width: 100%;
  margin-top: 14px;
  padding: 14px 20px;
  background: rgba(240, 185, 11, 0.08);
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.12);
  font-weight: 700;
}

.btn-analyze:hover:not(:disabled) {
  background: rgba(240, 185, 11, 0.18);
  box-shadow: 0 0 0 4px rgba(240, 185, 11, 0.2);
}

.btn-analyze:disabled {
  opacity: 0.6;
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
}

.sidebar .card {
  margin-bottom: 16px;
}

.sidebar .support-card {
  margin-top: auto;
  margin-bottom: 0;
}

.sidebar h3 { font-size: 0.95rem; margin-bottom: 14px; }

.steps {
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--bg-input);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}

.fee-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.875rem;
}

.fee-row strong { color: var(--primary); }

.wallet-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wallet-logos span {
  padding: 6px 12px;
  background: var(--bg-input);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-card {
  margin-top: 24px;
  text-align: center;
}

.success-box h3 { color: var(--success); margin-bottom: 12px; }
.success-box a { color: var(--primary); word-break: break-all; }
.progress { color: var(--info); }

.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 999;
  max-width: 90%;
  text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--error); color: #fff; }
.toast.info { background: var(--info); color: #fff; }

.hidden { display: none !important; }

@media (max-width: 768px) {
  .main-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
  .form-row { grid-template-columns: 1fr; }
  .nav-inner { padding: 12px 16px; }
}
