:root {
  color-scheme: dark;
  --bg: #090b0f;
  --panel: #11151c;
  --line: #2a3340;
  --text: #ecf2f8;
  --muted: #8c9aaa;
  --accent: #4cc38a;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  display: grid;
}

.login {
  align-self: center;
  justify-self: center;
  width: min(360px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

h1,
p {
  margin: 0;
}

.login h1 {
  margin-bottom: 20px;
  font-size: 1.5rem;
}

form,
label {
  display: grid;
  gap: 8px;
}

form {
  gap: 14px;
}

label span,
header p {
  color: var(--muted);
  font-size: 0.88rem;
}

input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1016;
  color: var(--text);
}

button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #37684f;
  border-radius: 6px;
  background: #143322;
  color: var(--text);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.error {
  min-height: 20px;
  color: var(--danger);
  font-size: 0.88rem;
}

.terminal-view {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #0f141b;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

header h1 {
  font-size: 1rem;
}

#terminal {
  width: 100%;
  min-height: 0;
  background: #05070a;
  overflow: hidden;
}

#terminal .xterm {
  height: 100%;
  padding: 12px 14px;
}

#terminal .xterm-viewport {
  background: #05070a;
}

@media (max-width: 520px) {
  header {
    align-items: flex-start;
  }

  .actions {
    max-width: 180px;
  }

  button {
    height: 36px;
    padding: 0 10px;
  }
}
