:root {
  --bg: #020611;
  --bg-2: #071120;
  --panel: rgba(4, 10, 20, 0.94);
  --line: rgba(103, 232, 249, 0.24);
  --text: #dbe7f3;
  --muted: #8aa0b8;
  --cyan: #67e8f9;
  --green: #86efac;
  --amber: #fcd34d;
  --red: #fda4af;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(103, 232, 249, 0.12), transparent 26%),
    radial-gradient(circle at bottom right, rgba(252, 211, 77, 0.08), transparent 22%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  font-family: "Cascadia Mono", "Cascadia Code", Consolas, monospace;
}

body {
  min-height: 100vh;
}

.shell {
  width: 100%;
  height: 100vh;
  padding: 18px;
  overflow: hidden;
}

.terminal-frame {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - 36px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.terminal-chrome {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(103, 232, 249, 0.18);
  background: linear-gradient(180deg, rgba(13, 24, 42, 0.98), rgba(6, 12, 24, 0.98));
}

.chrome-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.dot.red { background: #fb7185; }
.dot.amber { background: #fbbf24; }
.dot.green { background: #4ade80; }

.chrome-title,
.chrome-status,
.eyebrow,
.copy,
.status-line,
.field input,
.button {
  font-family: "Cascadia Mono", "Cascadia Code", Consolas, monospace;
}

.chrome-title {
  color: var(--text);
  letter-spacing: 0.06em;
}

.chrome-status {
  color: var(--muted);
  font-size: 0.88rem;
}

.terminal-root {
  flex: 1;
  min-height: 0;
  min-width: 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.92);
  overflow: hidden;
}

.terminal-root .xterm {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.terminal-root .xterm-viewport,
.terminal-root .xterm-screen,
.terminal-root .xterm-scroll-area,
.terminal-root .xterm-helper-textarea {
  overflow: hidden !important;
}

.key-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 6, 17, 0.72);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.key-gate.hidden {
  display: none;
}

.key-card {
  width: min(560px, 100%);
  padding: 28px;
  border-radius: 20px;
  border: 1px solid rgba(103, 232, 249, 0.24);
  background: rgba(7, 17, 32, 0.94);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.key-card h1 {
  margin: 0 0 10px;
  font-size: 2rem;
}

.copy {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin: 8px 0 18px;
}

.actions {
  display: flex;
  gap: 12px;
}

.button {
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 600;
}

.button.primary {
  background: linear-gradient(135deg, var(--cyan), #38bdf8);
  color: #04111e;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.status-line {
  margin: 16px 0 0;
  color: var(--muted);
  min-height: 1.5em;
}

@media (max-width: 900px) {
  .shell {
    padding: 10px;
  }

  .terminal-frame {
    height: calc(100vh - 20px);
  }

  .terminal-chrome {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .actions {
    flex-direction: column;
  }
}
