/* OneKey's two screens in every client (onekey.js): the lock (design 4.1) and "Confirm on your phone" (4.9).
   Colours come from the page that loads this file: set --ok-bg, --ok-surface, --ok-raised, --ok-ink, --ok-ink-2,
   --ok-line, --ok-accent, --ok-on-accent and --ok-bad there; the values here are Besendorf's own look.
   Concentric corners (design/RULES.md): a button sits --ok-pad from the sheet's edge, so the sheet's radius is
   derived, --ok-sheet-r = --ok-r + --ok-pad. Change --ok-r or --ok-pad, never --ok-sheet-r. */
:root {
  --ok-bg: #F4F5F7; --ok-surface: #FFFFFF; --ok-raised: #F1F2F5; --ok-ink: #14171D; --ok-ink-2: #4B5260; --ok-line: #DCE0E6;
  --ok-accent: #F29A2E; --ok-accent-ink: #8F4B05; --ok-on-accent: #1E1405; --ok-bad: #C0362F;
  --ok-r: 18px; --ok-pad: 18px; --ok-sheet-r: calc(var(--ok-r) + var(--ok-pad));
  --ok-pic: 72px; --ok-mark: 64px; --ok-row: 52px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ok-bg: #0E1116; --ok-surface: #171C23; --ok-raised: #1E242D; --ok-ink: #E9EDF2; --ok-ink-2: #A6AFBC; --ok-line: #252C36;
  --ok-accent: #FFA23C; --ok-accent-ink: #FFB766; --ok-bad: #FF6E64; } }
:root[data-theme="dark"] {
  --ok-bg: #0E1116; --ok-surface: #171C23; --ok-raised: #1E242D; --ok-ink: #E9EDF2; --ok-ink-2: #A6AFBC; --ok-line: #252C36;
  --ok-accent: #FFA23C; --ok-accent-ink: #FFB766; --ok-bad: #FF6E64; }

/* a modal locks the page behind it */
html.ok-open, html.ok-open body { overflow: hidden; }

.ok-lock, .ok-back { position: fixed; inset: 0; z-index: 2147483000; font: 16px/1.4 -apple-system, "Segoe UI", system-ui, sans-serif; color: var(--ok-ink); }
.ok-lock *, .ok-back * { box-sizing: border-box; }
.ok-lock button, .ok-back button { font: inherit; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ok-lock button:focus-visible, .ok-back button:focus-visible { outline: 2px solid var(--ok-accent); outline-offset: 2px; }
.ok-hidden { display: none !important; }

/* ---- the lock: the picture, the name, "Unlock Besendorf", the Face ID mark; it fits 375 x 667 with every row shown */
.ok-lock { background: var(--ok-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); text-align: center; overflow-y: auto; overscroll-behavior: contain; }
/* profile pictures: a fixed square box, always a circle, never stretched; the initial sits under the picture */
.ok-pic { position: relative; width: var(--ok-pic); height: var(--ok-pic); aspect-ratio: 1; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center;
  background: color-mix(in oklab, var(--ok-accent) 16%, transparent); color: var(--ok-accent-ink); font-size: 28px; font-weight: 700; }
.ok-pic img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.ok-name { font-size: 20px; font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ok-line { font-size: 17px; color: var(--ok-ink-2); }
.ok-mark { width: var(--ok-mark); height: var(--ok-mark); border-radius: 50%; margin-top: 14px; padding: 0; background: none; color: var(--ok-accent-ink);
  display: grid; place-items: center; position: relative; }
.ok-mark svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ok-busy .ok-mark { pointer-events: none; }
.ok-busy .ok-mark svg { animation: ok-pulse 1.2s ease-in-out infinite; }
.ok-msg { margin: 0; min-height: 22px; color: var(--ok-ink-2); }
.ok-acts { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.ok-btn { width: 100%; min-height: var(--ok-row); padding: 0 16px; border-radius: var(--ok-r); background: var(--ok-accent); color: var(--ok-on-accent); font-weight: 600; }
.ok-btn.ok-quiet { background: var(--ok-raised); color: var(--ok-ink); box-shadow: inset 0 0 0 1px var(--ok-line); }
.ok-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 320px; min-height: var(--ok-row); margin-top: 8px;
  padding: 0 16px; border-radius: var(--ok-r); background: var(--ok-surface); color: var(--ok-ink); box-shadow: inset 0 0 0 1px var(--ok-line); font-weight: 600; text-align: left; }
.ok-chev { color: var(--ok-ink-2); font-size: 20px; }
.ok-link { min-height: var(--ok-row); padding: 0 24px; background: none; color: var(--ok-accent-ink); font-weight: 500; }

/* ---- "Confirm on your phone": a bottom sheet over a dimmed page */
.ok-back { background: color-mix(in oklab, #000 45%, transparent); display: flex; align-items: flex-end; justify-content: center; animation: ok-fade .2s ease-out; }
.ok-sheet { width: 100%; max-width: 520px; background: var(--ok-surface); border-radius: var(--ok-sheet-r) var(--ok-sheet-r) 0 0;
  padding: var(--ok-pad) var(--ok-pad) max(var(--ok-pad), env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; overscroll-behavior: contain; touch-action: none; animation: ok-up .25s ease-out; }
.ok-grab { --ok-grab: 4px; width: 36px; height: var(--ok-grab); border-radius: calc(var(--ok-grab) / 2); background: var(--ok-line); }
.ok-title { margin: 0; font-size: 19px; font-weight: 600; }
.ok-text { margin: 0; color: var(--ok-ink-2); }
.ok-text:empty { display: none; }
.ok-sheet .ok-acts { max-width: none; }
.ok-spin { width: 26px; height: 26px; margin: 8px 0; border-radius: 50%; border: 2.5px solid var(--ok-accent-ink); border-right-color: transparent; animation: ok-spin .7s linear infinite; }
@keyframes ok-spin { to { transform: rotate(360deg); } }
@keyframes ok-pulse { 50% { opacity: .35; } }
@keyframes ok-fade { from { opacity: 0; } }
@keyframes ok-up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ok-back, .ok-sheet { animation: none; }
  .ok-spin { animation-duration: 1.6s; }
  .ok-busy .ok-mark svg { animation: none; opacity: .5; }
}
