/* Shared design tokens and building blocks for every page.
   Typeface: Atkinson Hyperlegible, designed by the Braille Institute for
   readability, which suits a lobby screen read by every kind of visitor. */

@font-face {
  font-family: 'Atkinson';
  src: url('/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson';
  src: url('/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #17212f;
  --ink-soft: #3a4656;
  --muted: #5b6675;
  --paper: #f4f6f8;
  --surface: #ffffff;
  --rule: #d9dfe5;
  --teal: #0b6e6e;        /* primary actions: the "lobby" colour */
  --teal-dark: #08575a;
  --teal-tint: #e3f1f0;
  --amber: #f2b705;       /* visitor-pass strip and walk-ins */
  --amber-tint: #fdf3d3;
  --danger: #b42318;
  --danger-tint: #fdeceb;

  --font: 'Atkinson', 'Segoe UI', system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.125rem;

  --radius-s: 6px;
  --radius-m: 10px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
a { color: var(--teal); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font: inherit; font-weight: 700; line-height: 1.2;
  padding: 0.7em 1.15em; border-radius: var(--radius-s);
  border: 1.5px solid var(--teal); background: var(--teal); color: #fff;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--teal); }
.btn-quiet:hover { background: var(--teal-tint); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-tint); }
.btn-small { padding: 0.4em 0.75em; font-size: var(--step--1); }
.btn-block { width: 100%; }

/* ---- Forms ---- */
.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; align-content: start; }
.field label, .label { font-weight: 700; font-size: var(--step--1); color: var(--ink-soft); }
.field .hint { font-size: var(--step--1); color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search],
input[type=datetime-local], input[type=date], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--rule); border-radius: var(--radius-s);
  padding: 0.6em 0.75em; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-tint); }
textarea { resize: vertical; min-height: 4.5em; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; accent-color: var(--teal); }

/* ---- Messages ---- */
.notice { padding: 0.75rem 1rem; border-radius: var(--radius-s); margin-bottom: 1rem; border-left: 4px solid; }
.notice-error { background: var(--danger-tint); border-color: var(--danger); }
.notice-ok { background: var(--teal-tint); border-color: var(--teal); }
.notice-info { background: var(--amber-tint); border-color: var(--amber); }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 0.75rem 1.25rem; border-radius: var(--radius-s);
  z-index: 100; max-width: calc(100% - 2rem);
}
.toast.error { background: var(--danger); }

/* ---- Single-card pages (login, set password, decision) ---- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.auth-card {
  width: 100%; max-width: 26rem; background: var(--surface);
  border: 1px solid var(--rule); border-top: 6px solid var(--teal);
  border-radius: var(--radius-m); padding: 2rem 1.75rem;
}
.auth-card .brand { font-weight: 700; color: var(--teal); margin-bottom: 1.5rem; }
.auth-card .links { margin-top: 1.25rem; font-size: var(--step--1); }

.muted { color: var(--muted); }
.small { font-size: var(--step--1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Password rule checklist ---- */
.pw-rules { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.2rem; font-size: var(--step--1); color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 0.5rem; }
.pw-rules li::before {
  content: ''; width: 0.95rem; height: 0.95rem; flex: none; border-radius: 50%;
  border: 1.5px solid var(--rule); background: var(--surface);
}
.pw-rules li.met { color: var(--teal-dark); }
.pw-rules li.met::before {
  border-color: var(--teal);
  background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}

.keep label { font-weight: 400; color: var(--ink); font-size: var(--step-0); display: grid; }
.keep .hint { font-size: var(--step--1); color: var(--muted); }

.signed-in { display: grid; gap: 0.6rem; margin-bottom: 0.5rem; }
.signed-in p { margin: 0; }
