/* Sign-in lock screen (js/views/access.js, server sign-in on). The Finance Hub's terminal design system
 * (project-finance-hub frontend/src/index.css, docs/designsystem/arcanum-landing.html), scoped to .lk so it does not
 * depend on the rest of Control Center's theme; its --lk-* names are aliases of css/tokens.css. The Hub's fonts are self-hosted (fonts/, font-src 'self'); no network, no images. */
.lk {
  --lk-ink: var(--ink); --lk-surface: var(--surface); --lk-raised: var(--raised); --lk-line: var(--line); --lk-line-soft: var(--line-soft);
  --lk-text: var(--text); --lk-muted: var(--muted); --lk-dim: var(--dim);
  --lk-accent: var(--accent); --lk-accent-bg: var(--accent-bg); --lk-accent-ink: var(--accent-ink);
  --lk-pos: var(--pos); --lk-neg: var(--neg); --lk-warn: var(--warn);
  --lk-r: var(--r);
  --lk-disp: "Space Grotesk", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lk-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --lk-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--lk-ink); color: var(--lk-text); font: 14px/1.5 var(--lk-sans);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
.lk *, .lk *::before, .lk *::after { box-sizing: border-box; }
.lk :focus-visible { outline: 2px solid var(--lk-accent); outline-offset: 2px; border-radius: var(--lk-r); }
.lk-mono { font-family: var(--lk-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* Background: a faint grid fading out from the centre, one slow glow, and an abstract line drawn once. */
.lk-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lk-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--lk-line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--lk-line-soft) 1px, transparent 1px);
  background-size: 48px 48px; background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 48%, var(--mask) 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 65% at 50% 48%, var(--mask) 20%, transparent 75%);
  opacity: .7;
}
.lk-glow {
  position: absolute; left: 50%; top: 44%; width: 760px; height: 760px; margin: -380px 0 0 -380px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-glow), var(--accent-glow-2) 55%, transparent 72%);
}
.lk-chart { position: absolute; left: 0; right: 0; bottom: 64px; width: 100%; height: 52%; -webkit-mask-image: linear-gradient(90deg, transparent, var(--mask) 18%, var(--mask) 82%, transparent); mask-image: linear-gradient(90deg, transparent, var(--mask) 18%, var(--mask) 82%, transparent); }
.lk-chart line, .lk-chart path { vector-effect: non-scaling-stroke; }
.lk-chart .gl { stroke: var(--lk-line-soft); stroke-width: 1; stroke-dasharray: 2 6; }
.lk-chart .base { stroke: var(--lk-line); stroke-width: 1; }
.lk-chart .cd line { stroke-width: 1; }
.lk-chart .cd.up line { stroke: var(--lk-pos); } .lk-chart .cd.up rect { fill: var(--lk-pos); }
.lk-chart .cd.dn line { stroke: var(--lk-neg); } .lk-chart .cd.dn rect { fill: var(--lk-neg); }
.lk-chart .cd { opacity: .4; }
.lk-chart .cd rect.vol { opacity: .35; }
.lk-chart .ma { fill: none; stroke: var(--lk-accent); stroke-width: 1.4; stroke-opacity: .5; }
.lk-chart .last { stroke: var(--lk-accent); stroke-width: 1; stroke-opacity: .45; stroke-dasharray: 3 4; }

/* Status bar */
.lk-bar {
  display: flex; align-items: center; gap: 12px 18px; padding: 0 24px; height: 52px;
  border-bottom: 1px solid var(--lk-line); background: var(--glass); backdrop-filter: blur(6px);
}
.lk-brand { display: flex; align-items: center; gap: 9px; font: 600 15.5px var(--lk-disp); letter-spacing: -.025em; color: var(--lk-text); }
.lk-shield { width: 20px; height: 24px; flex: none; color: var(--lk-accent); }
.lk-spacer { flex: 1; }
.lk-stat { display: flex; align-items: center; gap: 7px; font: 500 10.5px var(--lk-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lk-muted); white-space: nowrap; }
.lk-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lk-dim); flex: none; }
.lk[data-state="ok"] .lk-dot { background: var(--lk-pos); }
.lk[data-state="locked"] .lk-dot { background: var(--lk-neg); }
.lk-clock { font: 500 11.5px var(--lk-mono); color: var(--lk-muted); white-space: nowrap; }
.lk-sep { width: 1px; height: 16px; background: var(--lk-line); }

/* The card */
.lk-stage { display: grid; place-items: center; padding: 32px 16px; }
.lk-card {
  width: min(372px, 100%); background: var(--glass-card); border: 1px solid var(--lk-line); border-radius: var(--lk-r);
  padding: 26px 24px 18px; box-shadow: var(--shadow-card), inset 0 1px 0 var(--sheen);
  position: relative;
}
.lk-card::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--lk-accent) 30%, var(--lk-accent) 70%, transparent); opacity: .55; }
.lk-eyebrow { margin: 0 0 10px; font: 500 10px var(--lk-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lk-dim); display: flex; justify-content: space-between; gap: 12px; }
.lk-title { margin: 0; font: 600 26px/1.1 var(--lk-disp); letter-spacing: -.03em; color: var(--lk-text); }
.lk-sub { margin: 6px 0 22px; color: var(--lk-muted); font-size: 13px; }

/* PIN: one real input over four drawn boxes (one field for screen readers, autofill and paste). */
.lk-pin { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lk-pin-input {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; margin: 0; padding: 0; border: 0; outline: 0;
  opacity: 0; font-size: 16px; color: transparent; background: transparent; caret-color: transparent; cursor: text;
}
.lk-box {
  height: 62px; display: grid; place-items: center; position: relative;
  background: var(--lk-ink); border: 1px solid var(--lk-line); border-radius: var(--lk-r);
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.lk-box.is-filled::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--lk-text); animation: lk-pop .16s ease-out; }
.lk-pin.is-focus .lk-box.is-active { border-color: var(--lk-accent); box-shadow: 0 0 0 3px var(--lk-accent-bg); }
.lk-pin.is-focus .lk-box.is-active::before { content: ""; position: absolute; width: 1.5px; height: 24px; background: var(--lk-accent); animation: lk-caret 1.05s steps(1) infinite; }
.lk-pin.is-busy .lk-box { border-color: var(--lk-accent); animation: lk-busy .9s ease-in-out infinite alternate; }
.lk-pin.is-busy .lk-box:nth-child(3) { animation-delay: .1s; } .lk-pin.is-busy .lk-box:nth-child(4) { animation-delay: .2s; } .lk-pin.is-busy .lk-box:nth-child(5) { animation-delay: .3s; }
.lk-pin.is-wrong .lk-box { border-color: var(--lk-neg); background: var(--neg-bg); }
.lk-pin.is-wrong .lk-box.is-filled::after { background: var(--lk-neg); }
.lk-pin.is-shake { animation: lk-shake .42s cubic-bezier(.36, .07, .19, .97); }
.lk-pin.is-ok .lk-box { border-color: var(--lk-pos); background: var(--pos-bg); }
.lk-pin.is-ok .lk-box.is-filled::after { background: var(--lk-pos); }
.lk-pin.is-locked .lk-box { border-style: dashed; opacity: .55; }
.lk-pin.is-locked .lk-pin-input { cursor: not-allowed; }

/* Password (the older mode) */
.lk-pw { display: grid; gap: 10px; }
.lk-pw input {
  width: 100%; font: 15px var(--lk-sans); color: var(--lk-text); background: var(--lk-ink);
  border: 1px solid var(--lk-line); border-radius: var(--lk-r); padding: 12px 13px;
}
.lk-pw input:focus { border-color: var(--lk-accent); outline: none; box-shadow: 0 0 0 3px var(--lk-accent-bg); }
.lk-pw.is-shake { animation: lk-shake .42s cubic-bezier(.36, .07, .19, .97); }
.lk-pw.is-wrong input { border-color: var(--lk-neg); }
.lk-go { font: 600 14px var(--lk-sans); color: var(--lk-accent-ink); background: var(--lk-accent); border: 0; border-radius: var(--lk-r); padding: 11px 16px; cursor: pointer; }
.lk-go:hover { filter: brightness(1.08); }
.lk-go:disabled { opacity: .5; cursor: default; }

/* Message line: one fixed-height row so the card never jumps. */
.lk-msg { min-height: 20px; margin: 12px 0 2px; font: 500 12px/1.4 var(--lk-mono); color: var(--lk-muted); display: flex; align-items: center; gap: 8px; }
.lk-msg[data-tone="bad"] { color: var(--lk-neg); }
.lk-msg[data-tone="warn"] { color: var(--lk-warn); }
.lk-msg[data-tone="ok"] { color: var(--lk-pos); }
.lk-msg:empty::before { content: "\00a0"; }
.lk-tries { display: inline-flex; gap: 3px; margin-left: auto; }
.lk-tries i { width: 14px; height: 3px; border-radius: 1px; background: var(--lk-line); }
.lk-tries i.on { background: var(--lk-muted); }
.lk-msg[data-tone="bad"] .lk-tries i.on { background: var(--lk-neg); }

/* Keypad */
.lk-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.lk-key {
  height: 50px; font: 500 19px var(--lk-mono); color: var(--lk-text); background: var(--lk-surface);
  border: 1px solid var(--lk-line-soft); border-radius: var(--lk-r); cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; transition: background .1s, border-color .1s, transform .06s;
}
.lk-key:hover { background: var(--lk-raised); border-color: var(--lk-line); }
.lk-key:active, .lk-key.is-press { background: var(--lk-accent-bg); border-color: var(--lk-accent); transform: scale(.97); }
.lk-key.lk-fn { font: 500 11px var(--lk-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--lk-muted); background: transparent; border-color: transparent; }
.lk-key.lk-fn:hover { color: var(--lk-text); border-color: var(--lk-line); }
.lk-key:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.lk-key svg { width: 20px; height: 20px; vertical-align: middle; }

/* Forgot */
.lk-more { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--lk-line-soft); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lk-link { background: none; border: 0; padding: 2px 0; font: 500 12.5px var(--lk-sans); color: var(--lk-muted); cursor: pointer; text-decoration: underline; text-decoration-color: var(--lk-line); text-underline-offset: 3px; }
.lk-link:hover, .lk-link[aria-expanded="true"] { color: var(--lk-text); text-decoration-color: var(--lk-accent); }
.lk-help { margin-top: 12px; padding: 12px 13px; border: 1px solid var(--lk-line); border-left: 2px solid var(--lk-accent); border-radius: var(--lk-r); background: var(--lk-raised); font-size: 12.5px; color: var(--lk-muted); }
.lk-help p { margin: 0 0 8px; } .lk-help p:last-child { margin: 0; }
.lk-help ol { margin: 0 0 8px; padding-left: 18px; color: var(--lk-text); }
.lk-help li { margin: 2px 0; }
.lk-help code { font: 500 11.5px var(--lk-mono); color: var(--lk-text); background: var(--lk-ink); border: 1px solid var(--lk-line); border-radius: 2px; padding: 0 4px; }

/* Bottom band: real exchange hours from the clock */
.lk-foot { border-top: 1px solid var(--lk-line); background: var(--glass); backdrop-filter: blur(6px); overflow-x: auto; scrollbar-width: none; }
.lk-foot::-webkit-scrollbar { display: none; }
.lk-mkts { list-style: none; margin: 0 auto; padding: 0 16px; display: flex; justify-content: center; width: max-content; min-width: 100%; }
.lk-mkt { display: flex; align-items: center; gap: 8px; padding: 13px 16px; white-space: nowrap; font: 500 11px var(--lk-mono); color: var(--lk-dim); border-right: 1px solid var(--lk-line-soft); }
.lk-mkt:last-child { border-right: 0; }
.lk-mkt b { font: 600 12px var(--lk-sans); color: var(--lk-muted); letter-spacing: 0; }
.lk-mkt .t { color: var(--lk-text); }
.lk-mkt .lk-dot { background: var(--lk-dim); }
.lk-mkt.is-open .lk-dot { background: var(--lk-pos); box-shadow: 0 0 0 3px var(--pos-halo); }
.lk-mkt.is-open b { color: var(--lk-text); }
.lk-mkt.is-open .n { color: var(--lk-pos); }

@keyframes lk-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
@keyframes lk-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes lk-caret { 50% { opacity: 0; } }
@keyframes lk-busy { from { box-shadow: 0 0 0 0 var(--lk-accent-bg); } to { box-shadow: 0 0 0 4px var(--lk-accent-bg); } }
@keyframes lk-draw { from { stroke-dashoffset: var(--lk-len, 3000); } to { stroke-dashoffset: 0; } }
@keyframes lk-drift { from { transform: translate3d(-40px, -10px, 0) scale(1); } to { transform: translate3d(40px, 16px, 0) scale(1.08); } }
@keyframes lk-fade { from { opacity: 0; } to { opacity: .4; } }
@keyframes lk-blink { 50% { box-shadow: 0 0 0 5px var(--pos-clear); } }
@keyframes lk-rise-ma { from { opacity: 0; } to { opacity: 1; } }
@keyframes lk-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  .lk-card { animation: lk-rise .32s ease-out both; }
  .lk-glow { animation: lk-drift 22s ease-in-out infinite alternate; }
  .lk-chart .cd { animation: lk-fade .5s ease-out both; }
  .lk-chart .ma { animation: lk-rise-ma 1.2s ease-out both 1.6s; }
  .lk-mkt.is-open .lk-dot { animation: lk-blink 2.4s ease-in-out infinite; }
}
/* Reduced motion: no shake, caret blink, drift or drawing; the colour change alone says "wrong". */
@media (prefers-reduced-motion: reduce) {
  .lk *, .lk *::before, .lk *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 560px) {
  .lk-bar { padding: 0 16px; gap: 10px; }
  .lk-hide-sm { display: none; }
  .lk-stage { padding: 20px 16px; align-items: start; }
  .lk-card { padding: 22px 18px 14px; margin-top: 4vh; }
  .lk-title { font-size: 24px; }
  .lk-box { height: 58px; }
  .lk-key { height: 54px; }
  .lk-chart { height: 36%; bottom: 46px; }
  .lk-mkts { justify-content: flex-start; }
  .lk-mkt { padding: 11px 14px; }
  .lk-mkt .n { display: none; }
}
