/* OBSCURA — the look of the account: ink-black, one electric blue, and the
   stacked planes of the shielded pool. Nothing decorative that does not carry
   meaning: layers are the pool, glow is activity, mono type is a fact. */

:root {
  --ink: #04060d;
  --ink-2: #070b16;
  --panel: rgba(11, 17, 33, 0.62);
  --panel-solid: #0a1020;
  --line: rgba(118, 150, 220, 0.16);
  --line-strong: rgba(118, 150, 220, 0.34);

  --blue: #0657fe;
  --blue-hi: #3d82ff;
  --blue-soft: #8fb6ff;
  --blue-dim: rgba(6, 87, 254, 0.16);

  --text: #e9eefb;
  --muted: #8192b0;
  --faint: #5a6782;
  --good: #3ddc97;
  --warn: #ffb45c;
  --bad: #ff6b6b;

  --r: 14px;
  --r-sm: 9px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* the pool, behind everything */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
#bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* the mask, sitting inside the stack */
#bg .bg-mask {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(42vw, 520px);
  transform: translate(-50%, -50%);
  opacity: 0.1;
  filter: drop-shadow(0 0 70px rgba(6, 87, 254, 0.75)) drop-shadow(0 0 160px rgba(6, 87, 254, 0.4));
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.085; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.14; transform: translate(-50%, -52%) scale(1.035); }
}

/* glow above, horizon below, and a grain so the flats are not flat */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(100% 62% at 50% -8%, rgba(6, 87, 254, 0.2), transparent 68%),
    radial-gradient(120% 46% at 50% 106%, rgba(6, 87, 254, 0.14), transparent 70%),
    radial-gradient(70% 52% at 50% 46%, rgba(2, 4, 10, 0.55), transparent 72%);
}
body::before {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.wrap { position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: -0.035em; line-height: 1.08; margin: 0; font-weight: 600; }
h1 { font-size: clamp(38px, 7vw, 76px); }
h2 { font-size: clamp(24px, 3.4vw, 36px); }
h3 { font-size: 18px; }
p { margin: 0 0 14px; color: var(--muted); }
.mono { font-family: var(--mono); font-variant-ligatures: none; }

.shell { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ----------------------------------------------------------------- header */

header.top {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(4, 6, 13, 0.92), rgba(4, 6, 13, 0.62));
  border-bottom: 1px solid var(--line);
}
.top .shell {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: 0.14em; font-size: 13px; }
.brand img {
  width: 30px;
  height: 30px;
  display: block;
  filter: drop-shadow(0 0 10px rgba(6, 87, 254, 0.55));
  transition: filter 0.2s, transform 0.2s;
}
.brand:hover img { filter: drop-shadow(0 0 16px rgba(6, 87, 254, 0.9)); transform: translateY(-1px); }
nav.main { display: flex; gap: 2px; margin-left: 8px; flex: 1; }
nav.main a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
nav.main a:hover { color: var(--text); background: rgba(118, 150, 220, 0.07); }
nav.main a.on { color: var(--text); background: rgba(6, 87, 254, 0.16); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(118, 150, 220, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
  white-space: nowrap;
}
.btn:hover { background: rgba(118, 150, 220, 0.12); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--blue);
  border-color: transparent;
  box-shadow: 0 8px 26px rgba(6, 87, 254, 0.38);
}
.btn.primary:hover { background: var(--blue-hi); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: 0.42; cursor: not-allowed; transform: none; }
.btn.big { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn.wide { width: 100%; }

/* ----------------------------------------------------------------- panels */

.panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
}
.panel.tight { padding: 14px 16px; }
.panel h3 { margin-bottom: 4px; }

.label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
}

.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 14px; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }

/* ------------------------------------------------------------------ forms */

input, select, textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(4, 7, 16, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(6, 87, 254, 0.7);
  box-shadow: 0 0 0 3px rgba(6, 87, 254, 0.16);
}
input.mono, textarea.mono { font-family: var(--mono); font-size: 13px; letter-spacing: -0.02em; }
textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 84px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.field { display: grid; gap: 7px; }
.field > .label { margin-bottom: -1px; }

.amount-wrap { position: relative; }
.amount-wrap input { height: 62px; font-size: 26px; font-family: var(--mono); padding-right: 118px; }
.amount-wrap .suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
}
.chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(118, 150, 220, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.chip:hover { color: var(--text); }

/* ------------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 4px; padding: 4px; background: rgba(4, 7, 16, 0.6); border: 1px solid var(--line); border-radius: 12px; }
.tabs button {
  flex: 1;
  height: 38px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tabs button.on { background: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(6, 87, 254, 0.35); }
.tabs button:not(.on):hover { color: var(--text); background: rgba(118, 150, 220, 0.07); }

/* ------------------------------------------------------------------ misc */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.pill.blue { color: var(--blue-soft); border-color: rgba(6, 87, 254, 0.4); background: rgba(6, 87, 254, 0.1); }

.stat { display: grid; gap: 3px; }
.stat .v { font-family: var(--mono); font-size: 22px; letter-spacing: -0.03em; }
.stat .k { font-size: 12px; color: var(--faint); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
}
td { padding: 11px 10px; border-bottom: 1px solid rgba(118, 150, 220, 0.08); color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-family: var(--mono); }
td strong { color: var(--text); font-weight: 500; }

.empty { color: var(--faint); font-size: 13.5px; padding: 26px 0; text-align: center; }

footer.bottom {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 26px 0 40px;
  color: var(--faint);
  font-size: 13px;
}
footer.bottom .shell { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
footer.bottom a:hover { color: var(--text); }

/* ----------------------------------------------------------------- toasts */

#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: rise 0.2s ease-out;
}
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--good); }
.toast .t { font-weight: 600; margin-bottom: 2px; }
.toast .d { color: var(--muted); font-size: 12.5px; word-break: break-word; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ steps */

.steps { display: grid; gap: 10px; }
.step { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--faint); }
.step .mark {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  flex: 0 0 18px; margin-top: 1px;
  display: grid; place-items: center; font-size: 10px;
}
.step.on { color: var(--text); }
.step.on .mark { border-color: var(--blue); color: var(--blue-soft); }
.step.done { color: var(--muted); }
.step.done .mark { background: var(--blue); border-color: var(--blue); color: #fff; }
.spin { width: 11px; height: 11px; border: 2px solid rgba(255,255,255,.25); border-top-color: var(--blue-soft); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  nav.main { display: none; }
  .top .shell { height: 56px; }
}
