/* Remna Console — liquid glass: матовые стеклянные панели поверх живого сияния */

:root {
  --ink:        #eaf0f6;
  --ink-soft:   rgba(234, 240, 246, .62);
  --ink-faint:  rgba(234, 240, 246, .38);

  --glass:      rgba(255, 255, 255, .055);
  --glass-2:    rgba(255, 255, 255, .085);
  --edge:       rgba(255, 255, 255, .14);
  --edge-soft:  rgba(255, 255, 255, .08);
  --sheen:      rgba(255, 255, 255, .30);

  --accent:     #6aa4ff;
  --accent-2:   #9b7bff;
  --ok:         #4fe0b0;
  --warn:       #ffc46b;
  --danger:     #ff7a63;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --blur: saturate(180%) blur(26px);
  --r: 20px;

  /* тема фона — переключается из интерфейса */
  --page-base: radial-gradient(120% 90% at 50% -10%, #101a30 0%, #070a12 55%, #05070c 100%);
  --blob-1: #2f5cff; --blob-2: #7b3dff; --blob-3: #14b8a6;
  --tint-hi: rgba(122,166,255,.95); --tint-lo: rgba(80,124,240,.9);
  --tint-edge: rgba(160,195,255,.6); --tint-ink: #07132b; --tint-glow: rgba(70,120,255,.35);
  --scrim: .45;
}

/* ------------------------------------------------------ настройки фона */
.themepanel {
  position: fixed; right: 22px; top: 76px; z-index: 60; width: 300px; padding: 18px; border-radius: 22px;
  display: grid; gap: 14px;
  animation: winIn .22s cubic-bezier(.22,.8,.3,1);
}
.themepanel[hidden] { display: none; }
.themepanel h3 { font-size: 14px; }
.themepanel__label { color: var(--ink-soft); font-size: 12px; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.swatch {
  height: 52px; border-radius: 14px; cursor: pointer; position: relative; overflow: hidden;
  border: 1px solid var(--edge-soft); box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .15s ease, border-color .15s ease;
}
.swatch:hover { transform: translateY(-2px); }
.swatch[aria-pressed="true"] { border-color: rgba(255,255,255,.6); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 0 2px rgba(255,255,255,.22); }
.swatch span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 0; text-align: center;
  font-size: 10px; background: rgba(0,0,0,.45); color: var(--ink); }
.themepanel input[type="range"] { width: 100%; accent-color: #9fc2ff; }
.themepanel__row { display: flex; gap: 8px; }
.themepanel__row .btn { flex: 1; justify-content: center; padding: 9px 10px; font-size: 13px; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #05070c; color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
a { color: var(--ink-soft); text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ------------------------------------------------------------ сияние */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--page-base); }
.aurora__photo { position: absolute; inset: 0; background-size: cover; background-position: center; display: none; }
.aurora__scrim { position: absolute; inset: 0; background: rgba(3,5,9,var(--scrim, .45)); }
body[data-bg="photo"] .aurora__photo { display: block; }
body[data-bg="photo"] .aurora__blob { display: none; }
.aurora__blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.aurora__blob--1 { width: 52vw; height: 52vw; left: -12vw; top: -14vw; background: var(--blob-1); animation: drift1 26s ease-in-out infinite; }
.aurora__blob--2 { width: 46vw; height: 46vw; right: -10vw; top: 8vh; background: var(--blob-2); opacity: .38; animation: drift2 32s ease-in-out infinite; }
.aurora__blob--3 { width: 40vw; height: 40vw; left: 26vw; bottom: -18vw; background: var(--blob-3); opacity: .3; animation: drift3 30s ease-in-out infinite; }
.aurora__grain { position: absolute; inset: 0; opacity: .05;
  background-image: radial-gradient(rgba(255,255,255,.9) .5px, transparent .5px); background-size: 3px 3px; }
@keyframes drift1 { 0%,100% { transform: none } 50% { transform: translate(6vw, 5vh) scale(1.12) } }
@keyframes drift2 { 0%,100% { transform: none } 50% { transform: translate(-5vw, 7vh) scale(1.08) } }
@keyframes drift3 { 0%,100% { transform: none } 50% { transform: translate(4vw, -6vh) scale(1.15) } }

/* --------------------------------------------------- переход экранов */
.view { transition: opacity .42s cubic-bezier(.22,.8,.3,1), transform .42s cubic-bezier(.22,.8,.3,1), filter .42s ease; }
.view--hidden { opacity: 0; transform: scale(.97) translateY(10px); filter: blur(6px); pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .view { transition: none } .view--hidden { filter: none; transform: none }
  .aurora__blob { animation: none }
}

/* ------------------------------------------------------------ стекло */
.glass, .card, .gate__card, .topbar, .win, .chip, .verdict {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.045) 42%, rgba(255,255,255,.02) 100%);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 18px 50px rgba(0,0,0,.45),
    0 2px 10px rgba(0,0,0,.3),
    inset 0 1px 0 rgba(255,255,255,.42),
    inset 0 -1px 1px rgba(0,0,0,.32),
    inset 0 0 22px rgba(255,255,255,.05);
}

/* световая кромка по контуру — как преломление на краю стекла */
.glass::before, .card::before, .gate__card::before, .topbar::before, .win::before, .chip::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg,
    rgba(255,255,255,.55) 0%, rgba(255,255,255,.10) 26%,
    rgba(255,255,255,0) 55%, rgba(255,255,255,.16) 88%, rgba(255,255,255,.4) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* ------------------------------------------------------------ кнопки */
.btn {
  position: relative; overflow: hidden; padding: 10px 18px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.16); color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.17) 0%, rgba(255,255,255,.07) 48%, rgba(255,255,255,.03) 100%);
  backdrop-filter: saturate(190%) blur(18px); -webkit-backdrop-filter: saturate(190%) blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    inset 0 -2px 3px rgba(0,0,0,.32),
    inset 0 0 14px rgba(255,255,255,.07),
    0 6px 18px rgba(0,0,0,.34);
  transition: transform .16s cubic-bezier(.22,.8,.3,1), box-shadow .16s ease, border-color .16s ease;
}
/* верхний блик, как на стеклянной пилюле */
.btn::after {
  content: ""; position: absolute; left: 8%; right: 8%; top: 1px; height: 46%;
  border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,0));
}
.btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,.3); transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.62), inset 0 -2px 3px rgba(0,0,0,.3),
              inset 0 0 18px rgba(255,255,255,.12), 0 10px 26px rgba(0,0,0,.4);
}
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .34; cursor: not-allowed; }
.btn--sm { padding: 7px 13px; font-size: 13px; }
.btn--wide { width: 100%; }
.btn--primary {
  background: linear-gradient(180deg, var(--tint-hi) 0%, var(--tint-lo) 100%);
  border-color: var(--tint-edge); color: var(--tint-ink); font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 4px rgba(0,0,0,.22),
              0 8px 24px var(--tint-glow);
}
.btn--primary:hover:not(:disabled) { background: linear-gradient(180deg, rgba(140,182,255,1), rgba(96,140,250,.95)); }
.btn--accent { border-color: rgba(120,220,200,.4); color: #9df0d8; }
.btn--accent:hover:not(:disabled) { background: rgba(79,224,176,.14); }
.btn--quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-soft); }
.btn--quiet:hover:not(:disabled) { background: var(--glass-2); border-color: var(--edge-soft); color: var(--ink); }
.btn--light { background: rgba(255,255,255,.9); border-color: #fff; color: #0a1018; font-weight: 650; }
.btn--light:hover { background: #fff; }

.chip { padding: 6px 14px; border-radius: 999px; color: var(--ink-soft); font-size: 12px; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; border: 1px solid var(--edge-soft); color: var(--ink-faint); background: rgba(255,255,255,.05); }
.badge[data-tone="ok"]   { color: var(--ok);     border-color: rgba(79,224,176,.35);  background: rgba(79,224,176,.12); }
.badge[data-tone="down"] { color: var(--danger); border-color: rgba(255,122,99,.35);  background: rgba(255,122,99,.12); }

/* -------------------------------------------------------------- вход */
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; }
.gate__card { width: min(400px, 100%); padding: 34px; border-radius: 26px; display: grid; gap: 16px; }
.gate__eyebrow { margin: 0; font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate__title { margin: 0 0 10px; font-size: 26px; }
.gate__error { margin: 0; min-height: 18px; color: var(--danger); font-size: 13px; }
.field { display: grid; gap: 7px; }
.field span { color: var(--ink-soft); font-size: 12px; }
.field input {
  padding: 12px 15px; border-radius: 14px; color: var(--ink);
  background: rgba(255,255,255,.06); border: 1px solid var(--edge-soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
  transition: border-color .16s ease, background .16s ease;
}
.field input:focus { outline: none; border-color: rgba(122,166,255,.65); background: rgba(255,255,255,.1); }
.field input::placeholder { color: var(--ink-faint); }

/* ------------------------------------------------------------- шапка */
.topbar {
  position: sticky; top: 12px; z-index: 20; margin: 12px 16px 0; border-radius: var(--r);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 18px;
}
.topbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.topbar__dot { width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px rgba(122,166,255,.9); }
.topbar__right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.page { max-width: 1400px; margin: 0 auto; padding: 20px 24px 90px; }
.alert { margin: 0 0 16px; padding: 12px 16px; border-radius: 16px; font-size: 13px;
  background: rgba(255,122,99,.1); border: 1px solid rgba(255,122,99,.28); color: #ffc7bb; }

/* ---------------------------------------------------------- карточки */
.card { border-radius: var(--r); padding: 20px; }
.card--panel { display: grid; gap: 15px; }
.card__head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.card__eyebrow { margin: 0; color: var(--ink-soft); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.card__title { margin: 5px 0 0; font-size: 22px; font-family: var(--mono); }
.card__title .arrow, .node__ver .arrow { color: var(--warn); padding: 0 8px; }
.card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; color: var(--ink-faint); font-size: 12px; }

.verdicts { display: grid; gap: 9px; }
.verdict { padding: 12px 15px; border-radius: 14px; font-size: 13px; border-left: 3px solid var(--edge); box-shadow: none; }
.verdict[data-verdict="ok"] { border-left-color: var(--ok); }
.verdict[data-verdict="simple"] { border-left-color: var(--warn); }
.verdict[data-verdict="manual"], .verdict[data-verdict="major"] { border-left-color: var(--danger); }
.verdict__keys { margin: 7px 0 0; font-family: var(--mono); font-size: 12px; color: var(--warn); word-break: break-all; }

.section-head { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 14px; }
.section-head h2 { font-size: 15px; }
.section-head__count { color: var(--ink-faint); font-size: 13px; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card--node { display: grid; gap: 13px; transition: transform .18s cubic-bezier(.22,.8,.3,1), border-color .18s ease; }
.card--node:hover { transform: translateY(-2px); border-color: var(--edge); }
.node__top { display: flex; align-items: flex-start; gap: 11px; }
.node__id { flex: 1; min-width: 0; }
.node__name { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node__addr { margin: 3px 0 0; color: var(--ink-faint); font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.node__ver { margin: 0; color: var(--ink-soft); font-family: var(--mono); font-size: 12px; }
.node__ver b { color: var(--ink); font-weight: 600; }
.node__actions { display: flex; flex-wrap: wrap; gap: 7px; }

.dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.card--node[data-state="online"]  .dot { background: var(--ok); box-shadow: 0 0 12px rgba(79,224,176,.8); }
.card--node[data-state="offline"] .dot { background: var(--danger); box-shadow: 0 0 12px rgba(255,122,99,.7); }
.card--node[data-busy="1"] .dot { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; }
.card--node[data-busy="1"] { border-color: rgba(255,196,107,.4); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
@media (prefers-reduced-motion: reduce) { .card--node[data-busy="1"] .dot { animation: none } }

.empty { color: var(--ink-faint); text-align: center; padding: 44px 0; }

/* ------------------------------------------------------------- окна */
.win {
  position: fixed; z-index: 40; border-radius: 22px; overflow: hidden; resize: both;
  width: min(780px, 92vw); height: min(470px, 70vh); min-width: 340px; min-height: 210px;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 var(--sheen);
  animation: winIn .28s cubic-bezier(.22,.8,.3,1);
}
@keyframes winIn { from { opacity: 0; transform: scale(.96) translateY(12px) } to { opacity: 1; transform: none } }
.win--min { height: auto !important; min-height: 0; resize: none; }
.win--min .win__body { display: none; }
.win__bar { display: flex; align-items: center; gap: 11px; padding: 11px 14px; cursor: grab; user-select: none;
  background: rgba(255,255,255,.05); border-bottom: 1px solid var(--edge-soft); }
.win__bar:active { cursor: grabbing; }
.win__grip { width: 30px; height: 3px; border-radius: 2px; background: var(--edge); flex: none; }
.win__title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win__state { margin-left: auto; color: var(--ink-faint); font-size: 12px; white-space: nowrap; }
.win__state[data-tone="run"]  { color: var(--warn) }
.win__state[data-tone="ok"]   { color: var(--ok) }
.win__state[data-tone="fail"] { color: var(--danger) }
.win__btn { width: 27px; height: 27px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-faint); cursor: pointer; font-size: 15px; }
.win__btn:hover { background: rgba(255,255,255,.1); color: var(--ink); }
.win__btn--close:hover { background: rgba(255,122,99,.2); color: var(--danger); }
.win__body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: rgba(4,6,10,.72); }
.win__screen { flex: 1; min-height: 0; padding: 10px 12px; }
.xterm { height: 100%; }

.console-idle { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 20px; }
.console-idle__frame { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px;
  border: 1px solid var(--edge-soft); border-radius: 18px; background-color: rgba(255,255,255,.03);
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px); background-size: 15px 15px; }
.console-idle__icon { font-size: 28px; color: var(--ink-faint); }
.console-idle__text { margin: 0; color: var(--ink-soft); font-size: 13px; }
.console-idle__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.console-idle__hint { margin: 0; color: var(--ink-faint); font-size: 12px; max-width: 400px; }

@media (max-width: 640px) {
  .page { padding: 16px 14px 60px } .topbar { margin: 10px 10px 0 }
  .win { width: 96vw; height: 66vh; left: 2vw !important; }
}
