*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #08111f;
  --panel: rgba(255, 255, 255, .96);
  --panel-strong: #f7faff;
  --line: #dbe5f0;
  --text: #10233f;
  --muted: #65748b;
  --primary: #1769e0;
  --accent: #18a673;
  --ok: #15803d;
  --danger: #b91c1c;
  --shadow: 0 28px 80px rgba(4, 16, 38, .3);
}

html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(40, 141, 255, .3), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(24, 166, 115, .2), transparent 30%),
    linear-gradient(145deg, #08111f, #122f57 55%, #0c1a2f);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.has-jump-modal { overflow: hidden; }
button, input { font: inherit; }
svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.topbar {
  display: flex;
  width: min(520px, calc(100% - 24px));
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 34px 0 14px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 17px; font-weight: 900; letter-spacing: .02em; text-decoration: none; }
.brand-icon { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 12px; background: linear-gradient(135deg, #fff, #bfe1ff); color: #1769e0; box-shadow: 0 8px 20px rgba(0,0,0,.16); }

.page { width: min(520px, calc(100% - 24px)); margin: 0 auto; padding: 14px 0 38px; }
.hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 30px;
  overflow: hidden;
  position: relative;
}
h1 { margin: 10px 0 0; color: var(--text); font-size: 40px; line-height: 1.08; letter-spacing: -.04em; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(24,166,115,.12); }
.hero-copy > p { max-width: 440px; margin: 14px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.hero-panel { width: 100%; }

.nodes-section { margin-top: 18px; padding: 4px 2px 30px; }
.nodes-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.nodes-heading h2 { margin: 9px 0 0; color: #fff; font-size: 24px; letter-spacing: -.03em; }
.nodes-updated { color: rgba(255,255,255,.62); font-size: 12px; white-space: nowrap; }
.nodes-status { min-height: 22px; margin: 14px 0 10px; color: rgba(255,255,255,.7); font-size: 13px; }
.nodes-status.is-error { color: #fecaca; }
.nodes-status.is-empty { color: rgba(255,255,255,.7); }
.nodes-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.node-card { padding: 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.1); color: #fff; box-shadow: 0 12px 26px rgba(0,0,0,.12); backdrop-filter: blur(12px); }
.node-card.is-offline { opacity: .62; }
.node-card__top, .node-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.node-card__top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.node-card__meta { margin-top: 12px; color: rgba(255,255,255,.68); font-size: 12px; }
.node-card__action { margin-top: 14px; }
.node-enter { display: inline-flex; width: 100%; min-height: 38px; align-items: center; justify-content: center; gap: 6px; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; color: #fff; background: rgba(255,255,255,.12); font-size: 13px; font-weight: 800; text-decoration: none; transition: background .2s ease, transform .2s ease; }
.node-enter:hover { background: rgba(255,255,255,.22); transform: translateY(-1px); }
.node-enter svg { width: 15px; height: 15px; }
.node-enter.is-disabled { color: rgba(255,255,255,.5); cursor: not-allowed; }
.node-status { display: inline-flex; align-items: center; gap: 5px; color: #8ff0c3; font-size: 11px; white-space: nowrap; }
.node-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(143,240,195,.12); }
.is-offline .node-status { color: #fbbf24; }

.access-form { display: grid; gap: 14px; }
.access-field { display: grid; gap: 7px; }
.access-field > span { color: var(--muted); font-size: 13px; font-weight: 800; }
.access-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 14px;
  font-size: 16px;
  outline: none;
}
.access-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(23,105,224,.13); }
.access-field input:disabled { cursor: wait; opacity: .68; }
.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 10px; align-items: end; }
.captcha-image { display: block; width: 220px; max-width: 100%; height: 72px; border: 1px solid var(--line); border-radius: 8px; background: #fff; object-fit: contain; }
.captcha-refresh { display: inline-flex; width: 46px; height: 46px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-strong); color: var(--muted); cursor: pointer; }
.captcha-refresh:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.captcha-refresh:disabled { cursor: wait; opacity: .55; }

.best-node-action { display: inline-flex; width: 100%; min-height: 56px; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #1769e0, #2591f5); color: #fff; padding: 0 18px; font-size: 17px; font-weight: 900; cursor: pointer; box-shadow: 0 12px 22px rgba(23,105,224,.24); transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; }
.best-node-action:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 16px 28px rgba(23,105,224,.32); }
.best-node-action:disabled { cursor: not-allowed; opacity: .55; }
.best-node-action svg { width: 18px; height: 18px; }
.access-status { min-height: 20px; color: var(--muted); font-size: 13px; font-weight: 800; line-height: 1.5; }
.access-status.is-ok { color: var(--ok); }
.access-status.is-error { color: var(--danger); }
.access-rule { margin: -4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

[hidden] { display: none !important; }

@media (max-width: 390px) {
  .topbar, .page { width: min(100% - 20px, 520px); }
  .hero { padding: 22px 16px; }
  h1 { font-size: 31px; }
  .captcha-row { grid-template-columns: 1fr; }
  .captcha-refresh { width: 100%; }
  .nodes-heading { align-items: start; flex-direction: column; gap: 5px; }
  .nodes-list { grid-template-columns: 1fr; }
}
