/* Шлюз «Аналитика Fusion»: малахит и рубин, как в программе */
:root {
  --bg: #e9f0ec; --panel: #fff; --panel2: #f3f7f5; --text: #11231b; --muted: #5b6e64;
  --line: #d6e1db; --accent: #12764e; --accent-2: #0c5a3b; --accent-soft: #e0f2e8;
  --ruby: #b3122e; --ruby-soft: #fbe7eb; --ok: #128a50; --ok-soft: #e1f4e9;
  --err: #c4243b; --err-soft: #fde9ec; --warn: #a96500; --warn-soft: #fff3dc;
  --deep: #082c20; --deep-2: #041a12; --gold: #c8a86a;
  --shadow: 0 1px 1px rgba(8,44,32,.04), 0 18px 40px -18px rgba(8,44,32,.35);
  --sans: "Segoe UI Variable Text", "Segoe UI", -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "P052", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #06120d; --panel: #0e1f18; --panel2: #13281f; --text: #e3eee8; --muted: #8ea398;
    --line: #1f3a2d; --accent: #33c283; --accent-2: #5ad69f; --accent-soft: #11372a;
    --ruby: #ff5a72; --ruby-soft: #3a1520; --ok: #3fd68b; --ok-soft: #113524;
    --err: #ff5d73; --err-soft: #3b1720; --warn: #f0b04a; --warn-soft: #3a2e14;
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 44px -18px rgba(0,0,0,.85);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--sans); color: var(--text); background: var(--bg); min-height: 100vh; }
a { color: var(--accent); }
.stage { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); }
.brand { background: radial-gradient(120% 90% at 10% 0%, #15563d 0%, var(--deep) 45%, var(--deep-2) 100%);
  color: #d7e6de; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; }
.brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px;
  border-radius: 50%; border: 1px solid rgba(200,168,106,.25); box-shadow: 0 0 0 40px rgba(200,168,106,.05), 0 0 0 80px rgba(200,168,106,.03); }
.brand .mark { display: flex; align-items: center; gap: 14px; }
.brand .mark b { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: var(--ruby); color: #fff; font: 700 24px var(--serif); }
.brand .mark span { font: 600 17px var(--sans); letter-spacing: .01em; }
.brand h1 { font: 500 clamp(30px, 3.4vw, 46px)/1.12 var(--serif); color: #fff; margin: 0 0 18px; max-width: 14em; }
.brand p { max-width: 30em; color: #aac2b5; margin: 0; }
.doors { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 10px; max-width: 26em; counter-reset: d; }
.doors li { counter-increment: d; display: flex; gap: 12px; align-items: baseline; color: #9fb7aa; }
.doors li::before { content: counter(d); flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; border: 1px solid rgba(255,255,255,.22); }
.doors li.on { color: #fff; }
.doors li.on::before { background: var(--gold); border-color: var(--gold); color: var(--deep-2); }
.doors li.done { color: #cfe3d8; }
.doors li.done::before { content: "✓"; background: rgba(51,194,131,.25); border-color: rgba(51,194,131,.6); color: #9ff0c6; }
.brand small { color: #6f8b7d; }
.side { display: flex; align-items: center; justify-content: center; padding: 32px 28px; }
.card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 30px 26px; box-shadow: var(--shadow); }
.card h2 { font: 600 22px/1.25 var(--serif); margin: 0 0 6px; }
.card .lead { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number] {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 10px; }
input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; border-color: var(--accent); }
input.code { font: 600 30px/1 var(--mono); letter-spacing: .32em; text-align: center; padding: 14px 8px 14px 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px;
  font: 600 15px var(--sans); border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { width: 100%; background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.small { padding: 5px 10px; font-size: 13px; font-weight: 500; }
.btn.danger { color: var(--err); }
.flash { padding: 10px 13px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.flash.err { background: var(--err-soft); color: var(--err); }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.foot { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }
.qr { display: flex; justify-content: center; margin: 4px 0 14px; }
.qr svg { width: 220px; height: 220px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.secret { font: 600 15px var(--mono); letter-spacing: .06em; background: var(--panel2); border: 1px dashed var(--line);
  border-radius: 10px; padding: 9px 10px; text-align: center; word-break: break-all; user-select: all; }
ol.steps { padding-left: 20px; margin: 0 0 14px; font-size: 14px; }
ol.steps li { margin-bottom: 4px; }
details { font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
/* админка */
.wide { max-width: 1100px; margin: 0 auto; padding: 28px 22px 60px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top h1 { font: 600 26px var(--serif); margin: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel h2 { font: 600 18px var(--serif); margin: 0 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 13px; }
td form { display: inline; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.addrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.addrow .field { margin: 0; flex: 1 1 180px; }
.addrow .btn.primary { width: auto; }
.log td { font-size: 13px; }
.log td:first-child, .log td:nth-child(4) { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.bigpwd { font: 700 28px var(--mono); letter-spacing: .08em; text-align: center; padding: 16px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-2); user-select: all; margin: 10px 0 16px; }
@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; }
  .brand { padding: 26px 24px 22px; }
  .brand h1 { font-size: 26px; margin-bottom: 8px; }
  .brand .doors, .brand small, .brand p { display: none; }
  .brand::after { display: none; }
  .side { align-items: flex-start; padding: 20px 14px 40px; }
  .card { padding: 24px 20px; }
  table { font-size: 13px; }
}
@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise .35s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
