/* These styles are generated from project.scss. */

.alert-debug {
  color: black;
  background-color: white;
  border-color: #d6e9c6;
}

.alert-error {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
}

/* Visitor kiosk
   ------------------------------------------------------------------------- */

/* The badge number a visitor has just been given: wide enough to read at
   arm's length, narrow enough not to sprawl across an iPad in landscape. */
.badge-card {
  max-width: 16rem;
}

/* NDA signing — a document you scroll, with the field on the line
   ------------------------------------------------------------------------- */

.nda {
  display: flex;
  flex-direction: column;
  /* Sized against the viewport less the panel's own margins, so the foot bar
     with "Agree and sign" on it stays on screen rather than being pushed
     under the fold — which is exactly how the copy question went missing. */
  height: calc(100vh - 4rem);
  max-height: 56rem;
}

/* Stays put while the document scrolls, so "Agree and sign" is always reachable
   without hunting back up a six-page agreement. */
.nda__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid #dee2e6;
}

.nda__pages {
  flex: 1 1 auto;
  /* Flex children default to min-height: auto, so a pane full of tall page
     canvases refuses to shrink and shoves everything after it off the bottom
     of the screen — which is how the "email me a copy" question disappeared.
     Zero lets it give way and scroll instead. */
  min-height: 0;
  overflow-y: auto;
  background: #525659;
  padding: 1rem;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.nda__page {
  position: relative;
  margin: 0 auto 1rem;
  background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 40%);
}

/* The dotted field sitting on the document's own signature line. */
.nda__field {
  position: absolute;
  padding: 0;
  background: rgb(255 235 130 / 45%);
  border: 2px dashed #b58900;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: nda-field-pulse 2s ease-in-out 3;
}

.nda__field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #7a5c00;
  white-space: nowrap;
}

.nda__field--signed {
  background: transparent;
  border-color: transparent;
  animation: none;
}

.nda__field img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes nda-field-pulse {
  50% {
    box-shadow: 0 0 0 6px rgb(181 137 0 / 25%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nda__field {
    animation: none;
  }
}

.signature-pad-wrap {
  position: relative;
}

.signature-pad {
  width: 100%;
  height: 220px;
  display: block;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background: #fff;
  touch-action: none;
}

/* The line people instinctively sign on. */
.signature-pad__hint {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 3rem;
  border-bottom: 1px solid #adb5bd;
  color: #adb5bd;
  font-size: 0.8rem;
  text-align: center;
  pointer-events: none;
}

/* Badge entry — a cash-machine keypad
   -------------------------------------------------------------------------
   Sized for a finger on an iPad at arm's length, not a mouse. Keys are large
   enough to hit without looking, and the display is readable while standing
   back from the stand. */

.keypad {
  max-width: 22rem;
  margin: 0 auto;
}

.keypad__display {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.keypad__cell {
  font-feature-settings: "tnum";
  width: 3.5rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: #fff;
  border: 2px solid #ced4da;
  border-radius: 0.5rem;
  color: #212529;
}

.keypad__cell--filled {
  border-color: #0d6efd;
}

/* Marks the cell the next digit lands in, so there is no guessing about
   where you are in the number. */
.keypad__cell--next {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgb(13 110 253 / 20%);
}

.keypad__keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.keypad__key {
  height: 4.5rem;
  font-size: 1.75rem;
  font-weight: 500;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.5rem;
  color: #212529;
  /* Stops a fast double tap zooming the page instead of entering a digit. */
  touch-action: manipulation;
  user-select: none;
}

.keypad__key:active {
  background: #e9ecef;
  transform: translateY(1px);
}

.keypad__key--muted {
  font-size: 1.1rem;
  color: #6c757d;
  background: #f8f9fa;
}

.keypad__actions {
  margin-top: 1.25rem;
}

.keypad__enter {
  width: 100%;
  padding-block: 1rem;
  font-size: 1.25rem;
}

.keypad__error {
  margin-bottom: 0;
}

/* The foot of the signing screen: the offer of a copy, and the button that
   commits to signing. Both live here rather than in the top bar, because
   agreeing to something belongs next to what you are agreeing to, not in a
   corner above it. */
.nda__foot {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem;
  background: #fff;
  border-top: 1px solid #dee2e6;
}


/* Waiting
   -------------------------------------------------------------------------
   A visitor who taps and sees nothing taps again. On a kiosk that means a
   double submission, or someone deciding the thing is broken and walking off
   to find a person — so anything that takes a moment says so. */

.kiosk-wait {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(255 255 255 / 85%);
  backdrop-filter: blur(2px);
}

.kiosk-wait[hidden] {
  display: none;
}

.kiosk-wait__inner {
  text-align: center;
}

.kiosk-wait__spinner {
  width: 3.5rem;
  height: 3.5rem;
  border-width: 0.35rem;
  color: #0d6efd;
}

.kiosk-wait__text {
  margin-top: 1rem;
  font-size: 1.25rem;
  color: #495057;
}

/* Someone who has asked for less movement still needs to know it is working,
   so the spinner stays but stops spinning. */
@media (prefers-reduced-motion: reduce) {
  .kiosk-wait__spinner {
    animation: none;
    opacity: 0.6;
  }
}

/* Geologica
   -------------------------------------------------------------------------
   Self-hosted rather than linked from Google, for the same reason pdf.js is:
   a reception desk should not depend on another company's CDN being up. It
   also keeps visitors' IP addresses out of Google's logs, which is worth
   caring about in a system whose whole job is recording who came to the
   building.

   One variable file per subset covers 300-700, so the weights below cost
   nothing extra to use. */

@font-face {
  font-family: Geologica;
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/geologica-latin.e4c4c9b74c7e.woff2") format("woff2");
  unicode-range: u+0000-00ff, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da,
    u+02dc, u+0304, u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193,
    u+2212, u+2215, u+feff, u+fffd;
}

@font-face {
  font-family: Geologica;
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/geologica-latin-ext.289a4a0e97ea.woff2") format("woff2");
  unicode-range: u+0100-02ba, u+02bd-02c5, u+02c7-02cc, u+02ce-02d7, u+02dd-02ff,
    u+0304, u+0308, u+0329, u+1d00-1dbf, u+1e00-1e9f, u+1ef2-1eff, u+2020,
    u+20a0-20ab, u+20ad-20c0, u+2113, u+2c60-2c7f, u+a720-a7ff;
}

/* Applied to everything Bootstrap would otherwise set in its own stack, and
   to form controls, which browsers style with the system font unless told. */
body,
.btn,
.form-control,
.form-select,
.form-label,
.navbar,
.modal,
input,
button,
select,
textarea {
  font-family: Geologica, -apple-system, blinkmacsystemfont, "Segoe UI", roboto,
    sans-serif;
}

/* Blue Zoo look
   -------------------------------------------------------------------------
   The gradient spans the width and repeats downwards, so a long page — the
   fire register, a scrolling agreement — carries on into it rather than
   running out of background halfway down. */

body {
  /* A column, so .page can take whatever is left after the nav rather than
     assuming the whole viewport and pushing a scrollbar onto every page that
     has one. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* Added to the home screen there is no address bar to drag, so a swipe that
     bounces the whole page is just the screen coming loose in someone's hand.
     Inner scrollers — the agreement — still scroll. */
  overscroll-behavior: none;
  /* Kills the 300ms wait for a second tap, and with it double-tap zoom. A
     kiosk is all buttons; nobody is pinching into this. */
  touch-action: manipulation;
  background-color: #f2f4f7;
  background-image: url("../images/grad.5b308d2df26b.jpg");
  background-repeat: repeat-y;
  background-size: 100% auto;
  background-position: top center;
}

/* Holds the card in the middle of the screen. `margin: auto` on the child
   rather than `justify-content: center` on purpose: centring a flex child that
   grows taller than its container clips the top and puts it out of reach of
   scrolling, which on a long agreement or a full fire register would hide the
   part people came for. */
/* The padding carries the safe areas. Running full screen, the top of this is
   under the clock and the bottom is under the home indicator; env() is zero on
   everything that has neither, so the same rule serves a desktop browser. */
.page {
  display: flex;
  flex: 1;
  padding: calc(2rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right))
    calc(2rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left));
}

/* Everything readable sits on white. The gradient is a backdrop, never
   something text has to be legible against. */
.panel {
  width: 100%;
  max-width: 46rem;
  margin: auto;
  padding: 2.5rem;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 0.5rem 2rem rgb(16 24 40 / 12%);
}

/* The sign-in card, which holds one field and a button. */
.panel--narrow {
  max-width: 30rem;
}

/* Pages that need the room: the agreement viewer and the fire register. */
.panel--wide {
  max-width: 68rem;
}

/* The signing screen manages its own height, so it gets a panel with no
   padding to fight and squared-off internals. */
.panel--flush {
  padding: 0;
  overflow: hidden;
}

.panel__logo {
  display: block;
  width: 14.3rem;
  /* Raised alongside the width, or the percentage caps it on a narrow card
     and the increase quietly does nothing on the screen it was asked for. */
  max-width: 78%;
  height: auto;
  margin: 0 auto 2rem;
}

@media (width <= 36rem) {
  .page {
    padding: calc(1rem + env(safe-area-inset-top)) calc(0.75rem + env(safe-area-inset-right))
      calc(1rem + env(safe-area-inset-bottom)) calc(0.75rem + env(safe-area-inset-left));
  }

  .panel {
    padding: 1.5rem;
    border-radius: 1rem;
  }
}

/* Hierarchy on the entrance pages
   -------------------------------------------------------------------------
   Three tiers, because there were none: the thing to do, the thing to know,
   and the thing to read only if stuck. */

.panel__title {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.panel__lead {
  margin-bottom: 2rem;
  color: #667085;
  font-size: 1.0625rem;
  line-height: 1.5;
}

/* The action is the largest thing on the page, and full width, because it is
   the only reason anyone opened it. It also has to be hit with a thumb.
   `.btn-prominent` carries this to the action that is a link rather than a
   submit — the sign-in page's, which was otherwise shrink-wrapped and half the
   width of the identical-looking button on the page it leads to. */
.panel .btn-prominent,
.panel form .btn[type="submit"],
.panel form button[type="submit"] {
  width: 100%;
  padding-block: 0.9rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

/* Stacked actions need air between them: two solid buttons flush against each
   other read as one control with two labels. Scoped to the entrance card,
   which is the only place buttons stack — the kiosk sets its own out in rows,
   and a top margin there would drop one of a pair below the other. */
.panel--narrow .btn + .btn {
  margin-top: 0.75rem;
}

.panel form .form-control {
  padding-block: 0.75rem;
  font-size: 1.0625rem;
}

/* One field on the page, already labelled by its own placeholder. */
.panel form .form-label,
.panel form label[for="id_email"] {
  font-weight: 500;
  color: #344054;
}

/* The second way in. A rule with "or" set into it, rather than a heading:
   Google is an alternative to the action above, not a section of its own. */
.panel__or {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0;
  color: #98a2b3;
  font-size: 0.875rem;
}

.panel__or::before,
.panel__or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #eaecf0;
}

.panel__providers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Matches the height of the action it sits under, so the two read as a pair
   rather than as a button and a leftover. */
.btn-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding-block: 0.9rem;
  color: #344054;
  font-size: 1.0625rem;
  font-weight: 600;
  border-color: #d0d5dd;
}

.btn-provider:hover,
.btn-provider:focus-visible {
  color: #101828;
  background: #f9fafb;
  border-color: #98a2b3;
}

/* The ways out of a step: resend a code, start again. Quiet and side by side,
   because they are alternatives to the action rather than rivals to it — as
   full-width buttons they read as a second and third thing to do, and two
   solid buttons stacked with no gap read as one broken control. */
.panel__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin-top: 1.25rem;
}

.panel__action {
  padding: 0.25rem 0;
  color: #667085;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.panel__action:hover,
.panel__action:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
}

/* True, occasionally needed, and not what anyone is here to read. */
.panel__notes {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eaecf0;
  color: #667085;
  font-size: 0.875rem;
}

.panel__notes p {
  margin-bottom: 0.75rem;
}

.panel__notes p:last-child {
  margin-bottom: 0;
}

/* The privacy link. Present on every kiosk step, because a visitor should be
   able to read it before handing over a signature rather than after — and
   quiet, because it is not what they are there to do. */
.panel__footer {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid #eaecf0;
  color: #98a2b3;
  font-size: 0.8125rem;
  text-align: center;
}

.panel__footer a {
  color: #667085;
}

/* The camera step
   -------------------------------------------------------------------------
   A fixed frame, so the buttons underneath do not jump about as the camera
   starts, a still replaces the preview, or an error message takes its place. */

.photo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #101828;
  border-radius: 0.75rem;
}

/* Both the live feed and the still shown back afterwards, so the framing does
   not jump between pressing the button and approving the result. */
.photo__view {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Mirrored, because a preview that moves the opposite way to your hand is
     oddly hard to line yourself up in — then scaled in on the middle of the
     frame, because the camera takes in the whole desk and this screen is
     asking for a face. The factor comes from VISITOR_PHOTO_ZOOM, set on the
     container by the template, so the preview and the picture the host is
     sent are cropped by the same amount. The container clips it. */
  transform: scaleX(-1) scale(var(--photo-zoom, 1));
}

.photo__message {
  margin: 0;
  padding: 2rem;
  color: #f2f4f7;
}

/* "Step 2 of 5", above the heading rather than below it. Someone at a desk
   wants to know how much longer this is going to take before they read what
   the screen is asking of them. */
.panel__step {
  margin-bottom: 0.35rem;
  color: #98a2b3;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Landscape on the iPad
   -------------------------------------------------------------------------
   The stand is turned so the camera sits above the visitor's face rather than
   off to one side, which leaves a screen that is wide and short. A card capped
   at 46rem then wastes the width sideways and spends height it has not got, so
   on the kiosk the card takes the room it is given and a sentence runs the
   full measure. The portal's own pages are read on a laptop and keep theirs,
   which is why this hangs off the kiosk body class rather than .panel itself.

   Only prose wants that width. A field you type into or a button you tap is a
   worse target at 60rem than at 30 — the eye has to travel to find it — so
   those keep their own size and centre in the space around them. */

.kiosk .panel,
.kiosk .panel--narrow,
.kiosk .panel--wide {
  width: 90%;
  max-width: none;
}

.kiosk .panel__controls {
  max-width: 32rem;
  margin-inline: auto;
}

/* The camera frame is 4:3 and takes its height from its width, so across a
   full-width card it stands taller than a landscape iPad and pushes the
   buttons under it off the bottom of the screen. Bounded by the height that
   actually exists instead, so the whole step is reachable without scrolling. */
.kiosk .photo {
  max-width: calc(52vh * 4 / 3);
  margin-inline: auto;
}

/* Which build is serving
   -------------------------------------------------------------------------
   Bottom right of every page, over the gradient rather than the card. White
   and faint: legible to somebody looking for it, invisible to a visitor who
   is not. Pinned to the viewport so a long page — the agreement, the fire
   register — does not carry it off the bottom of the screen, and unclickable
   so it can never take a tap meant for something behind it. */

.build-sha {
  position: fixed;
  right: calc(0.75rem + env(safe-area-inset-right));
  bottom: calc(0.5rem + env(safe-area-inset-bottom));
  z-index: 1;
  color: #fff;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  opacity: 55%;
  pointer-events: none;
  user-select: none;
}
