/* AUREA Tools — dark theme matched to aureaswap.com / the staking app.
   Same palette as ~/workspace/aurea-staking/frontend/styles.css:
     bg #0a0f1e, card #121626, gold #ffd700, violet #8a2be2,
     brand gradient linear-gradient(45deg, #ffd700 6.62%, #8a2be2 86.5%),
     font 'Manrope', sans-serif.                                       */
:root {
  --bg: #0a0f1e;
  --bg-deep: #020616;
  --card: #121626;
  --card-2: #141828;
  --panel: #0f1423;
  --border: #282d3c;
  --text: #ffffff;
  --muted: #848388;
  --muted-2: #626066;
  --gold: #ffd700;
  --gold-light: #ffeb50;
  --gold-dark: #c8aa00;
  --gold-soft: rgba(255, 215, 0, 0.1);
  --violet: #8a2be2;
  --violet-soft: rgba(138, 43, 226, 0.16);
  --violet-text: #c9a7f5;
  --green: #02b589;
  --red: #e94d7a;
  --warning: #d9ab52;
  --input-bg: #0e1222;
  --gradient-brand: linear-gradient(45deg, #ffd700 6.62%, #8a2be2 86.5%);
  --on-primary: #141828;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "PingFang SC", "Noto Sans CJK SC", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  padding-bottom: 110px; /* room for the floating bottom nav */
}

a { color: var(--gold); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.small { font-size: 12.5px; }

/* --- header ------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(10, 15, 30, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient-brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: var(--on-primary);
  flex: none;
}
.page-title { font-size: 19px; font-weight: 800; color: var(--text); white-space: nowrap; }
.page-subtitle { font-size: 12px; color: var(--muted); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.badge {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 4px 10px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-muted { background: var(--input-bg); color: var(--muted); }
.badge-ok { background: rgba(2, 181, 137, 0.15); color: #2fd3a7; }
.badge-warn { background: rgba(217, 171, 82, 0.15); color: var(--warning); }
.badge-violet { background: var(--violet-soft); color: var(--violet-text); }
.network-badge { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }

select.network-select {
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 8px; font: inherit; font-size: 13px; font-weight: 700;
  max-width: 38vw;
}

select.lang-select {
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 8px; font: inherit; font-size: 13px; font-weight: 700;
  max-width: 30vw;
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; }
  .network-badge { display: none; }
}

/* --- alerts / status ---------------------------------------------------- */
.alert {
  margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.5;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.alert-warn { background: rgba(217, 171, 82, 0.12); border: 1px solid rgba(217, 171, 82, 0.45); color: #f3d9a4; }
.alert-error { background: rgba(233, 77, 122, 0.12); border: 1px solid rgba(233, 77, 122, 0.45); color: #f6b8cb; }
.alert-ok { background: rgba(2, 181, 137, 0.12); border: 1px solid rgba(2, 181, 137, 0.45); color: #a9e9d8; }
.alert-info { background: var(--violet-soft); border: 1px solid rgba(138, 43, 226, 0.5); color: #e2d2fb; }

/* --- layout / cards ------------------------------------------------------ */
main { max-width: 860px; margin: 0 auto; padding: 18px 16px 8px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.card h3 { margin: 18px 0 8px; font-size: 15px; font-weight: 800; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  font: inherit; font-weight: 700; font-size: 14.5px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--card-2); color: var(--text);
  padding: 11px 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: var(--muted-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--gradient-brand); color: var(--on-primary);
  border: none; font-weight: 800;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-connect { padding: 9px 16px; font-size: 14px; }
.btn-small { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-ghost { background: transparent; }

/* --- forms ----------------------------------------------------------------- */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 13px; font-weight: 700;
  color: var(--muted); margin-bottom: 6px;
}
.field input[type="text"], .field input[type="number"], .field textarea {
  width: 100%; background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 12px; font: inherit; font-size: 15px;
}
.field textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; line-height: 1.6; min-height: 170px; resize: vertical;
}
.field input:focus, .field textarea:focus, select:focus {
  outline: 2px solid rgba(255, 215, 0, 0.55); outline-offset: 0; border-color: var(--gold-dark);
}
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.check-row input[type="checkbox"] { width: 19px; height: 19px; margin-top: 1px; accent-color: var(--gold); flex: none; }
.check-row .check-text { font-size: 14.5px; font-weight: 700; }
.check-row .check-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; line-height: 1.5; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- mode tabs (BNB / Token) ------------------------------------------------ */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1; font: inherit; font-weight: 800; font-size: 15px;
  padding: 11px 10px; border-radius: 12px; cursor: pointer;
  background: var(--input-bg); color: var(--muted);
  border: 1px solid var(--border);
}
.tab.active { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-dark); }

/* --- summary / rows ------------------------------------------------------------ */
.rows { margin-top: 6px; }
.row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.row:last-child { border-bottom: none; }
.row .k { color: var(--muted); font-weight: 600; flex: none; }
.row .v { font-weight: 800; text-align: right; word-break: break-all; }
.row .v.ok { color: #2fd3a7; }
.row .v.bad { color: var(--red); }
.row .v.warn { color: var(--warning); }

/* --- steps (approve -> disperse) ------------------------------------------------ */
.steps { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 150px; border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; background: var(--panel); font-size: 13.5px;
}
.step .step-title { font-weight: 800; font-size: 14px; margin-bottom: 3px; }
.step .step-state { color: var(--muted); }
.step.done { border-color: rgba(2, 181, 137, 0.55); }
.step.done .step-state { color: #2fd3a7; }
.step.current { border-color: var(--gold-dark); }
.step.current .step-state { color: var(--gold); }

/* --- lists / tables -------------------------------------------------------------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .li-main { min-width: 0; }
.list-item .li-title { font-weight: 800; font-size: 15px; }
.list-item .li-sub { color: var(--muted); font-size: 12.5px; word-break: break-all; }
.error-list { margin: 8px 0 0; padding-left: 18px; color: #f6b8cb; font-size: 13px; line-height: 1.6; }

/* --- bottom nav --------------------------------------------------------------------- */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px;
  z-index: 30; display: flex; gap: 4px;
  background: rgba(18, 22, 38, 0.95); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.nav-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px;
  color: var(--muted); text-decoration: none;
  font-size: 13.5px; font-weight: 800; white-space: nowrap;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item.active { background: var(--gold-soft); color: var(--gold); }
