/* ===== Космос + Liquid Glass ===== */
* { box-sizing: border-box; margin: 0; }

:root {
  --bg1: #05030f;
  --bg2: #120b2e;
  --bg3: #1d0f3d;
  --cyan: #56e6ff;
  --purple: #b06bff;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #f87171;
  --text: #e6e4f5;
  --muted: #8f8aa8;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-border: rgba(255, 255, 255, 0.14);
}

html { color-scheme: dark; }
body {
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(120% 120% at 80% -10%, var(--bg3) 0%, var(--bg2) 45%, var(--bg1) 100%);
  overflow-x: hidden;
}
.mono { font-family: "Cascadia Mono", ui-monospace, monospace; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ===== Жидкое стекло ===== */
.glass {
  position: relative;
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.02) 38%, rgba(255,255,255,0.00) 60%),
    var(--glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -14px 28px rgba(6, 2, 24, 0.35);
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1.4, 0.36, 1), box-shadow 0.45s ease;
}
/* specular-блик, следящий за курсором (переменные ставит app.js) */
.glass::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(320px circle at var(--mx, 30%) var(--my, 15%),
    rgba(255, 255, 255, 0.16), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
/* светящаяся кромка циан→пурпур */
.glass::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(86,230,255,0.5), rgba(176,107,255,0.35) 45%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.35;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.glass:hover { transform: translateY(-3px) scale(1.012); }
.glass:hover::before { opacity: 1; }
.glass:hover::after { opacity: 0.8; }

/* ===== Логин ===== */
.login { position: fixed; inset: 0; display: grid; place-items: center; z-index: 5; }
.login-card { width: min(360px, 90vw); padding: 36px 30px; text-align: center; display: grid; gap: 14px; }
.login-card h1 { font-size: 22px; letter-spacing: 0.35em; background: linear-gradient(90deg, var(--cyan), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-card input {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.35); color: var(--text); font-size: 15px; outline: none; text-align: center;
}
.login-card input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(86,230,255,0.15); }
.error { color: var(--red); font-size: 13px; }

/* ===== Кнопки-пилюли ===== */
.btn {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--glass-border);
  background: linear-gradient(160deg, rgba(255,255,255,0.14), rgba(255,255,255,0.03));
  color: var(--text); font-size: 13px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 14px rgba(0,0,0,0.35);
  transition: transform 0.25s cubic-bezier(0.22, 1.6, 0.36, 1), box-shadow 0.25s ease;
}
.btn:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 0 18px rgba(86,230,255,0.25); }
.btn:active { transform: scale(0.94); box-shadow: inset 0 3px 10px rgba(0,0,0,0.45); }
.btn.danger:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 0 18px rgba(248,113,113,0.35); }

/* ===== Каркас ===== */
main { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 26px 22px 60px; display: grid; gap: 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }

/* ===== Хост-карточка ===== */
.host-card { padding: 24px 28px; display: grid; gap: 18px; }
.host-title { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.host-title h1 { font-size: 20px; font-weight: 600; }
.rings { display: flex; gap: 26px; flex-wrap: wrap; }
.ring { display: grid; place-items: center; position: relative; }
.ring svg { transform: rotate(-90deg); filter: drop-shadow(0 0 6px rgba(86,230,255,0.45)); }
.ring .val { position: absolute; text-align: center; font-size: 15px; }
.ring .val small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.host-extra { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

/* ===== Карточки сервисов ===== */
.card { padding: 20px 22px; display: grid; gap: 12px; align-content: start; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h2 { font-size: 15.5px; font-weight: 600; flex: 1; }
.card-body { display: grid; gap: 6px; font-size: 13px; }
.kv { display: flex; justify-content: space-between; gap: 12px; }
.kv b { font-weight: 500; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.small-log { font-family: "Cascadia Mono", ui-monospace, monospace; font-size: 11.5px; overflow-wrap: anywhere; }

/* статус-огоньки */
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.ok { background: var(--green); animation: pulse-ok 2.6s ease-in-out infinite; }
.dot.warn { background: var(--amber); animation: pulse-warn 1.6s ease-in-out infinite; }
.dot.bad { background: var(--red); animation: pulse-bad 0.9s ease-in-out infinite; }
@keyframes pulse-ok { 0%,100% { box-shadow: 0 0 6px 1px rgba(74,222,128,0.7); } 50% { box-shadow: 0 0 12px 3px rgba(74,222,128,0.9); } }
@keyframes pulse-warn { 0%,100% { box-shadow: 0 0 6px 1px rgba(251,191,36,0.7); } 50% { box-shadow: 0 0 14px 4px rgba(251,191,36,0.95); } }
@keyframes pulse-bad { 0%,100% { box-shadow: 0 0 6px 1px rgba(248,113,113,0.75); opacity: 1; } 50% { box-shadow: 0 0 16px 5px rgba(248,113,113,1); opacity: 0.55; } }

.tag { font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--glass-border); color: var(--muted); }
.tag.on { color: var(--green); border-color: rgba(74,222,128,0.4); }
.tag.off { color: var(--red); border-color: rgba(248,113,113,0.4); }

/* появление карточек */
.card, .host-card { animation: rise 0.6s cubic-bezier(0.22, 1.3, 0.36, 1) backwards; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }
.card:nth-child(7) { animation-delay: 0.3s; }
.card:nth-child(8) { animation-delay: 0.35s; }
.card:nth-child(9) { animation-delay: 0.4s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.97); } }

/* ===== Модалки ===== */
.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(3, 1, 12, 0.6); backdrop-filter: blur(4px); }
.modal { width: min(720px, 94vw); max-height: 84vh; padding: 24px; display: grid; gap: 14px; }
.modal h3 { font-size: 16px; }
.modal pre { overflow: auto; max-height: 56vh; font-size: 12px; line-height: 1.5; background: rgba(0,0,0,0.35); border-radius: 12px; padding: 14px; white-space: pre-wrap; word-break: break-all; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

@media (prefers-reduced-motion: reduce) {
  .glass, .btn, .card, .host-card { animation: none !important; transition: none !important; }
  .glass:hover { transform: none; }
  .dot.ok, .dot.warn, .dot.bad { animation: none; }
}
