:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --panel: rgba(19, 22, 25, 0.78);
  --panel-strong: rgba(24, 27, 30, 0.92);
  --line: rgba(235, 240, 237, 0.12);
  --text: #f1f3ef;
  --muted: #8c9590;
  --accent: #e6e8e0;
  --green: #8fd3a5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
}

.atmosphere {
  position: fixed;
  inset: -20%;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(circle at 20% 24%, rgba(113, 142, 125, 0.14), transparent 28%),
    radial-gradient(circle at 82% 72%, rgba(145, 134, 101, 0.12), transparent 24%),
    linear-gradient(115deg, transparent 0 44%, rgba(255, 255, 255, 0.035) 50%, transparent 56%);
  filter: blur(0.2px);
  animation: drift 22s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(1.5%, 1.2%, 0) scale(1.04); }
}

.shell {
  position: relative;
  width: min(980px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 64px;
}

.topbar { display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.32); }
.private-mark { color: #6e7772; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; }

.auth-panel, .portal { width: min(720px, 100%); margin: 18vh auto 0; }
.auth-panel { text-align: center; }
.eyebrow { margin: 0 0 12px; color: #77817b; font-size: 10px; font-weight: 700; letter-spacing: 0.18em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(38px, 7vw, 72px); line-height: 0.96; letter-spacing: -0.03em; }
h2 { margin-bottom: 10px; font-size: 18px; line-height: 1.15; }
.muted { max-width: 520px; margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-panel .muted { margin: 0 auto; }

.password-row { display: flex; width: min(300px, 100%); margin: 28px auto 0; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.055); transition: border-color 180ms ease, background 180ms ease; }
.password-row:focus-within { border-color: rgba(230, 232, 224, 0.45); background: rgba(255, 255, 255, 0.08); }
.password-row input { min-width: 0; flex: 1; height: 48px; padding: 0 18px; border: 0; outline: 0; color: var(--text); background: transparent; font: inherit; font-size: 13px; }
.password-row input::placeholder { color: #727b76; }
.password-row button { width: 42px; height: 42px; margin: 3px; border: 0; border-radius: 50%; color: #111416; background: var(--accent); cursor: pointer; font-size: 20px; line-height: 1; transition: transform 180ms ease, background 180ms ease; }
.password-row button:hover { transform: translateX(2px); background: #fff; }
.message { min-height: 20px; margin: 12px 0 0; color: #e6a2a2; font-size: 12px; }

.portal { margin-top: 11vh; }
.portal-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.portal-heading h1 { margin-bottom: 12px; font-size: clamp(34px, 5vw, 58px); }
.status-pill { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #717873; }
.status-pill.is-online { color: var(--green); }
.status-pill.is-online i { background: var(--green); box-shadow: 0 0 14px rgba(143, 211, 165, 0.65); }
.portal-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 14px; margin-top: 14px; }
.surface { min-height: 250px; padding: 26px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.16); }
.primary-surface { background: linear-gradient(140deg, rgba(35, 41, 39, 0.88), rgba(18, 21, 24, 0.82)); }
.surface-icon { display: grid; width: 42px; height: 42px; margin-bottom: 28px; place-items: center; border: 1px solid rgba(230, 232, 224, 0.2); border-radius: 50%; color: var(--accent); font-size: 23px; }
.surface .muted { min-height: 65px; }
.action { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; margin-top: 24px; padding: 12px 14px; border: 1px solid rgba(230, 232, 224, 0.25); border-radius: 6px; color: var(--text); background: rgba(255, 255, 255, 0.06); font-size: 12px; text-decoration: none; transition: background 180ms ease, border-color 180ms ease; }
.action:hover { border-color: rgba(230, 232, 224, 0.5); background: rgba(255, 255, 255, 0.11); }
.action b { color: var(--accent); font-size: 16px; }
.runtime-line { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid rgba(235, 240, 237, 0.08); color: var(--muted); font-size: 12px; }
.runtime-line strong { color: var(--text); font-weight: 600; }
.command-block { display: grid; gap: 8px; margin-top: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: rgba(12, 14, 16, 0.72); }
.command-block span { color: #78817c; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; }
.command-block code { overflow-x: auto; color: #d9ded8; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.logout { margin-top: 18px; padding: 0; border: 0; color: #78817c; background: transparent; cursor: pointer; font: inherit; font-size: 12px; }
.logout:hover { color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

@media (max-width: 680px) {
  .shell { width: min(100% - 28px, 520px); padding-top: 20px; }
  .auth-panel { margin-top: 22vh; }
  .portal { margin-top: 14vh; }
  .portal-heading { display: block; }
  .status-pill { margin-top: 18px; }
  .portal-grid { grid-template-columns: 1fr; }
  .surface { min-height: auto; }
}
