/* Served from this host. No webfont, no CDN — the box has no egress and these
   pages must render identically on a LAN with no internet.

   Deliberately close to the static cover page's styling: the apex is the first
   thing an anonymous visitor sees, and it should not look like a different site
   from the one that was there before. */

:root {
  --ink: #24303a;
  --muted: #5a6b7a;
  --line: #d9e0e6;
  --bg: #ffffff;
  --accent: #2d6a9f;
  --warn-bg: #fff6e5;
  --warn-line: #e8c583;
  --error-bg: #fdecea;
  --error-line: #e4a9a3;
  --ok-bg: #edf7ee;
  --ok-line: #a8cfaa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #dde5ec;
    --muted: #9aa9b6;
    --line: #33404c;
    --bg: #161c22;
    --accent: #7fb3dc;
    --warn-bg: #33291a;
    --warn-line: #6b5427;
    --error-bg: #35211f;
    --error-line: #7a3f39;
    --ok-bg: #1e2b1f;
    --ok-line: #3f6b43;
  }
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  margin: 0;
}

.wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

header.site {
  padding: 1rem 0 2rem;
}

.brand {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

h1 { font-size: 1.35rem; font-weight: 600; margin-bottom: .4rem; }
h2 { font-size: 1.05rem; font-weight: 600; margin-top: 2rem; }

p { margin: .6rem 0; }
.lede { font-size: 1.05rem; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .875rem; }

a { color: var(--accent); }

label {
  display: block;
  margin-top: 1rem;
  font-size: .875rem;
  font-weight: 600;
}

input[type="text"], input[type="email"], input[type="password"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: .55rem .65rem;
  margin-top: .25rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  margin-top: 1.5rem;
  padding: .55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .72;
}

.submit-status {
  display: inline-block;
  margin-left: .65rem;
  color: var(--muted);
  font-size: .875rem;
}

.submit-status[hidden] { display: none; }

.flashes { list-style: none; padding: 0; margin: 0 0 1rem; }

.flash {
  padding: .6rem .8rem;
  margin-bottom: .5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: .925rem;
}

.flash-error { background: var(--error-bg); border-color: var(--error-line); }
.flash-ok { background: var(--ok-bg); border-color: var(--ok-line); }

.warn {
  padding: .6rem .8rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 4px;
  font-size: .925rem;
}

/* The QR needs a white quiet zone regardless of colour scheme — an inverted
   QR code is unreadable to most scanners. */
.qr {
  display: inline-block;
  padding: .75rem;
  margin: 1rem 0;
  background: #fff;
  border-radius: 4px;
}

.secret code, .codes code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95rem;
  letter-spacing: .04em;
}

.codes { list-style: none; padding: 0; columns: 2; }
.codes li { padding: .2rem 0; break-inside: avoid; }

.apps, .orgs { padding-left: 1.1rem; }
.apps li, .orgs li { padding: .2rem 0; }

/* The sign-in surface is the common front door for every elmbench app. It
   intentionally shares Qatre's calm teal/paper language without adopting an
   individual relying party's name or clinical context. */
.login-screen {
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 14%, rgba(94, 234, 212, .25), transparent 22rem),
    linear-gradient(145deg, #0c4f4b, #0f766e 62%, #15847b);
}

.login-screen .wrap {
  display: grid;
  align-content: center;
  width: min(30rem, calc(100% - 2rem));
  min-height: 100vh;
  padding: 1rem 0;
}

.login-screen header.site { padding: 0 0 .8rem; text-align: center; }
.login-screen .brand { color: rgba(255,255,255,.9); font-size: .86rem; letter-spacing: .04em; }
.login-screen .flashes { margin-bottom: .8rem; }

.login-card {
  padding: clamp(1.75rem, 7vw, 3rem);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 1.9rem;
  color: #163330;
  background: rgba(255,255,255,.97);
  box-shadow: 0 1.75rem 5rem rgba(4,47,43,.28);
}

.identity-mark {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto 1rem;
  border-radius: 55% 45% 58% 42% / 62% 48% 52% 38%;
  color: #134e4a;
  background: linear-gradient(145deg, #f0fdfa, #8cf0dc);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 .5rem 1.25rem rgba(0,0,0,.14);
  font-size: 1.55rem;
  font-weight: 800;
}

.login-eyebrow { margin: 0; color: #0f766e; text-align: center; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.login-card h1 { margin: .2rem 0 0; color: #163330; text-align: center; font-size: clamp(1.8rem, 7vw, 2.5rem); }
.login-lede { margin: .3rem auto 1.35rem; max-width: 28ch; color: #607571; text-align: center; }
.login-card label { color: #405a56; }
.login-card input[type="email"], .login-card input[type="password"] { min-height: 3rem; padding: .65rem .8rem; border-color: #d6e6e1; border-radius: .75rem; color: #163330; background: #fff; }
.login-card input:focus { outline: 3px solid #14b8a6; outline-offset: 2px; }
.login-card .login-submit { width: 100%; min-height: 3.25rem; border-radius: .9rem; background: linear-gradient(135deg, #0f766e, #0d9488); box-shadow: 0 .75rem 1.5rem rgba(15,118,110,.2); }
.login-card > .muted { margin-top: 1rem; text-align: center; }
.login-card a { color: #0f766e; }

@media (prefers-color-scheme: dark) {
  .login-card { color: #163330; background: rgba(255,255,255,.97); }
}
