/* 5250-style green-screen for the GROCERY lab.
   Uses Px437 IBM VGA8 (downloaded via the @font-face below — falls back
   to any monospace if the font hosting hops fail). */

@font-face {
  font-family: "PxIBM";
  src: url("/static/Px437_IBM_VGA8.woff") format("woff");
  font-display: swap;
}

:root {
  --bg: #000;
  --fg: #00ff66;          /* IBM 3279 green */
  --fg-dim: #009933;
  --fg-accent: #ffffff;   /* highlight rows */
  --fg-error: #ff5050;
  --fg-amber: #ffb000;    /* protected-field colour */
  --col: 8.6px;           /* approx 80 cols on a 720px viewport */
  --line: 1.35em;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "PxIBM", "IBM Plex Mono", "Courier New", monospace;
  font-size: 18px;
  line-height: var(--line);
  letter-spacing: 0.5px;
}

body::before {
  /* faint CRT scanlines */
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.25) 3px, rgba(0,0,0,0) 4px
  );
  z-index: 9999;
}

.screen {
  max-width: 80ch;
  margin: 0 auto;
  padding: 1ch 2ch 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  justify-content: space-between;
  white-space: pre;
}

.title-bar {
  text-align: center;
  font-weight: bold;
  margin-bottom: 1em;
}

.sys-bar {
  color: var(--fg-dim);
  margin-bottom: 1em;
}

.body {
  flex: 1 1 auto;
  margin-bottom: 1em;
}

.field {
  color: var(--fg-amber);
}

.input-bar {
  margin-top: 1em;
  color: var(--fg-amber);
}

.input-bar input[type="text"],
.input-bar input[type="password"],
input[type="text"],
input[type="password"],
textarea {
  background: #000;
  color: var(--fg);
  border: none;
  border-bottom: 1px solid var(--fg-dim);
  font-family: inherit;
  font-size: inherit;
  caret-color: var(--fg);
  outline: none;
  padding: 0;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-bottom: 1px solid var(--fg);
  background: #022;
}

textarea {
  width: 100%;
  min-height: 6em;
  border: 1px solid var(--fg-dim);
  padding: 0.25em 0.5em;
  resize: vertical;
}

button, .btn {
  background: #000;
  color: var(--fg);
  border: 1px solid var(--fg);
  padding: 0.1em 0.7em;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--fg); color: #000; }

a { color: var(--fg); text-decoration: underline; }
a:hover { background: var(--fg); color: #000; text-decoration: none; }

table.grid {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5em 0;
}
table.grid th, table.grid td {
  border-bottom: 1px solid var(--fg-dim);
  padding: 0 0.5ch;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
table.grid th { color: var(--fg-amber); }
table.grid tr:nth-child(2n) td { background: #001100; }

.fkey-bar {
  border-top: 1px solid var(--fg-dim);
  padding-top: 0.5em;
  color: var(--fg-dim);
  font-size: 0.9em;
  margin-top: 1em;
}
.fkey-bar b { color: var(--fg); }

.error {
  color: var(--fg-error);
  margin: 0.5em 0;
  font-weight: bold;
}

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

.hl  { color: var(--fg-accent); }

/* selection */
::selection { background: var(--fg); color: #000; }
