:root {
  color-scheme: dark;
  --bg: #0b0f13;
  --bg-soft: #10161d;
  --surface: #141c24;
  --surface-2: #1a242e;
  --line: #24313d;
  --ink: #e9eef3;
  --ink-2: #9fb0bf;
  --ink-3: #6d8090;
  --accent: #199e70;
  --accent-soft: rgba(25, 158, 112, .14);
  --series-1: #3987e5;   /* приём */
  --series-3: #199e70;   /* отдача */
  --danger: #e66767;
  --warn: #c98500;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.02em; }
h1 { font-size: clamp(32px, 6vw, 56px); }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
p { margin: 0 0 1em; color: var(--ink-2); }
.wrap { width: min(1120px, 92vw); margin: 0 auto; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }

/* ── шапка ─────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 19, .78);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; font-size: 18px; color: var(--ink); }
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.top nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── кнопки ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 550;
  cursor: pointer; transition: transform .12s ease, background .15s ease, border-color .15s ease;
  text-decoration: none;
}
.btn:hover { background: #22303c; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: transparent; color: #04140e; }
.btn.primary:hover { background: #1cb280; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: default; }

input, select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink); font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-size: 14px; color: var(--ink-2); margin: 0 0 6px; }
.field { margin-bottom: 14px; }

/* ── лендинг ───────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 92px 0 72px; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto -20%; height: 620px;
  background:
    radial-gradient(600px 320px at 22% 30%, rgba(25, 158, 112, .30), transparent 62%),
    radial-gradient(560px 300px at 78% 12%, rgba(57, 135, 229, .26), transparent 60%);
  filter: blur(6px);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate3d(-16px, 0, 0) } to { transform: translate3d(16px, 18px, 0) } }
@media (prefers-reduced-motion: reduce) { .hero::before { animation: none } }
.hero .wrap { position: relative; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; margin-bottom: 22px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(20, 28, 36, .7);
  font-size: 13px; color: var(--ink-2);
}
.badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); max-width: 620px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 72px 0; }
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.card h3 { font-size: 17px; }
.card p { margin: 0; font-size: 15px; }
.card .ico { font-size: 22px; margin-bottom: 12px; display: block; }

.steps { counter-reset: s; display: grid; gap: 14px; margin: 0 0 72px; padding: 0; list-style: none; }
.steps li {
  counter-increment: s; position: relative; padding: 18px 20px 18px 62px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.steps li::before {
  content: counter(s); position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.foot { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--ink-3); font-size: 14px; }

/* ── кабинет ───────────────────────────────────────────────────────── */
.page { padding: 28px 0 64px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.tile .k { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.tile .v { font-size: 28px; font-weight: 650; letter-spacing: -.02em; }
.tile .v small { font-size: 15px; font-weight: 500; color: var(--ink-3); margin-left: 4px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.panel > header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel > header h2 { font-size: 19px; margin: 0; }
.panel > header .sp { margin-left: auto; }

.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

.dev { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  padding: 16px 0; border-top: 1px solid var(--line); }
.dev:first-of-type { border-top: none; }
.dev .name { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.dev .meta { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.dev .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.state { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.state.on { color: var(--accent); border-color: rgba(25, 158, 112, .4); background: var(--accent-soft); }

.inv { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.inv:first-of-type { border-top: none; }
.inv .u { flex: 1 1 320px; font-size: 13px; word-break: break-all; color: var(--ink-2); }

/* ── модалка ───────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(5, 8, 11, .72); display: grid; place-items: center; padding: 20px; z-index: 40; }
.modal[hidden] { display: none; }
.modal .box { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px;
  width: min(460px, 94vw); box-shadow: var(--shadow); max-height: 92vh; overflow: auto; }
.qr { background: #fff; border-radius: 14px; padding: 14px; display: grid; place-items: center;
  margin: 0 auto 16px; max-width: 300px; }
.qr svg { width: 100%; height: auto; display: block; }
.conf { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; color: var(--ink-2); max-height: 190px; overflow: auto; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 60; }
.toast[hidden] { display: none; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; }

.center-card { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.center-card .box { width: min(400px, 94vw); background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 30px; box-shadow: var(--shadow); }

@media (max-width: 560px) {
  .dev { grid-template-columns: 1fr; }
  .dev .acts { justify-content: flex-start; }
}
