:root {
  --ink: #2F2F2F;
  --line: #5A5A5A;
  --text: #ECECEC;
  --muted: #A8A8A8;
  --bad: #B4232A;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(380px, calc(100vw - 48px));
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  transition: border-color 180ms ease;
}

.login:focus-within { border-bottom-color: var(--text); }
.login.is-bad { border-bottom-color: var(--bad); animation: nudge 220ms ease; }

.field {
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 24px;
  letter-spacing: 0.28em;
}

.field:focus { outline: none; }
.field:disabled { color: var(--muted); }

.submit {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  color: var(--text);
  cursor: pointer;
  transition: background 180ms ease, opacity 180ms ease;
}

.submit svg { width: 20px; height: 20px; }
.submit:hover:not(:disabled) { background: #31353F; }
.submit:disabled { opacity: 0.4; cursor: default; }
.submit:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.status {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.status:empty { display: none; }
.status[data-kind='error'] { color: var(--bad); }

.countdown { font-variant-numeric: tabular-nums; }

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
  .login, .submit { transition: none; }
  .login.is-bad { animation: none; }
}
