:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --fg: #0f172a;
  --fg-secondary: #475569;
  --fg-muted: #64748b;
  --accent: #0f172a;
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --emerald: #10b981;
  --emerald-bg: #ecfdf5;
  --emerald-border: #a7f3d0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 20px 50px -20px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.04);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(37, 99, 235, 0.07), transparent 40%),
    radial-gradient(circle at 82% 88%, rgba(14, 165, 233, 0.06), transparent 42%),
    radial-gradient(rgba(148, 163, 184, 0.25) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.topbar {
  height: 60px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.brand-sub {
  font-size: 0.72rem;
  font-weight: 550;
  color: var(--fg-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 999px;
}
.top-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}
.node-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #065f46;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.top-link {
  border: 0;
  background: transparent;
  color: var(--fg-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
}
.top-link:hover { color: var(--fg); }

/* Main Split Workspace */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
}
.shell {
  width: 100%;
  max-width: 960px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  overflow: hidden;
}

/* Left Info Panel */
.info-pane {
  background: #0f172a;
  color: #f8fafc;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.info-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(56, 189, 248, 0.18), transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(37, 99, 235, 0.22), transparent 50%);
  pointer-events: none;
}
.info-content { position: relative; z-index: 1; }
.cluster-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.26);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.info-pane h1 {
  margin: 0 0 12px;
  font-size: 1.85rem;
  line-height: 1.18;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.info-lead {
  margin: 0 0 28px;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.6;
}
.service-list {
  display: grid;
  gap: 10px;
}
.svc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.14);
}
.svc-left { display: flex; align-items: center; gap: 11px; }
.svc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.svc-name { font-size: 0.86rem; font-weight: 600; color: #f1f5f9; }
.svc-desc { font-size: 0.74rem; color: #94a3b8; }
.svc-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  padding: 3px 8px;
  border-radius: 6px;
}

.storage-foot {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}
.storage-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #cbd5e1;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.bar-track {
  height: 6px;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  width: 64%;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #38bdf8);
  border-radius: 999px;
}
.storage-sub {
  margin-top: 8px;
  font-size: 0.74rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
}

/* Right Auth Pane */
.auth-pane {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-pane h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  letter-spacing: -0.025em;
}
.auth-sub {
  margin: 0 0 24px;
  font-size: 0.88rem;
  color: var(--fg-secondary);
}
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 22px;
}
.auth-tab {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--fg-secondary);
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.auth-tab.active {
  background: #ffffff;
  color: var(--fg);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.field { margin-bottom: 15px; }
.field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
label {
  display: block;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--fg);
}
.hint-link {
  font-size: 0.78rem;
  color: var(--accent-blue);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
.hint-link:hover { text-decoration: underline; }
.input {
  width: 100%;
  height: 41px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--fg);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 18px;
  font-size: 0.82rem;
  color: var(--fg-secondary);
}
.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 450;
  color: var(--fg-secondary);
  cursor: pointer;
}
.btn-submit {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--fg);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.12s ease;
}
.btn-submit:hover { background: #1e293b; }
.btn-submit:disabled { opacity: 0.65; cursor: wait; }

.alert {
  display: none;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.45;
}
.alert.error {
  display: block;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}
.alert.info {
  display: block;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.alt-box {
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  background: var(--bg);
  text-align: center;
  margin-bottom: 16px;
}
.alt-box p {
  margin: 8px 0 0;
  font-size: 0.83rem;
  color: var(--fg-secondary);
}
.hidden { display: none !important; }

.auth-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--fg-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Bottom Footer */
.bottombar {
  padding: 16px 28px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  font-size: 0.78rem;
  color: var(--fg-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.modal-head h3 { margin: 0; font-size: 1.05rem; }
.close-x {
  border: 0;
  background: var(--surface-subtle);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--fg-secondary);
}
.kv-list { display: grid; gap: 10px; font-size: 0.84rem; }
.kv {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.ok-txt { color: #059669; font-weight: 600; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; max-width: 460px; }
  .info-pane { display: none; }
  .auth-pane { padding: 32px 24px; }
  .topbar { padding: 0 16px; }
  .top-link { display: none; }
}
