:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #17202b;
  --muted: #627084;
  --line: #d6dce5;
  --accent: #0b6bcb;
  --accent-text: #ffffff;
  --ok: #12805c;
  --warn: #b4540a;
  --error: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151c;
    --card: #19212b;
    --text: #e8edf3;
    --muted: #94a3b8;
    --line: #2c3846;
    --accent: #4c9df0;
    --accent-text: #0b1220;
    --ok: #4cc79b;
    --warn: #f0a04c;
    --error: #f2857d;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
h1 { font-size: 20px; margin: 0; }
.who { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: baseline; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
}
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button {
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  white-space: nowrap;
}
button:disabled { opacity: 0.6; cursor: default; }
#login-form button { width: 100%; margin-top: 16px; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 500; font-size: 14px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
.result { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.result-head { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 14px; }
.otp {
  font: 700 clamp(40px, 14vw, 56px)/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.12em;
  text-align: center;
  margin: 12px 0 4px;
  font-variant-numeric: tabular-nums;
}
.otp.none { color: var(--muted); font-family: inherit; font-size: 18px; letter-spacing: 0; font-weight: 500; padding: 18px 0; }
.status { text-align: center; font-size: 14px; color: var(--ok); min-height: 21px; }
.status.low { color: var(--warn); }
.status.idle { color: var(--muted); }
.bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--ok); transition: width 1s linear; }
.bar-fill.low { background: var(--warn); }
.message { margin: 16px 0 0; font-size: 14px; color: var(--error); }
