/* Built for the StanbyME at 1080x1920 portrait. Its browser is an older Chromium,
   so no flex gap, inset, aspect-ratio, :has, backdrop-filter or "in oklch". */
:root {
  --ink: #231f20; /* the dark DA and ATI use */
  --muted: #4b514d;
  --ground: #f6fcf7; /* white with a trace of the brand green, not cream */
  --hair: #cecece;
  --edge: #8c8c8c; /* control borders, 3:1 on white */
  --action: #096a37; /* DA seal green: buttons, checked controls, green text */
  --action-shadow: #053d1f;
  --deep: #095437; /* DA deep green */
  --tint: #e8f3ed;
  --gold: #eedfa4; /* DA's pale gold rule */
  --gold-shadow: #c4b26b;
  --gold-strong: #f2cd5c; /* the check-in button: the same gold, deep enough to read as a button */
  --gold-strong-shadow: #9c7f1f;
  --attention: #ffdd00;
  --error: #ca3535;
  --sign: #14213d; /* the navy of the lettering on the center's wall sign */
  --r: 4px; /* the one corner radius */
  --enter: cubic-bezier(0, 0, 0.38, 0.9);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  font-size: 2.2vmin; /* for browsers without min()/max() */
  /* Sized so the portrait layout also fits when the screen is turned sideways. */
  font-size: max(12px, min(2.2vw, 1.25vh));
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

/* Type: body 1.7rem (40px on the kiosk), nothing below 1.35rem (32px), which keeps
   capitals near 6-7 mm at arm's length. Two weights. */
body {
  margin: 0;
  font-family: "Hanken Grotesk", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
  background: var(--ground);
  font-variant-numeric: tabular-nums;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 0.2rem solid var(--attention); outline-offset: 0.15rem; }
img { -webkit-user-drag: none; }

.i {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The center's lettering, laid out like its wall sign: LeAD large, the name under it,
   "Learning and" and "Discovery Center" at the same size. */
.sign { margin: 0; font-family: "Montserrat", "Hanken Grotesk", sans-serif; font-size: 4.6rem; font-weight: 700; line-height: 1; }
.sign b { display: block; font-weight: 800; }
.sign span { display: block; margin-top: 0.06em; font-size: 0.48em; line-height: 1.1; }

/* Screens are fixed, not 100vh, so phone toolbars can't push the buttons off screen. */
.screen {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
/* One step transition, reversed when going back. */
.screen.active { display: flex; animation: slide 0.24s var(--enter); }
.screen.active.back { animation-name: slide-back; }
#welcome.active, #done.active { animation-name: fade; }
#welcome, #done { overflow-y: auto; }

@keyframes slide { from { opacity: 0; transform: translateX(2rem); } to { opacity: 1; transform: none; } }
@keyframes slide-back { from { opacity: 0; transform: translateX(-2rem); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

h1 { margin: 0; font-size: 4rem; font-weight: 700; line-height: 1.05; }
h2 { margin: 0; font-size: 2.4rem; font-weight: 700; line-height: 1.15; }
.hint { margin: 0.6rem 0 0; color: var(--muted); }

/* The same band closes every screen: the GovPH footer line, with DA's gold rule above it. */
.govph {
  display: flex;
  align-items: center;
  flex: none;
  margin: 0;
  padding: 0.6rem 2.7rem;
  border-top: 5px solid var(--gold);
  background: var(--deep);
  color: #fff;
  font-size: 1.35rem;
}

/* The national coat of arms, unaltered, as in the GovPH footer on ATI's site. */
.govph img { display: block; height: 2.8rem; margin-right: 1rem; }

/* Welcome */
#welcome { background: var(--deep); color: #fff; }

.letterhead { flex: none; background: #fff; color: var(--ink); }
/* Logo on the left, lettering on the right, centred on it, as on the wall sign. */
.masthead { display: flex; align-items: center; padding: 2.2rem 2.7rem; }
.masthead img { display: block; flex: none; height: 8.5rem; }
.masthead .sign { margin-left: 1.8rem; color: var(--sign); }

/* The one gradient: lighter at the top, like light falling on one painted surface,
   from ATI green to DA's deep green. Plain stops so the older browser draws it. */
.field {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  padding: 3rem 2.7rem 3.2rem;
  background: linear-gradient(to bottom, #1a854b, #147947, #0f6c42, #0b603d, #095437);
}

.time { margin: 0; font-size: 5rem; font-weight: 700; line-height: 1; }
.time small { margin-left: 0.4rem; font-size: 1.7rem; }
.date { margin: 0.6rem 0 0; }

.hero { margin-top: auto; padding-top: 3rem; }
.lead { margin: 1rem 0 0; }

/* The main button: solid, with an arrow and a deep underside, after GOV.UK's start button,
   so it can't be mistaken for a field to type in. */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 48rem;
  min-height: 7rem;
  margin-top: 2.6rem;
  padding: 0 2.4rem;
  border: 0;
  border-radius: var(--r);
  color: var(--ink);
  background: var(--gold-strong);
  font-size: 2.4rem;
  font-weight: 700;
  text-align: left;
  box-shadow: 0 0.4rem 0 var(--gold-strong-shadow);
}
.cta .i { width: 2.6rem; height: 2.6rem; margin-left: 1.6rem; stroke-width: 2.5; }
.cta:active { transform: translateY(0.4rem); box-shadow: none; }

.returning p { margin: 3rem 0 0; }
.returning p b { overflow-wrap: anywhere; }
.returning .cta { margin-top: 1.4rem; }
.link {
  display: block;
  min-height: 4.4rem;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 1.35rem;
  text-decoration: underline;
}

/* Language on the left, the employees' quick check-in on the right, both inside the width
   of the check-in button so they line up with it on any screen. */
.options { display: flex; flex-wrap: wrap; align-items: stretch; width: 100%; max-width: 48rem; margin-top: 2rem; }
.lang {
  display: flex;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--r);
  overflow: hidden;
}
.lang button {
  min-width: 10rem;
  min-height: 4.4rem;
  padding: 0 1.6rem;
  border: 0;
  background: none;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
}
.lang button.on { color: var(--deep); background: #fff; }
.quick {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: auto;
  min-height: calc(4.4rem + 4px); /* as tall as the language buttons with their border */
  padding: 0.4rem 1.6rem;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--r);
  background: none;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1.2;
  text-align: left;
}
.quick:active { background: rgba(255, 255, 255, 0.15); }

.panel { display: flex; align-items: center; flex: none; padding: 2rem 2.7rem 2.2rem; background: #063f29; }
.stat { flex: 1; }
.stat span { display: block; font-size: 1.35rem; }
.stat b { display: block; color: var(--gold); font-size: 3rem; line-height: 1.1; }
.sync { margin: 0.3rem 0 0; color: var(--attention); font-size: 1.35rem; }
.qr-box { display: flex; align-items: center; padding-left: 2.2rem; border-left: 1px solid rgba(255, 255, 255, 0.25); }
#qr { width: 7.6rem; height: 7.6rem; padding: 0.4rem; border-radius: var(--r); background: #fff; }
#qr svg { display: block; width: 100%; height: 100%; }
.qr-box p { max-width: 9rem; margin: 0 0 0 1.4rem; font-size: 1.35rem; font-weight: 700; line-height: 1.25; }

/* Step screens: band, header, body, footer. Questions sit at the top where they're read;
   answers, the keyboard and every button sit low, where a short or seated visitor can reach. */
.bar { flex: none; background: #fff; border-bottom: 1px solid var(--hair); }
.bar-main { display: flex; align-items: center; padding: 1.4rem 2.7rem; }
.bar-logo { display: block; height: 4.6rem; }
.progress { flex: 1; margin-left: 1.8rem; }
.progress-text { margin: 0 0 0.6rem; color: var(--action); font-size: 1.35rem; font-weight: 700; }
.segs { display: flex; }
.segs i { flex: 1; height: 0.4rem; margin-right: 0.3rem; background: var(--hair); }
.segs i:last-child { margin-right: 0; }
.segs i.done, .segs i.now { background: var(--action); }

.body {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 50rem;
  margin: 0 auto;
  padding: 3rem 2.7rem 2.4rem;
  overflow-y: auto;
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: 1.6rem 2.7rem 2rem;
  border-top: 1px solid var(--hair);
  background: #fff;
}

/* Buttons follow GOV.UK: flat colour, a solid underside that disappears when pressed. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 5.2rem;
  padding: 0 2.4rem;
  border: 0;
  border-radius: var(--r);
  font-size: 1.7rem;
  font-weight: 700;
}
.btn.primary { min-width: 16rem; color: #fff; background: var(--action); box-shadow: 0 0.2rem 0 var(--action-shadow); }
.btn.secondary { color: var(--ink); background: #eef1ef; box-shadow: 0 0.2rem 0 var(--edge); }
.btn.light { color: var(--deep); background: #fff; box-shadow: 0 0.2rem 0 var(--gold-shadow); }
.btn:active { transform: translateY(0.2rem); box-shadow: none; }

.restart {
  display: flex;
  align-items: center;
  min-height: 5.2rem;
  padding: 0 1rem;
  border: 0;
  background: none;
  color: var(--action);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
}
.restart .i { width: 1.4rem; height: 1.4rem; margin-right: 0.5rem; }

/* Answers: full-width rows with a real radio or checkbox mark (after USWDS tiles).
   Selected shows three ways at once: filled mark, thicker green edge, light tint. */
.choices { margin-top: auto; padding-top: 2.4rem; }
.tiles { display: grid; grid-template-columns: 1fr; grid-gap: 0.7rem; }
.tiles.two { grid-template-columns: 1fr 1fr; }
.classification-option { min-width: 0; }
.classification-option > .tile { width: 100%; }
.classification-detail { padding: 0.8rem 1.8rem 1rem; }
.classification-detail-label { display: block; margin-bottom: 0.4rem; font-size: 1.35rem; font-weight: 700; }
.classification-dropdown { position: relative; }
.classification-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 3rem;
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--edge);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
}
.classification-select:focus-visible { outline: 0.2rem solid var(--attention); outline-offset: 0.15rem; }
.classification-select-arrow {
  flex: none;
  width: 0.65rem;
  height: 0.65rem;
  margin-left: 1rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.15rem);
}
.classification-options {
  max-height: 15rem;
  margin-top: 0.4rem;
  overflow-y: auto;
  border: 1px solid var(--edge);
  border-radius: var(--r);
  background: #fff;
  box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.16);
}
.classification-option-choice {
  display: block;
  width: 100%;
  min-height: 2.4rem;
  padding: 0.35rem 0.8rem;
  border: 0;
  border-bottom: 1px solid var(--hair);
  background: #fff;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.25;
  text-align: left;
}
.classification-option-choice:last-child { border-bottom: 0; }
.classification-option-choice:hover,
.classification-option-choice:focus-visible { outline: none; background: var(--tint); }
.classification-option-choice[aria-selected="true"] { color: #fff; background: var(--action); }
/* Two columns on the kiosk (the ten purposes), with less padding so they fit without scrolling.
   "or" and the last choice after it run the full width. */
.kiosk .tiles.cols { grid-template-columns: 1fr 1fr; }
.kiosk .tiles.cols .tile { padding: 0.6rem 1.2rem; }
.kiosk .tiles.cols .tile.picked { padding: calc(0.6rem - 1px) calc(1.2rem - 1px); }
.kiosk .tiles.cols .mark { margin-right: 1rem; }
.kiosk .tiles.cols .or, .kiosk .tiles.cols .or + .tile { grid-column: 1 / -1; }
.tile {
  display: flex;
  align-items: center;
  min-height: 5.2rem;
  padding: 0.8rem 1.8rem;
  border: 2px solid var(--edge);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1.2;
  text-align: left;
}
.tiles.two .tile { min-height: 9rem; font-weight: 700; }
/* "Prefer not to say" runs the full width under Female and Male. */
.tiles.two .or, .tiles.two .tile:last-child { grid-column: 1 / -1; }
.tiles.two .tile:last-child { min-height: 5.2rem; }
.mark {
  position: relative;
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  margin-right: 1.4rem;
  border: 3px solid var(--ink);
  background: #fff;
}
.radio .mark { border-radius: 50%; }
.checkbox .mark { border-radius: var(--r); }
/* The edge thickens from 2px to 3px; padding gives back the extra pixel so nothing shifts. */
.tile.picked { padding: calc(0.8rem - 1px) calc(1.8rem - 1px); border: 3px solid var(--action); background: var(--tint); }
.tile.picked .mark { border-color: var(--action); }
.radio.picked .mark::after {
  content: "";
  position: absolute;
  top: 0.3rem; right: 0.3rem; bottom: 0.3rem; left: 0.3rem;
  border-radius: 50%;
  background: var(--action);
}
.checkbox.picked .mark {
  background: var(--action) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.or { margin: 0.2rem 0 0; color: var(--muted); font-size: 1.35rem; }

/* Employees to pick from: initials, name, division. */
.tile.person { min-height: 7.4rem; }
.face {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 5.4rem;
  height: 5.4rem;
  margin-right: 1.4rem;
  border-radius: 50%;
  background: var(--tint);
  color: var(--action);
  font-weight: 700;
  overflow: hidden;
}
.tile.picked .face { background: #fff; }
.who b { display: block; overflow-wrap: anywhere; }
.who span { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 1.35rem; }

/* "Check in as a visitor" when no employee matches: a plain text button under the field. */
.alt {
  min-height: 4.4rem;
  margin-top: 0.6rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--action);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: underline;
}
.btn:disabled { opacity: 0.6; }

/* A coloured edge is fine here: it marks a real problem. */
.error { margin: 0 0 1rem; padding-left: 1rem; border-left: 0.3rem solid var(--error); color: var(--error); font-weight: 700; }

/* Privacy: plain text on the page, like a printed notice */
.notice { max-width: 34em; margin: 1.4rem 0 0; line-height: 1.5; }
.collect { margin: 2.4rem 0 0.4rem; font-weight: 700; }
.list { margin: 0; padding-left: 1.3em; line-height: 1.55; }

/* Name: on the kiosk the field sits right above the keyboard, low on the screen. */
.entry { margin-top: 2rem; }
#name .entry { margin-top: auto; padding-top: 2rem; }
.kiosk .entry { margin-top: auto; padding-top: 2.4rem; }
.field-input { position: relative; }
.field-input input {
  width: 100%;
  min-height: 5.6rem;
  padding: 0.8rem 5.2rem 0.8rem 1.4rem;
  border: 3px solid var(--ink);
  border-radius: var(--r);
  outline: none;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 2rem;
  font-weight: 700;
  -webkit-user-select: text;
  user-select: text;
}
.field-input input:focus { outline: 0.2rem solid var(--attention); outline-offset: 0; }
.kiosk .field-input input:focus { outline: none; }
.clear {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  margin-top: -2.2rem;
  border: 0;
  background: none;
  color: var(--muted);
}
.clear .i { width: 2rem; height: 2rem; }

.kb { display: grid; grid-template-columns: repeat(10, 1fr); grid-gap: 0.45rem; margin-top: 1.4rem; }
.kb button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 4.2rem;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font-size: 1.7rem;
  font-weight: 700;
  box-shadow: 0 0.15rem 0 var(--edge);
}
.kb button:active { transform: translateY(0.15rem); background: var(--tint); box-shadow: none; }
.kb .space { grid-column: span 7; font-size: 1.35rem; }
.kb .bksp { grid-column: span 3; background: #eef1ef; }
.kb .bksp .i { width: 2rem; height: 2rem; }

/* Done: a visitor pass on deep green */
#done { align-items: center; padding: 0 2.7rem 3rem; background: var(--deep); color: #fff; }
.done-head { display: flex; align-items: center; align-self: stretch; padding: 2.4rem 0; }
.done-head img { display: block; height: 5rem; }
.done-head .sign { margin-left: 1.4rem; font-size: 2.6rem; }
.done-wrap { width: 100%; max-width: 40rem; margin-top: auto; text-align: center; }
.tick { display: block; width: 6rem; height: 6rem; margin: 0 auto 1.6rem; }
.tick circle { fill: var(--gold); }
.tick path { fill: none; stroke: var(--deep); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.tick .ok { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.4s 0.1s cubic-bezier(0, 0, 0.3, 1) forwards; }
.tick .bad { display: none; }
#done.failed .tick circle { fill: #ff9a8a; }
#done.failed .tick .ok { display: none; }
#done.failed .tick .bad { display: inline; }
#done.failed .pass { display: none; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-msg { margin: 1rem 0 0; }
.done-msg:empty { display: none; }

.pass {
  margin-top: 2.4rem;
  padding: 1.4rem 2rem 0.4rem;
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  text-align: left;
  animation: slide 0.4s 0.1s cubic-bezier(0, 0, 0.3, 1) both;
}
.pass-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0; padding-bottom: 1rem; border-bottom: 2px solid var(--ink); font-size: 1.35rem; }
.pass-head span { color: var(--muted); }
.pass dl { margin: 0; }
.pass dl div { display: flex; justify-content: space-between; align-items: baseline; padding: 0.9rem 0; border-top: 1px solid var(--hair); }
.pass dl div:first-child { border-top: 0; }
.pass dt { flex: none; margin-right: 1.6rem; color: var(--muted); font-size: 1.35rem; }
.pass dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

.return { width: 100%; max-width: 28rem; margin-top: 3rem; margin-bottom: auto; text-align: center; }
.meter { height: 0.3rem; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--gold); transform-origin: left; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.return p { margin: 0.9rem 0 1.6rem; font-size: 1.35rem; }
/* Phones keep the pass up until Finish, so there's no countdown to show. */
body:not(.kiosk) .meter, body:not(.kiosk) .return p { display: none; }

/* "Still there?": a yellow takeover in the lower part of the screen, like a TfL
   disruption notice, with the background dimmed slowly. */
.overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(9, 84, 55, 0.6);
  animation: fade 0.7s;
}
.sheet { padding: 3rem 2.7rem 3.2rem; background: var(--attention); color: var(--ink); }
.count { margin: 0 0 1rem; }
.count b { font-size: 5rem; line-height: 1; margin-right: 0.6rem; }
.sheet p { margin: 0.8rem 0 2rem; max-width: 34em; }
.sheet .btn { display: flex; width: 100%; }
.sheet .btn.secondary { margin-top: 1.2rem; background: #fff; }

@media (max-width: 600px) {
  h1 { font-size: 2.8rem; }
  .cta { min-height: 6rem; font-size: 2rem; }
  .quick { flex-basis: 100%; margin: 1.2rem 0 0; }
  .tile.person { min-height: 6.2rem; }
  .face { width: 4.4rem; height: 4.4rem; }
  .masthead img { height: 7.6rem; }
  .masthead .sign { margin-left: 1.4rem; font-size: 4.2rem; }
  /* On narrow phones the logo and lettering shrink with the screen, so "Discovery Center"
     (about 4.3 times the lettering size wide) stays on one line down to 320 px. */
  .masthead img { height: min(7.6rem, 21vw); }
  .masthead .sign { font-size: min(4.2rem, 10.8vw); }
  .restart span { display: none; }
  .restart .i { margin-right: 0; }
  .btn.primary { min-width: 0; }
  .btn { padding: 0 1.6rem; }
  .tile { min-height: 4.4rem; }
  .tiles.two .tile { min-height: 6rem; }
  .tiles.two .tile:last-child { min-height: 4.4rem; }
  /* Labels above values, so long answers don't break mid-phrase in a narrow column. */
  .pass dl div { display: block; }
  .pass dd { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .screen.active, .pass, .tick .ok, .overlay { animation: none; }
  .tick .ok { stroke-dashoffset: 0; }
}
