/* Sign-in pages: sign in, "What is this device for?" and the operator PIN on a line tablet.
   Layout follows the usual sign-in pattern: the logo centred at the top, one block in the
   middle of the page (a little above the centre), titles centred, and labels, fields, errors
   and paragraphs left-aligned inside it. Built on ultrafactory.css tokens. Orange (--signal)
   only marks focus, the chosen line and the next PIN digit. The mark is the official UF mark;
   the wordmark is Barlow Condensed 800. */
[hidden] { display: none !important; }

/* ---------- page frame: account bar (only when signed in), then the centred block */
.login { min-height: 100%; display: flex; flex-direction: column; }
.login-top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 52px; padding: 12px 24px 0; }
.login-top .who { color: var(--ink-3); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offline { width: min(560px, calc(100% - 32px)); margin: 14px auto 0; }
.login-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; color: var(--ink); text-decoration: none; }
.brand svg { width: 35px; height: 29px; }
.brand b { font: 800 27px/1 var(--display); letter-spacing: .3px; }
.head { text-align: center; }
.login h1 { margin: 0; font: 800 38px/1.05 var(--display); letter-spacing: .3px; }
.login h1:focus { outline: none; }
.lead { margin: 8px 0 0; font-size: 15.5px; color: var(--ink-2); }
.hint { margin: 0; color: var(--ink-3); font-size: 13.5px; }
.loading { margin: 0; color: var(--ink-3); font-weight: 600; }
.load-fail { display: grid; justify-items: center; gap: 12px; text-align: center; }
.load-fail p { margin: 0; font-weight: 600; }

/* ---------- messages */
.note { margin: 0; padding: 12px 14px; border-radius: var(--r); font-weight: 600; font-size: 15px; }
.note.t-bad, .note.t-plan, .note.t-new, .note.t-work { background: var(--tone-bg); color: var(--tone); }

/* ---------- sign in (and the "which line?" card) */
.card { width: min(420px, 100%); padding: 32px 28px 28px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
.card.wide { width: min(520px, 100%); }
.card form { display: grid; gap: 16px; margin-top: 24px; }
.card .field input { min-height: 46px; font-size: 15.5px; }
.field input::placeholder { color: var(--ink-3); opacity: .75; }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.pw { position: relative; display: block; }
.pw input { width: 100%; padding-inline-end: 48px; }
.pw .icon-btn { position: absolute; top: 5px; inset-inline-end: 5px; }
.caps { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--work); }
.btn.block { width: 100%; justify-content: center; height: 48px; font-size: 15.5px; }
.help { margin: 20px 0 0; font-size: 13px; color: var(--ink-3); }

/* ---------- what is this device for? */
.choose { width: min(820px, 100%); }
.choose > .note { max-width: 560px; margin: 18px auto 0; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.choice { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; justify-items: start; gap: 8px; min-height: 240px; padding: 26px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; color: var(--ink); text-align: start; cursor: pointer; }
.choice:hover { border-color: var(--ink-3); }
.choice:disabled { opacity: .6; cursor: default; }
.choice-ico { display: grid; place-items: center; width: 60px; height: 60px; margin-bottom: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--rule-2); }
.choice-ico .ico { width: 30px; height: 30px; }
.choice-h { font: 700 28px/1.05 var(--display); letter-spacing: .2px; }
.choice-p { color: var(--ink-2); font-size: 14.5px; max-width: 36ch; }
.choice-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 600; }
.choice-go .ico { width: 18px; height: 18px; }
.lines { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.line-opt { position: relative; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px; border: 2px solid var(--rule); border-radius: 10px; background: var(--surface); cursor: pointer; }
.line-opt input { position: absolute; opacity: 0; pointer-events: none; }
.line-opt .dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink-3); }
.line-opt:has(input:checked) { border-color: var(--signal); }
.line-opt:has(input:checked) .dot { border: 6px solid var(--signal); }
.line-opt:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.line-name { font: 700 22px/1.1 var(--display); }
.line-note { color: var(--ink-3); font-size: 14px; }
.row { display: flex; justify-content: space-between; gap: 10px; }
.row .btn { height: 46px; padding: 0 18px; }

/* ---------- operator: tap your name (centred tiles, like a "who's working" screen) */
.names-wrap { width: min(860px, 100%); }
.names-wrap > .note { max-width: 560px; margin: 18px auto 0; }
.names { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.name-btn { flex: 0 1 240px; display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 14px 18px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 19px; font-weight: 600; text-align: start; cursor: pointer; touch-action: manipulation; }
.name-btn:hover { border-color: var(--ink-3); }
.name-btn .ico { width: 26px; height: 26px; color: var(--ink-3); }
.names-wrap > .hint { margin-top: 18px; text-align: center; }
.names-foot { margin: 32px 0 0; text-align: center; }
.names-foot a { color: var(--ink-2); font-size: 14px; }

/* ---------- operator: PIN, one centred column like a till or a phone lock screen.
   Sized for a 10-inch tablet and gloves; the keys shrink on short screens so nothing scrolls. */
.pin { width: min(400px, 100%); }
.pad { margin-top: 24px; }
.slots { display: grid; grid-template-columns: repeat(var(--len, 4), minmax(0, 1fr)); gap: 10px; width: min(300px, 100%); margin: 0 auto; }
.slot { display: grid; place-items: center; height: clamp(54px, 8vh, 64px); background: var(--surface); border: 2px solid var(--rule); border-radius: 10px; }
.slot.is-next { border-color: var(--signal); }
.slot.is-filled::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); }
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.key { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: clamp(58px, 9vh, 76px); border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink); font: 700 36px/1 var(--display); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
.key:hover { border-color: var(--ink-3); }
.key:active { background: var(--surface-2); }
.key.fn { font: 600 16px/1 var(--body); color: var(--ink-2); }
.key.fn .ico { width: 26px; height: 26px; }
.key:disabled { opacity: .45; cursor: default; }
.pad .note { display: flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 12px; padding: 8px 14px; text-align: center; }
.pad .note:empty { visibility: hidden; }
.pin-foot { display: flex; justify-content: center; margin-top: 6px; }
.pad.is-wrong .slots { animation: nudge .32s ease-in-out; }
@keyframes nudge { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .pad.is-wrong .slots { animation: none; } }

/* ---------- phones: one column */
@media (max-width: 760px) {
  .login-top { padding: 10px 16px 0; }
  .login-top .who { display: none; }
  .login-main { padding: 24px 16px 40px; }
  .login h1 { font-size: 32px; }
  .choices { grid-template-columns: minmax(0, 1fr); }
  .choice { min-height: 0; }
  .name-btn { flex-basis: 100%; }
}
