/* Browser SSH session + connect form. Loaded on both the standalone
   gateway page and the PHP drop-in at /terminal. */

.ssh-hero-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  align-items: start;
}

#ssh-connect h1 s {
  color: var(--text-dim, #8b939e);
  text-decoration: line-through;
  text-decoration-color: var(--green, #7dff6b);
  text-decoration-thickness: 0.08em;
}

/* Homepage .term-body is capped for the hero mock. The login card
   has a real form and must grow instead of scrolling inside. */
#connect-term .term-body {
  max-height: none;
  min-height: 0;
  overflow: visible;
  padding-bottom: 1.35rem;
}

.ssh-form {
  margin-top: 0.55rem;
}

.term .field input,
.term .field select,
.term .field textarea {
  font-family: var(--mono, ui-monospace, monospace);
  border-radius: 0;
}

.auth-switch {
  display: flex;
  gap: 0.85rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  margin-top: 0.35rem;
}
.auth-switch label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--text);
}
.auth-switch input {
  accent-color: var(--green);
}

.target-line {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0.15rem 0 0.55rem;
}
.target-line .prompt { color: var(--green); }
.target-line .val { color: var(--text-bright); }

.key-warn {
  margin-top: 0.7rem;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.45;
}

.ssh-notes {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 42ch;
}
.ssh-notes h2 {
  font-size: 0.92rem;
  color: var(--green);
  margin: 0 0 0.6rem;
}
.ssh-notes p { margin: 0 0 0.85rem; }
.ssh-notes p:last-child { margin-bottom: 0; }

.file-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.4rem;
}
.file-row input[type="file"] {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

body.is-session .footer { display: none; }
body.is-session #ssh-connect { display: none; }

.ssh-session {
  display: none;
  position: fixed;
  top: calc(var(--status-h, 34px) + var(--nav-h, 58px));
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: #090b0e;
  flex-direction: column;
  min-height: 0;
}
body.is-session .ssh-session { display: flex; }

.ssh-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid var(--line, #232833);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.72rem;
  color: var(--text-dim, #8b939e);
  background: #080a0c;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.ssh-toolbar .who { color: var(--green, #7dff6b); }
.ssh-toolbar .sep { color: var(--line-strong, #2e3542); }
.ssh-toolbar .state { color: var(--amber, #e6b325); }
.ssh-toolbar .state.is-on { color: var(--green-dim, #4aa83e); }
.ssh-toolbar .state.is-err { color: var(--danger, #e85d5d); }
.ssh-toolbar .spacer { flex: 1; }
.ssh-toolbar .btn {
  padding: 0.32rem 0.55rem;
  font-size: 0.72rem;
}

.ssh-term {
  flex: 1;
  min-height: 0;
  min-width: 0;
  padding: 0.35rem 0.45rem 0.5rem;
  position: relative;
}
.ssh-term .xterm,
.ssh-term .xterm-viewport,
.ssh-term .xterm-screen {
  height: 100%;
}
.ssh-term .xterm {
  padding: 0;
}
.ssh-term .xterm-helpers textarea {
  /* keep the hidden textarea focusable for mobile keyboards */
}

.ssh-banner {
  display: none;
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  top: 0.75rem;
  z-index: 2;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--danger, #e85d5d);
  background: rgba(8, 10, 12, 0.92);
  color: var(--text-bright, #eef2f6);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.82rem;
}
.ssh-banner.is-on { display: block; }

@media (max-width: 900px) {
  .ssh-hero-grid { grid-template-columns: 1fr; }
  .ssh-notes { max-width: none; }
}

@media (max-width: 720px) {
  .ssh-toolbar { gap: 0.4rem; }
}
