/* Form controls — 8px radius, mono labels, green focus glow. */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.form-label .req {
  color: var(--danger);
}

.input,
.textarea,
.select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea,
.textarea {
  min-height: 110px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(0, 200, 80, 0.15);
}

.input.is-invalid,
input.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
}

.form-help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 0.35rem;
}

.form-error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--danger);
  margin-top: 0.35rem;
}

/* Auth screens (login / password reset) — dark, centered terminal card */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  padding: 1.5rem;
  position: relative;
}

.auth-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 200, 80, 0.02) 2px,
    rgba(0, 200, 80, 0.02) 4px
  );
}

.auth-card {
  width: min(420px, 100%);
  background: var(--dark-green);
  border: 1px solid rgba(0, 200, 80, 0.22);
  border-radius: var(--radius-card);
  padding: 2.25rem;
  position: relative;
  z-index: 1;
  color: var(--text-inverse);
}

.auth-card .form-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
}

.auth-card .form-label .req {
  color: var(--gold-light);
}

.auth-card .input,
.auth-card input {
  background: rgba(4, 14, 7, 0.7);
  border-color: rgba(0, 200, 80, 0.25);
  color: var(--text-inverse);
}

.auth-brand {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: var(--text-inverse);
  text-align: center;
  margin-bottom: 0.25rem;
}

.auth-brand em {
  color: var(--gold);
  font-style: normal;
}

.auth-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0, 200, 80, 0.72);
  text-align: center;
  margin-bottom: 1.75rem;
}

/* Secondary prompt under the auth form ("New here? Create an account") */
.auth-alt {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 200, 80, 0.14);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
}

.auth-alt a {
  color: var(--primary-light);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0, 200, 80, 0.4);
}

.auth-alt a:hover {
  color: var(--text-inverse);
  text-decoration-color: var(--primary-light);
}

/* Muted prose inside the dark card (choose-team explanations) */
.auth-card .text-muted {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.925rem;
  line-height: 1.55;
}

/* Inputs on the dark card: body font at a comfortable size */
.auth-card .input,
.auth-card input:not([type="hidden"]) {
  font-family: var(--font-body);
  font-size: 0.95rem;
}

/* ── Auth screens: one centered card on the terminal ground ──────────── */
.auth-body { background: var(--background); min-height: 100vh; }

/* Faint grid instead of scanlines: reads as a workspace, not a CRT. */
.auth-shell-grid {
  flex-direction: column;
  background-color: var(--background);
  background-image:
    linear-gradient(rgba(0, 200, 80, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 200, 80, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}
.auth-shell-grid::before {
  /* soft green glow behind the card */
  background: radial-gradient(60% 45% at 50% 42%, rgba(0, 122, 61, 0.22), transparent 70%);
}

.auth-home {
  position: absolute; top: 1.25rem; left: 1.5rem; z-index: 2;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(0, 200, 80, 0.75); text-decoration: none;
}
.auth-home:hover { color: var(--text-inverse); }

.auth-stack {
  position: relative; z-index: 1;
  width: min(460px, 100%);
  display: flex; flex-direction: column; align-items: stretch; gap: 1.5rem;
}

.auth-mark { text-align: center; }
.auth-logo {
  width: 44px; height: 44px; object-fit: contain; display: block;
  margin: 0 auto 0.75rem; filter: drop-shadow(0 0 12px rgba(0, 200, 80, 0.35));
}
.auth-mark .auth-brand { margin-bottom: 0.35rem; font-size: 2.2rem; }
.auth-mark .auth-sub { margin-bottom: 0; }

.auth-stack .auth-card {
  width: 100%;
  padding: 2.25rem 2.5rem;
  border-color: rgba(0, 200, 80, 0.3);
  box-shadow: 0 0 0 1px rgba(0, 200, 80, 0.06), 0 30px 60px rgba(0, 0, 0, 0.45);
}

.auth-heading {
  font-family: var(--font-display); font-size: 1.9rem; letter-spacing: 0.04em;
  color: var(--text-inverse); margin: 0 0 0.3rem; line-height: 1;
}
.auth-lead {
  font-family: var(--font-body); font-size: 0.93rem; color: rgba(255, 255, 255, 0.58);
  margin: 0 0 1.5rem; line-height: 1.5;
}

.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

.auth-foot {
  text-align: center; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 520px) {
  .auth-stack .auth-card { padding: 1.75rem 1.25rem; }
  .auth-row { grid-template-columns: 1fr; }
}

/* ---- consent checkbox -------------------------------------------------
   The tick sits beside its sentence rather than above it: a checkbox whose
   label wraps underneath reads as two separate things, and consent has to
   be unambiguous about what is being agreed to.

   The selector has to out-rank `.auth-card .form-label` (0,2,0), which sets
   11px uppercase — right for a field caption, wrong for a sentence somebody
   has to read and mean. */
.consent-check label,
.consent-check label.form-label,
.auth-card .consent-check label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.78rem;
  line-height: 1.55;
  /* Readable on an ordinary light card. The inverse token below is for the
     dark auth card only -- used as the default it rendered white on white,
     so every consent label was invisible while its checkbox was not. */
  color: var(--muted);
}
.auth-card .consent-check label { color: var(--text-inverse-dim); }
.consent-check label span { flex: 1 1 auto; }
.consent-check input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary-light);
}
.consent-check .form-error {
  color: var(--danger);
  font-size: 0.72rem;
  margin-top: 0.4rem;
}

/* ---- form actions -----------------------------------------------------
   Used by five templates and styled by none of them, so a Save button and
   a Cancel link sat jammed together with no gap and no alignment. Submit
   leads; anything after it is secondary and sits beside, not under. */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.form-actions .btn { margin: 0; }
/* Push a trailing cancel away from the primary action, so the two are
   not adjacent targets. */
.form-actions .btn-ghost:last-child { margin-left: auto; }
@media (max-width: 480px) {
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn-ghost:last-child { margin-left: 0; }
}
