:root {
  --bg: #0a0912;
  --bg-soft: #12101f;
  --card: #161327;
  --card-2: #1d1934;
  --line: #2a2445;
  --text: #ece9f8;
  --muted: #9d97b8;
  --accent: #7c5cff;
  --accent-2: #21d4c4;
  --danger: #ff5c7a;
  --ok: #35d07f;
  --warn: #ffb547;
  --radius: 16px;
  --max: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(70% 50% at 50% -10%, rgba(124, 92, 255, .28), transparent 70%),
    radial-gradient(50% 40% at 100% 0%, rgba(33, 212, 196, .10), transparent 70%);
  background-repeat: no-repeat;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
p { line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: "JetBrains Mono", Consolas, "Courier New", monospace; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 48px; }

/* ------------------------------- шапка -------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(10, 9, 18, .78);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo {
  font-weight: 800; letter-spacing: .14em; font-size: 16px;
  color: var(--text); text-transform: uppercase; white-space: nowrap;
}
.logo span { color: var(--accent); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.navlink { color: var(--muted); font-size: 14px; padding: 8px 10px; border-radius: 10px; }
.navlink:hover { color: var(--text); text-decoration: none; background: var(--card); }
.navlink.active { color: var(--text); background: var(--card); }
.nav-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.who { color: var(--muted); font-size: 13px; padding: 0 6px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------- кнопки -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform .12s ease, background .15s ease, border-color .15s ease;
  text-decoration: none; font-family: inherit;
}
.btn:hover { background: var(--card-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #5b3ee6); border-color: transparent; color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, #8a6dff, #6647f0); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: rgba(255, 92, 122, .45); color: var(--danger); background: transparent; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

/* -------------------------------- формы -------------------------------- */
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
  font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="radio"], input[type="checkbox"] { width: auto; }

/* -------------------------------- карточки ------------------------------ */
.card {
  background: linear-gradient(180deg, var(--card), rgba(22, 19, 39, .72));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.card h3 { font-size: 17px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* --------------------------------- герой -------------------------------- */
.hero { padding: 34px 0 18px; }
.kicker { color: var(--accent-2); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 10px; }
.hero h1 { font-size: clamp(30px, 6vw, 48px); letter-spacing: -.02em; }
.hero h1 span { color: var(--accent); }
.lead { color: var(--muted); font-size: 16px; max-width: 640px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 8px; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 20px; margin-bottom: 2px; }
.stat span { color: var(--muted); font-size: 12px; }

/* -------------------------------- тарифы -------------------------------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 14px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }
.tab {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 9px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; white-space: nowrap;
  font-family: inherit;
}
.tab.active { background: var(--card); color: var(--text); border-color: rgba(124, 92, 255, .6); }

.plan { position: relative; display: flex; flex-direction: column; }
.plan.popular { border-color: rgba(124, 92, 255, .65); box-shadow: 0 18px 50px rgba(124, 92, 255, .14); }
.badge {
  position: absolute; top: -10px; right: 16px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; letter-spacing: .04em;
}
.price { font-size: 28px; font-weight: 800; margin: 6px 0 2px; }
.price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.specs { list-style: none; padding: 0; margin: 12px 0 18px; display: grid; gap: 7px; }
.specs li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.specs li b { color: var(--text); font-weight: 600; }

/* -------------------------------- таблица ------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.table tr:last-child td { border-bottom: none; }

/* -------------------------------- чипы ---------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.running, .chip.paid { color: var(--ok); border-color: rgba(53, 208, 127, .4); }
.chip.stopped, .chip.pending_install { color: var(--warn); border-color: rgba(255, 181, 71, .4); }
.chip.suspended, .chip.error, .chip.failed { color: var(--danger); border-color: rgba(255, 92, 122, .4); }
.chip.pending { color: var(--accent-2); border-color: rgba(33, 212, 196, .4); }

/* ------------------------------ консоль --------------------------------- */
.logs {
  background: #07060d; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; max-height: 320px; overflow: auto; font-size: 12px; line-height: 1.6;
  font-family: "JetBrains Mono", Consolas, monospace; color: #b9b3d6; white-space: pre-wrap;
}
.logs.empty { color: var(--muted); }

/* -------------------------------- модалка ------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 4, 12, .72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.modal h3 { margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* -------------------------------- прочее -------------------------------- */
.auth { max-width: 420px; margin: 28px auto; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.addr { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 13px; }
.loading { color: var(--muted); padding: 40px 0; }
.notice { border: 1px solid rgba(33, 212, 196, .35); background: rgba(33, 212, 196, .07); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.notice.warn { border-color: rgba(255, 181, 71, .4); background: rgba(255, 181, 71, .08); }
.notice.bad { border-color: rgba(255, 92, 122, .4); background: rgba(255, 92, 122, .08); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 100; box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
}
.toast.bad { border-color: rgba(255, 92, 122, .5); }
.footer { border-top: 1px solid var(--line); padding: 18px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

@media (max-width: 620px) {
  .who { display: none; }
  .hero { padding-top: 18px; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}
