/* Sign-in and account administration (B4).
 *
 * Loaded alongside dashboard.css, which already carries the palette and the
 * type scale — this file adds only what a centred form needs, so the two pages
 * cannot drift apart in colour or weight.
 */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
}

#card {
  width: min(28rem, calc(100vw - 2rem));
  padding: 2rem;
  border: 1px solid var(--line, #2a3038);
  border-radius: 10px;
  background: var(--panel, #161a1f);
}

#card #brand {
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

#card form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#card label {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  opacity: 0.75;
}

#card input[type="email"],
#card input[type="password"],
#card input[type="text"] {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line, #2a3038);
  border-radius: 6px;
  background: var(--bg, #0f1215);
  color: inherit;
  font: inherit;
}

#card input:focus-visible {
  outline: 2px solid var(--accent, #4aa3ff);
  outline-offset: 1px;
}

/* A code field is read off a phone and typed under a 30-second clock. Wide
   spacing and a monospace face make a transposed digit visible before it is
   submitted. */
#code,
#enrol-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.3em;
  text-align: center;
}

#card button {
  margin-top: 1.25rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent, #4aa3ff);
  color: #06090c;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#card button:disabled {
  opacity: 0.5;
  cursor: default;
}

#card button.secondary {
  background: transparent;
  border: 1px solid var(--line, #2a3038);
  color: inherit;
  font-weight: 400;
}

.hint {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0.8;
}

.hint.subtle {
  opacity: 0.55;
}

.hint.warn {
  padding: 0.6rem 0.7rem;
  border-left: 3px solid #e0a03a;
  background: rgba(224, 160, 58, 0.08);
  opacity: 1;
}

.error {
  margin: 1rem 0 0;
  padding: 0.6rem 0.7rem;
  border-left: 3px solid #e05a5a;
  background: rgba(224, 90, 90, 0.08);
  font-size: 0.85rem;
}

#qr {
  display: block;
  margin: 1rem auto 0.5rem;
  /* The QR is drawn on a canvas, so it carries no background of its own; a
     scanner needs the light quiet zone around the dark modules. */
  padding: 0.5rem;
  border-radius: 6px;
  background: #fff;
}

#manual summary {
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.8;
}

.key {
  display: block;
  margin-top: 0.4rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line, #2a3038);
  border-radius: 6px;
  background: var(--bg, #0f1215);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
  user-select: all;
}

.codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
  margin: 1rem 0;
  padding: 0.8rem;
  border: 1px solid var(--line, #2a3038);
  border-radius: 6px;
  background: var(--bg, #0f1215);
  list-style: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  user-select: all;
}

.check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  opacity: 0.85;
}

.check input {
  width: 1rem;
  height: 1rem;
}

/* --- admin ---------------------------------------------------------------- */

.admin-page {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

/* The input rules above are scoped to #card, which is the sign-in panel. The
   admin page has no #card, so without these its fields fall back to browser
   defaults -- a white box on a dark bar, which is exactly how it first
   rendered. */
.admin-page h2 {
  margin: 2rem 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa0a6;
}

.admin-page section:first-of-type h2 {
  margin-top: 1.25rem;
}

.admin-page > .hint {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #262c33;
}

#form-create {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

#form-create label {
  font-size: 0.8rem;
  opacity: 0.7;
}

#form-create input {
  flex: 1 1 18rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #262c33;
  border-radius: 6px;
  background: #0f1215;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
}

#form-create input:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: 1px;
}

#form-create button {
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: 6px;
  background: #8ab4f8;
  color: #06090c;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

#form-create button:disabled {
  opacity: 0.45;
  cursor: default;
}

.admin-page table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.88rem;
}

.admin-page th,
.admin-page td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line, #2a3038);
  text-align: left;
  vertical-align: top;
}

.admin-page th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}

.admin-page .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-page .row-actions button {
  margin: 0;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line, #2a3038);
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.admin-page .row-actions button:hover {
  border-color: var(--accent, #4aa3ff);
}

/*
 * The role this account HOLDS on this project, as opposed to one it could be
 * given. Exactly one of the four buttons per project is lit at any time --
 * `none` included, so "no access" is a positive statement rather than the
 * absence of a highlight.
 *
 * FILLED, NOT JUST OUTLINED. Every button here already gains an accent border
 * on hover, so a border alone would say "lit" and "the pointer happens to be
 * here" with the same mark. The fill is what separates them.
 *
 * Colour is not the only carrier: the button is also aria-pressed, and the
 * font-weight shift survives a monochrome or high-contrast rendering.
 */
.admin-page .row-actions button.role.active {
  background: var(--accent, #4aa3ff);
  border-color: var(--accent, #4aa3ff);
  color: #0b0d10;
  font-weight: 600;
}

.admin-page .row-actions button.role.active:hover {
  /* Hover must not undo the fill, or the lit button loses its mark under the
     pointer -- which is precisely when it is being read. */
  filter: brightness(1.1);
}

.pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line, #2a3038);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.pill.admin {
  border-color: #e0a03a;
  color: #e0a03a;
}
.pill.inspector {
  border-color: #4aa3ff;
  color: #4aa3ff;
}
.pill.viewer {
  opacity: 0.7;
}

/* A generated password or reset code appears here exactly once. It is styled
   loudly on purpose: it cannot be retrieved again, and a value that scrolls
   past unnoticed means another reset. */
.once {
  margin-top: 1rem;
  padding: 0.8rem;
  border: 1px solid #e0a03a;
  border-radius: 6px;
  background: rgba(224, 160, 58, 0.08);
}

.once code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  user-select: all;
}

/* Support reports (D171). The buttons match .row-actions so the operator's two
   tables read as one page, and an opened report lays its facts out as label /
   value rows -- eight facts as a small table, not sixteen stacked lines. */
.admin-page #reports-table button,
.admin-page #reports-older,
.admin-page #report-detail > button {
  margin: 0;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line, #2a3038);
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.admin-page #reports-table button:hover,
.admin-page #reports-older:hover,
.admin-page #report-detail > button:hover {
  border-color: var(--accent, #4aa3ff);
}

.admin-page #reports-older {
  margin-top: 0.6rem;
}

#report-detail {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line, #2a3038);
  border-radius: 6px;
}

#report-detail h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

#report-detail dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1.2rem;
  margin: 0 0 0.9rem;
  font-size: 0.88rem;
}

#report-detail dt {
  opacity: 0.6;
}

#report-detail dd {
  margin: 0;
}

/* The viewer's own words: set apart, in the page's font, never monospace. */
#report-detail pre {
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--accent, #4aa3ff);
  background: rgba(255, 255, 255, 0.03);
  font: inherit;
}

#report-detail figure {
  display: inline-block;
  margin: 0 0.8rem 0.8rem 0;
  vertical-align: top;
}

#report-detail figcaption {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* The reveal beside the temporary-password field. Deliberately quiet: it is a
   diagnostic affordance, not a step in the flow. */
#card button.reveal {
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line, #2a3038);
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.75;
  cursor: pointer;
}

#card button.reveal:hover {
  opacity: 1;
  border-color: var(--accent, #4aa3ff);
}
