/* ============================================================
   Единая тема. Тёмная, спокойная, без визуального шума.
   ============================================================ */

:root {
  --bg: #0a0b0d;
  --bg-glow: #141227;
  --panel: #101216;
  --panel-2: #16181d;
  --panel-3: #1b1e24;
  --border: #23262d;
  --border-hi: #31353e;
  --text: #eceef2;
  --muted: #9aa1ad;
  --dim: #626a78;
  --accent: #7c6cff;
  --accent-hi: #9284ff;
  --accent-soft: rgba(124, 108, 255, 0.12);
  --good: #35d07f;
  --good-soft: rgba(53, 208, 127, 0.12);
  --warn: #f5b942;
  --warn-soft: rgba(245, 185, 66, 0.12);
  --bad: #ff5f6d;
  --bad-soft: rgba(255, 95, 109, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.9);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent-soft);
}

/* ----------------------------- типографика ----------------------------- */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 640;
  letter-spacing: -0.022em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(34px, 5.2vw, 54px);
}

h2 {
  font-size: 19px;
}

h3 {
  font-size: 15px;
  font-weight: 600;
}

p {
  margin: 0;
}

.mono {
  font-family: var(--mono);
  font-size: 13.5px;
}

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
}

.small {
  font-size: 13px;
}

.tiny {
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

/* ------------------------------- каркас ------------------------------- */

.glow {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 620px;
  background:
    radial-gradient(60% 55% at 30% 0%, rgba(124, 108, 255, 0.22), transparent 70%),
    radial-gradient(45% 45% at 75% 5%, rgba(56, 160, 255, 0.13), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), #48b0ff);
  box-shadow: 0 0 18px rgba(124, 108, 255, 0.8);
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.topbar nav a {
  color: var(--muted);
  transition: color 0.15s;
}

.topbar nav a:hover {
  color: var(--text);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

/* ------------------------------ лендинг ------------------------------ */

.landing {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas:
    "hero form"
    "steps steps";
  gap: 40px 56px;
  align-items: start;
  padding-top: 40px;
}

.landing > .hero {
  grid-area: hero;
}

.landing > .auth-card {
  grid-area: form;
}

.landing > .steps {
  grid-area: steps;
}

.hero .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-hi);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 26px;
}

.hero .pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 10px var(--good);
}

.hero h1 {
  margin-bottom: 20px;
  background: linear-gradient(180deg, #ffffff 20%, #b9b9cd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  max-width: 480px;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.62;
}

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

.step {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.018);
}

.step-num {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-hi);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.step h4 {
  font-size: 13.5px;
  margin-bottom: 4px;
}

.step p {
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.5;
}

/* ------------------------------- карточки ------------------------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.card-head p {
  color: var(--dim);
  font-size: 12.5px;
  margin-top: 3px;
}

.auth-card {
  padding: 26px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}

.auth-card .label:not(:first-child) {
  margin-top: 16px;
}

/* -------------------------------- поля -------------------------------- */

.label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 7px;
  font-weight: 500;
}

.input,
.select,
textarea.input {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: #0c0e11;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  outline: none;
}

.input::placeholder {
  color: #4d5460;
}

.input:focus,
.select:focus,
textarea.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input.mono {
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 14px;
}

.input.mono.lower {
  text-transform: none;
  letter-spacing: 0;
}

.field {
  margin-bottom: 14px;
}

.field-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ------------------------------ кнопки ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 17px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hi);
  background: var(--panel-3);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.06s,
    opacity 0.15s;
  white-space: nowrap;
}

.btn:hover {
  background: #22262e;
  border-color: #3b4049;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px -12px rgba(124, 108, 255, 0.9);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #a094ff, #8a7bff);
  border-color: transparent;
}

.btn-block {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
}

.btn-sm {
  padding: 7px 11px;
  font-size: 12.5px;
  border-radius: 8px;
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  color: #ff8b95;
  border-color: rgba(255, 95, 109, 0.3);
  background: transparent;
}

.btn-danger:hover {
  background: var(--bad-soft);
  border-color: rgba(255, 95, 109, 0.5);
}

/* ------------------------------- бейджи ------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 560;
  border: 1px solid var(--border-hi);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.badge-good {
  color: var(--good);
  border-color: rgba(53, 208, 127, 0.28);
  background: var(--good-soft);
}

.badge-warn {
  color: var(--warn);
  border-color: rgba(245, 185, 66, 0.28);
  background: var(--warn-soft);
}

.badge-bad {
  color: #ff8b95;
  border-color: rgba(255, 95, 109, 0.3);
  background: var(--bad-soft);
}

.badge-accent {
  color: var(--accent-hi);
  border-color: rgba(124, 108, 255, 0.3);
  background: var(--accent-soft);
}

/* ------------------------------ дашборд ------------------------------ */

.dash {
  display: grid;
  gap: 18px;
  padding-top: 14px;
}

.balance {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}

.balance-num {
  font-size: 40px;
  font-weight: 660;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.balance-sub {
  color: var(--dim);
  font-size: 12.5px;
  margin-top: 6px;
}

.progress {
  height: 7px;
  border-radius: 99px;
  background: #1a1d23;
  overflow: hidden;
  margin-top: 12px;
}

.progress > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #48b0ff);
  transition: width 0.5s ease;
}

.balance-stats {
  display: flex;
  gap: 26px;
  text-align: right;
}

.balance-stats div span {
  display: block;
  font-size: 11.5px;
  color: var(--dim);
}

.balance-stats div b {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dash-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
  align-items: start;
}

/* ------------------------------- списки ------------------------------- */

.list {
  display: grid;
  gap: 2px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row .name {
  font-size: 13.5px;
}

.list-row .sub {
  font-size: 12px;
  color: var(--dim);
  margin-top: 2px;
}

/* ------------------------------- таблицы ------------------------------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 -6px;
}

table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-weight: 520;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  padding: 0 10px 9px;
  white-space: nowrap;
}

td {
  padding: 11px 10px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.014);
}

.num {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
}

/* -------------------------------- код -------------------------------- */

.code-block {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0b0d10;
  overflow: hidden;
}

.code-block header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 11.5px;
  color: var(--dim);
}

.code-block pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #c9d1de;
  tab-size: 2;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0b0d10;
}

.copy-row .value {
  flex: 1;
  font-family: var(--mono);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #cfd5e1;
}

/* ------------------------------- табы ------------------------------- */

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #0c0e11;
  border: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}

.tab {
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border: 0;
  background: transparent;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--panel-3);
  color: var(--text);
  font-weight: 550;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

/* ------------------------------ подсказки ------------------------------ */

.hint {
  font-size: 12.5px;
  color: var(--dim);
  line-height: 1.55;
}

.callout {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.callout strong {
  color: var(--text);
  font-weight: 560;
}

.callout-warn {
  border-color: rgba(245, 185, 66, 0.25);
  background: var(--warn-soft);
  color: #e8cd93;
}

.callout-accent {
  border-color: rgba(124, 108, 255, 0.28);
  background: var(--accent-soft);
  color: #c3bcff;
}

/* ------------------------------- тосты ------------------------------- */

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 9px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 36px));
}

.toast {
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid var(--border-hi);
  background: #171a20;
  box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.9);
  font-size: 13px;
  animation: toast-in 0.18s ease;
}

.toast.bad {
  border-color: rgba(255, 95, 109, 0.4);
  background: #241519;
}

.toast.good {
  border-color: rgba(53, 208, 127, 0.35);
  background: #12211a;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ------------------------------- модалка ------------------------------- */

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 7, 0.72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 90;
}

.modal {
  width: min(520px, 100%);
  background: var(--panel-2);
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 40px 90px -30px #000;
}

.modal h2 {
  margin-bottom: 6px;
}

/* --------------------------- пустое состояние --------------------------- */

.empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius-sm);
}

/* ------------------------------- адаптив ------------------------------- */

@media (max-width: 900px) {
  .landing {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "form"
      "steps";
    gap: 26px;
    padding-top: 18px;
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .balance {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .balance-stats {
    text-align: left;
    gap: 22px;
  }
}

@media (max-width: 560px) {
  .wrap {
    padding: 0 16px 56px;
  }
  .topbar {
    padding: 16px;
  }
  .card {
    padding: 18px;
    border-radius: 14px;
  }
  .field-inline {
    grid-template-columns: 1fr;
  }
  .balance-num {
    font-size: 32px;
  }
  .topbar nav {
    gap: 12px;
    font-size: 13px;
  }
}

/* ------------------------------ утилиты ------------------------------ */

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.mt-8 {
  margin-top: 8px;
}
.mt-14 {
  margin-top: 14px;
}
.mt-20 {
  margin-top: 20px;
}
.mb-10 {
  margin-bottom: 10px;
}
.grow {
  flex: 1;
}
.hidden {
  display: none !important;
}
.checkbox-list {
  display: grid;
  gap: 1px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: #0b0d10;
}

.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  font-family: var(--mono);
  cursor: pointer;
}

.checkbox-list label:hover {
  background: rgba(255, 255, 255, 0.03);
}

.checkbox-list input {
  accent-color: var(--accent);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.018);
}

.stat span {
  display: block;
  font-size: 11.5px;
  color: var(--dim);
  margin-bottom: 6px;
}

.stat b {
  font-size: 23px;
  font-weight: 640;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
