/*
 * ACCG Registration - kiosk
 * Touch-first, readable from arm's length by anyone, including people
 * who left their reading glasses at the hotel. Atkinson Hyperlegible
 * was drawn for low-vision readers; everything is served locally
 * because the event network has no internet.
 */

@font-face {
  font-family: 'Atkinson Next';
  src: url('fonts/atkinson-next-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  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: 'Atkinson Next';
  src: url('fonts/atkinson-next-latin-ext.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
  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;
}
/* The badge font: the same FreeSans that is embedded in the printed PDF. */
@font-face { font-family: 'Badge Sans'; src: url('fonts/freesans.ttf') format('truetype'); font-weight: 400; }
@font-face { font-family: 'Badge Sans'; src: url('fonts/freesans-bold.ttf') format('truetype'); font-weight: 700; }

:root {
  --pine: #173A34;
  --pine-2: #24524A;
  --granite: #E6ECEA;
  --granite-2: #D3DDD9;
  --paper: #FFFFFF;
  --marigold: #F2B632;
  --marigold-2: #D99B12;
  --brick: #A93226;
  --mist: #52665F;
  --rule: #C3CFCB;
  --font: 'Atkinson Next', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --gutter: clamp(20px, 3.2vw, 56px);
  --radius: 14px;
  --strap: 19vh;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--granite);
  color: var(--pine);
  font-family: var(--font);
  font-size: clamp(17px, 1.45vw, 23px);
  line-height: 1.4;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 4px solid var(--marigold); outline-offset: 3px; }

.kiosk { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ---- Top line ------------------------------------------------------ */
.k-top {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px var(--gutter) 0; min-height: 60px; position: relative; z-index: 2;
}
.k-brand { display: flex; align-items: center; gap: 14px; font-weight: 700; color: var(--pine); }
.k-brand img { height: 44px; width: auto; max-width: 260px; object-fit: contain; }
.k-station {
  background: none; border: 0; padding: 10px 4px; min-height: 48px; min-width: 120px;
  color: var(--mist); font-size: 0.8em; text-align: right; cursor: default;
}
.k-station.is-holding { color: var(--pine); }

.k-staffbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 8px var(--gutter) 0; padding: 10px 16px; border-radius: var(--radius);
  background: var(--pine); color: #fff; font-weight: 700; position: relative; z-index: 3;
}
.k-staffbar > span { flex: 1; }

/* ---- Screens ------------------------------------------------------- */
.k-screen { display: none; flex: 1; min-height: 0; padding: 0 var(--gutter) var(--gutter); }
.k-screen.is-active { display: grid; }

.k-welcome, .k-confirm, .k-done {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--gutter);
  align-items: center;
}
.k-col { display: flex; flex-direction: column; align-items: flex-start; max-width: 40em; min-width: 0; }
.k-col-narrow { max-width: 34em; }

.k-display {
  font-size: clamp(2.3rem, 4.9vw, 4.6rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.018em;
  margin: 0 0 0.3em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.k-h2 { font-size: clamp(1.6rem, 2.7vw, 2.4rem); font-weight: 800; line-height: 1.1; margin: 0 0 0.4em; }
.k-when { font-size: 1.12em; color: var(--mist); margin: 0 0 1.4em; }
.k-lede { font-size: 1.18em; margin: 0 0 0.9em; max-width: 30em; }
.k-tight { margin-bottom: 0.15em; }
.k-org { font-weight: 700; }
.k-ask { font-size: 1.3em; margin: 0.8em 0 0.2em; color: var(--mist); }
.k-help { color: var(--mist); margin: 1.4em 0 0; }
.k-detail { color: var(--mist); font-size: 0.85em; margin: 0 0 1.2em; }
.k-detail:empty { display: none; }
.k-note {
  font-size: 1.1em; margin: 0.6em 0 0.4em; padding: 14px 18px; max-width: 30em;
  background: var(--paper); border-left: 6px solid var(--marigold); border-radius: 0 var(--radius) var(--radius) 0;
}
.k-error { color: var(--brick); font-weight: 700; min-height: 1.4em; margin: 0.6em 0 0; }

/* ---- Buttons ------------------------------------------------------- */
.k-btn {
  appearance: none; border: 0; border-radius: var(--radius);
  padding: 0.7em 1.2em; min-height: 64px;
  font-weight: 700; font-size: 1.1em; line-height: 1.15;
  cursor: pointer; text-align: center;
  transition: transform 80ms ease, background-color 80ms ease;
}
.k-btn:active { transform: translateY(2px); }
.k-btn-primary { background: var(--marigold); color: var(--pine); box-shadow: inset 0 -5px 0 rgba(23, 58, 52, 0.2); }
.k-btn-primary:active { background: var(--marigold-2); box-shadow: none; }
.k-btn-xl { min-height: 100px; font-size: 1.5em; }
.k-btn-secondary { background: transparent; color: var(--pine); box-shadow: inset 0 0 0 3px var(--pine); }
.k-btn-secondary:active { background: var(--granite-2); }
.k-btn-back { background: var(--paper); box-shadow: inset 0 0 0 2px var(--rule); min-height: 58px; padding: 0.45em 1.1em; }
.k-btn-small { min-height: 48px; font-size: 0.9em; padding: 0.4em 1em; background: var(--paper); color: var(--pine); }
.k-btn[disabled] { opacity: 0.45; pointer-events: none; }

.k-actions { display: flex; flex-direction: column; gap: 14px; width: min(100%, 30rem); margin-top: 0.8em; }
.k-actions-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.k-actions-row .k-btn { flex: 1 1 12rem; }
.k-back-top { align-self: flex-start; }

/* ---- The hanging badge ----------------------------------------------
 * A lanyard drops from the top edge of the screen to a clip and a clear
 * holder. Welcome: a sample badge sways slightly. Confirm: the person's
 * own badge. Print: the badge falls away toward the printer.
 * ------------------------------------------------------------------- */
.k-stage {
  position: relative; align-self: stretch; min-width: 0;
  display: flex; justify-content: center;
  margin-top: -72px;              /* the strap starts at the very top edge */
  pointer-events: none;
}
.k-hang { position: relative; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 0; }
.k-strap { display: block; width: clamp(90px, 13vw, 190px); height: var(--strap); overflow: visible; }
.k-strap .band { fill: none; stroke: var(--pine); stroke-width: 15px; stroke-linecap: butt; }
.k-strap .stitch { fill: none; stroke: var(--marigold); stroke-width: 2px; stroke-dasharray: 7 7; }
.k-clip {
  width: 30px; height: 40px; margin-top: -8px; border-radius: 7px; position: relative; z-index: 1;
  background: linear-gradient(90deg, #7F8C88, #E0E6E4 42%, #A6B1AE 60%, #74817D);
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.25);
}
.k-clip::after {
  content: ''; position: absolute; left: 9px; right: 9px; bottom: -10px; height: 16px;
  border: 3px solid #8A9693; border-top: 0; border-radius: 0 0 8px 8px;
}
.k-holder {
  position: relative; margin-top: 2px; padding: 30px 14px 14px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 1px rgba(23, 58, 52, 0.14), 0 22px 44px -16px rgba(23, 58, 52, 0.45);
}
.k-holder::before {            /* the punched slot */
  content: ''; position: absolute; top: 10px; left: 50%; width: 70px; height: 11px; margin-left: -35px;
  border-radius: 6px; background: var(--granite); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.k-badge { background: #fff; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07); }
.k-badge .badge-canvas { border-radius: 3px; }

.k-welcome .k-hang { animation: k-sway 7s ease-in-out infinite alternate; }
@keyframes k-sway { from { transform: rotate(-1.4deg); } to { transform: rotate(1.4deg); } }
.k-holder.is-dropping { animation: k-drop 0.72s cubic-bezier(0.5, 0, 0.9, 0.45) forwards; }
@keyframes k-drop { to { transform: translateY(115vh) rotate(9deg); } }
.k-hang.is-empty .k-holder { visibility: hidden; }

/* ---- Search -------------------------------------------------------- */
.k-search, .k-scan { grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 14px; padding-top: 8px; }
.k-bar { display: flex; align-items: center; gap: 22px; }
.k-bar h2 { font-size: clamp(1.5rem, 2.6vw, 2.3rem); font-weight: 800; margin: 0; }
.k-field { display: flex; gap: 12px; align-items: stretch; }
.k-field-text {
  flex: 1; min-width: 0; min-height: 78px; padding: 0 24px;
  display: flex; align-items: center; white-space: pre; overflow: hidden;
  background: var(--paper); border-radius: var(--radius); box-shadow: inset 0 0 0 3px var(--pine);
  font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 700;
}
.k-field-text:empty::before { content: attr(data-placeholder); color: var(--mist); font-weight: 400; }
.k-field-text::after {
  content: ''; flex: none; width: 3px; height: 1.1em; margin-left: 2px; background: var(--pine);
  animation: k-caret 1.1s steps(1) infinite;
}
@keyframes k-caret { 50% { opacity: 0; } }

.k-results {
  overflow-y: auto; min-height: 0; padding: 3px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 12px; align-content: start;
}
.k-result {
  text-align: left; border: 0; border-radius: var(--radius); background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--rule);
  padding: 14px 18px; min-height: 92px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.k-result:active { box-shadow: inset 0 0 0 4px var(--pine); background: #F6F9F8; }
.k-result b { font-size: 1.3em; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.k-result span { color: var(--mist); font-size: 0.92em; line-height: 1.25; }
.k-result .k-tag { color: var(--pine); font-weight: 700; font-size: 0.8em; margin-top: 4px; }
.k-hint { grid-column: 1 / -1; color: var(--mist); font-size: 1.1em; padding: 10px 4px; margin: 0; }
.k-hint strong { color: var(--pine); }

/* ---- On-screen keyboard -------------------------------------------- */
.k-kb { display: grid; gap: 8px; }
.k-kb-row { display: flex; gap: 8px; justify-content: center; }
.k-key {
  flex: 1 1 0; max-width: 7.6vw; min-height: clamp(46px, 6.8vh, 74px);
  border: 0; border-radius: 10px; background: var(--paper); cursor: pointer;
  box-shadow: inset 0 -4px 0 var(--granite-2), 0 0 0 1px var(--rule);
  font-size: 1.35em; font-weight: 700;
}
.k-key:active, .k-key.is-on { background: var(--pine); color: #fff; box-shadow: none; }
.k-key-wide { flex-grow: 1.5; max-width: 11vw; font-size: 1em; }
.k-key-space { flex-grow: 5; max-width: 38vw; font-size: 1em; }

/* ---- Printing / done ----------------------------------------------- */
.k-pickup {
  font-size: 1.2em; font-weight: 700; margin: 0.2em 0 1em; padding: 14px 18px; max-width: 30em;
  background: var(--paper); border-left: 6px solid var(--marigold); border-radius: 0 var(--radius) var(--radius) 0;
}
.k-pickup:empty { display: none; }
.k-progress { width: min(100%, 26rem); height: 10px; border-radius: 5px; background: var(--granite-2); overflow: hidden; }
.k-progress span { display: block; width: 38%; height: 100%; border-radius: 5px; background: var(--pine); animation: k-slide 1.1s ease-in-out infinite; }
@keyframes k-slide { from { transform: translateX(-100%); } to { transform: translateX(270%); } }

/* ---- Scan ---------------------------------------------------------- */
.k-scan { grid-template-rows: auto minmax(0, 1fr); }
.k-scan-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.k-scan-window { position: relative; width: min(46vh, 80vw); aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: var(--pine); }
.k-scan-window video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.k-scan-frame { position: absolute; inset: 14%; border: 5px solid var(--marigold); border-radius: 16px; }

/* ---- Problem ------------------------------------------------------- */
.k-problem { align-items: center; }

/* ---- Setup --------------------------------------------------------- */
.k-setup { align-items: center; justify-items: center; overflow-y: auto; }
.k-setup-inner { width: min(46rem, 100%); }
.k-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 12px; margin: 0.4em 0 1em; }
.k-choice {
  border: 0; border-radius: var(--radius); background: var(--paper); cursor: pointer; text-align: left;
  box-shadow: inset 0 0 0 2px var(--rule); padding: 14px 18px; min-height: 76px;
  display: flex; flex-direction: column; justify-content: center;
}
.k-choice b { font-size: 1.12em; }
.k-choice span { color: var(--mist); font-size: 0.85em; }
.k-choice.is-current { box-shadow: inset 0 0 0 4px var(--pine); }
.k-choice:active { background: #F6F9F8; }

/* ---- PIN pad ------------------------------------------------------- */
.k-pin-dots { display: flex; gap: 14px; justify-content: center; min-height: 26px; margin: 0.4em 0 1em; }
.k-pin-dots i { width: 22px; height: 22px; border-radius: 50%; background: var(--pine); }
.k-pin-dots i.is-empty { background: transparent; box-shadow: inset 0 0 0 3px var(--rule); }
.k-pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(22rem, 100%); margin: 0 auto; }
.k-pinpad .k-key { max-width: none; min-height: 72px; font-size: 1.6em; }
.k-pinpad .k-key-wide { font-size: 1em; }

/* ---- Overlays ------------------------------------------------------ */
.k-overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(23, 58, 52, 0.55);
}
.k-overlay-center { align-items: center; padding: var(--gutter); }
.k-sheet {
  width: 100%; max-height: 100%; overflow-y: auto;
  background: var(--granite); padding: 24px var(--gutter);
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column; gap: 12px;
}
.k-sheet .k-h2 { margin: 0; }
.k-sheet p { margin: 0; }
.k-sheet h3 { margin: 0.6em 0 0; font-size: 1em; }
.k-sheet-small { width: min(28rem, 100%); border-radius: 22px; text-align: center; }
.k-sheet-mid { width: min(52rem, 100%); border-radius: 22px; }
.k-overlay-solid { background: var(--pine); color: #fff; align-items: center; justify-content: flex-start; padding: var(--gutter); }
.k-overlay-solid .k-lede { color: #DCE6E3; }
.k-closed { max-width: 38em; }

@media (max-aspect-ratio: 5/4) {
  /* A Chromebook flipped to portrait: stack the badge under the words. */
  .k-welcome, .k-confirm, .k-done { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .k-stage { margin-top: 0; order: -1; }
  .k-key { max-width: 9.5vw; }
}

@media (prefers-reduced-motion: reduce) {
  .k-welcome .k-hang, .k-progress span, .k-field-text::after { animation: none; }
  .k-holder.is-dropping { animation-duration: 0.01s; }
  .k-btn { transition: none; }
}
