@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg-deep: #060a14;
  --bg-card: rgba(22, 27, 44, 0.7);
  --border-soft: rgba(148, 163, 184, 0.14);
  --accent: #7c5cff;
  --accent-2: #36e3c4;
  --text: #eef1fb;
  --text-dim: #8b93ad;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: radial-gradient(circle at 20% 0%, #1a1442 0%, var(--bg-deep) 45%),
              radial-gradient(circle at 90% 90%, #0c2b33 0%, var(--bg-deep) 50%),
              var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-container, .wallet-container {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 60px -10px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02) inset;
  backdrop-filter: blur(18px);
  animation: rise .4s ease both;
}

.wallet-container { max-width: 660px; }

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

h1 {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 26px;
  line-height: 1.5;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all .2s ease;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), #5a3fd6);
  color: white;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.4);
}

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form.hidden { display: none; }
.hidden { display: none !important; }

input {
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input::placeholder { color: var(--text-dim); }

select {
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

button[type="submit"], .btn {
  padding: 13px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #5a3fd6);
  color: white;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.92rem;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  box-shadow: 0 8px 24px -6px rgba(124, 92, 255, 0.45);
}

button[type="submit"]:hover, .btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

button[type="submit"]:active, .btn:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  box-shadow: none;
  border: 1px solid var(--border-soft);
  color: var(--text);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); filter: none; }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 8px 24px -6px rgba(239, 68, 68, 0.4);
}

.error { color: #ff8a8a; font-size: 0.85rem; min-height: 1em; }

.disclaimer {
  margin-top: 22px;
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.6;
  border-top: 1px solid var(--border-soft);
  padding-top: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}

.topbar span { color: var(--text-dim); font-size: 0.9rem; font-weight: 500; }

h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 18px 0 8px;
  color: var(--text);
}

.seed-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0,0,0,0.3);
  border: 1px dashed var(--border-soft);
  border-radius: 12px;
  padding: 16px;
  margin: 10px 0;
}

.seed-word {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 9px;
  font-size: 0.85rem;
  text-align: center;
  transition: filter .2s ease;
}

.seed-word span { color: var(--accent-2); font-weight: 700; margin-right: 4px; }

.blurred .seed-word { filter: blur(6px); user-select: none; }

.address-box {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 13px 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  word-break: break-all;
  margin: 8px 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.warning-box {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde68a;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 18px;
}

.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.actions .btn { flex: 1; min-width: 140px; }

.empty-state { text-align: center; color: var(--text-dim); padding: 48px 0; }

.chain-card {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.chain-card .chain-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chain-card .chain-name {
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chain-card .chain-balance {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-2);
}

.chain-card .chain-balance.loading { color: var(--text-dim); font-weight: 500; }
.chain-card .chain-balance.error { color: #ff8a8a; font-weight: 500; font-size: 0.78rem; }

.chain-card .address-box { margin: 0; }

.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(10, 14, 26, 0.85);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(14px);
  z-index: 100;
}

.app-nav-brand {
  font-weight: 800;
  font-size: 1.05rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.app-nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all .2s ease;
}

.app-nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.app-nav-links a.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), #5a3fd6);
}

.app-nav-logout { padding: 9px 16px; font-size: 0.85rem; }

.page-body {
  padding-top: 90px;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.page-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 36px;
  width: 100%;
  max-width: 700px;
  margin: 24px;
  box-shadow: 0 24px 60px -10px rgba(0,0,0,0.6);
  backdrop-filter: blur(18px);
  animation: rise .4s ease both;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.dashboard-card {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform .2s ease, border-color .2s ease;
  display: block;
}

.dashboard-card:hover { transform: translateY(-3px); border-color: var(--accent); }

.dashboard-card .icon { font-size: 1.6rem; margin-bottom: 10px; }
.dashboard-card .title { font-weight: 700; margin-bottom: 4px; }
.dashboard-card .desc { font-size: 0.82rem; color: var(--text-dim); }

@media (max-width: 640px) {
  .app-nav { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .app-nav-links { order: 3; width: 100%; justify-content: space-between; }
}

.chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 200; }

.chat-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), #5a3fd6);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 10px 30px -6px rgba(124, 92, 255, 0.6);
}

.chat-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  max-height: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px -10px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel.hidden { display: none; }

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-weight: 700;
  font-size: 0.9rem;
}

.chat-close { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1rem; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
}

.chat-msg {
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  max-width: 85%;
  white-space: pre-wrap;
}

.chat-msg-bot { background: rgba(255,255,255,0.06); align-self: flex-start; }
.chat-msg-user { background: linear-gradient(135deg, var(--accent), #5a3fd6); color: white; align-self: flex-end; }
.chat-msg-loading { color: var(--text-dim); font-style: italic; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border-soft);
}

.chat-input-row input {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.85rem;
}

.chat-input-row button {
  width: 40px;
  padding: 0;
}
