:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: rgba(18, 24, 33, 0.82);
  --panel-solid: #111823;
  --border: rgba(148, 163, 184, 0.16);
  --text: #e8eef6;
  --muted: #93a1b3;
  --green: #6ee7b7;
  --blue: #38bdf8;
  --amber: #fbbf24;
  --red: #fb7185;
  --radius: 20px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Inter,
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(56, 189, 248, 0.14), transparent 60%),
    radial-gradient(800px 600px at 0% 10%, rgba(110, 231, 183, 0.1), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, rgba(99, 102, 241, 0.08), transparent 60%);
}

.hidden {
  display: none !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 50%, #0b0f14 0 26%, transparent 27%),
    conic-gradient(from 140deg, var(--green), var(--blue), var(--green));
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.25);
}

/* Login ------------------------------------------------------------------ */

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
}

.login-card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card h1 {
  margin: 12px 0 0;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

label {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 8px;
}

input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(8, 12, 17, 0.7);
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

button,
.link-button {
  font: inherit;
  cursor: pointer;
}

.primary {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #04120f;
  font-weight: 730;
  padding: 13px 18px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.primary:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.primary.big {
  padding: 16px 26px;
  font-size: 1.02rem;
  min-width: 190px;
}

.ghost,
.mini {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 0.82rem;
}

.ghost:hover,
.mini:hover {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.35);
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  text-decoration: none;
  font-weight: 640;
  border: 1px solid rgba(110, 231, 183, 0.25);
  background: rgba(110, 231, 183, 0.07);
  padding: 12px 16px;
  border-radius: 12px;
}

.link-button:hover {
  background: rgba(110, 231, 183, 0.12);
}

.error {
  color: var(--red);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 4px 0 0;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.8rem;
}

/* App -------------------------------------------------------------------- */

.app {
  position: relative;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 22px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(15, 22, 31, 0.7);
  white-space: nowrap;
}

.pill.ready {
  color: var(--green);
  border-color: rgba(110, 231, 183, 0.35);
  background: rgba(110, 231, 183, 0.08);
}

.pill.starting,
.pill.stopping {
  color: var(--amber);
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.pill.error {
  color: var(--red);
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.08);
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 30px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(110, 231, 183, 0.06), transparent 45%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.9rem);
  letter-spacing: -0.05em;
  line-height: 1.05;
}

.hero .muted {
  margin: 10px 0 22px;
  max-width: 54ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.orb {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background:
    radial-gradient(circle at 50% 45%, rgba(148, 163, 184, 0.16), transparent 58%),
    rgba(8, 12, 17, 0.55);
  transition: all 0.4s ease;
}

.orb span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 8px rgba(100, 116, 139, 0.12);
}

.orb.starting,
.orb.stopping {
  border-color: rgba(251, 191, 36, 0.4);
  background: radial-gradient(circle at 50% 45%, rgba(251, 191, 36, 0.22), transparent 62%);
}

.orb.starting span,
.orb.stopping span {
  background: var(--amber);
  box-shadow: 0 0 0 8px rgba(251, 191, 36, 0.13), 0 0 34px rgba(251, 191, 36, 0.55);
  animation: pulse 1.6s ease-in-out infinite;
}

.orb.ready {
  border-color: rgba(110, 231, 183, 0.45);
  background: radial-gradient(circle at 50% 45%, rgba(110, 231, 183, 0.26), transparent 62%);
}

.orb.ready span {
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(110, 231, 183, 0.14), 0 0 38px rgba(110, 231, 183, 0.7);
}

.orb.error {
  border-color: rgba(251, 113, 133, 0.45);
  background: radial-gradient(circle at 50% 45%, rgba(251, 113, 133, 0.22), transparent 62%);
}

.orb.error span {
  background: var(--red);
  box-shadow: 0 0 0 8px rgba(251, 113, 133, 0.12), 0 0 34px rgba(251, 113, 133, 0.55);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.stat {
  padding: 18px;
}

.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.value {
  margin: 8px 0 4px;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Credentials ------------------------------------------------------------ */

.creds {
  margin-top: 12px;
  padding: 22px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.card-head h2 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.card-head p {
  margin: 4px 0 0;
  font-size: 0.86rem;
}

.creds-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.creds-list > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: baseline;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  background: rgba(8, 12, 17, 0.65);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 7px;
}

.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Log -------------------------------------------------------------------- */

.log-card {
  margin-top: 12px;
  padding: 6px 20px;
}

summary {
  cursor: pointer;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 640;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "▸";
  color: var(--muted);
  margin-right: 2px;
  transition: transform 0.15s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
}

pre {
  margin: 0 0 18px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(4, 7, 11, 0.72);
  border: 1px solid var(--border);
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.footnote {
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 70ch;
  margin: 18px 4px 0;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .orb {
    width: 96px;
    height: 96px;
    order: -1;
    justify-self: end;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .creds-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .primary.big {
    width: 100%;
  }

  .actions {
    align-items: stretch;
  }

  .link-button {
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar-right .ghost {
    padding: 6px 9px;
  }
}
