:root {
  --bg: #0a0d14;
  --surface: #151a27;
  --edge: #262d40;
  --text: #eef2f9;
  --dim: #7b869c;
  --accent: #6ea8fe;
  --bad: #f87171;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.login {
  width: min(340px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 0 calc(24px + env(safe-area-inset-bottom));
}

.mark { font-size: 44px; }
h1 { margin: 4px 0 0; font-size: 21px; font-weight: 600; }
.hint { margin: 0; font-size: 14px; color: var(--dim); min-height: 20px; }

.dots {
  display: flex;
  gap: 12px;
  height: 14px;
  margin: 22px 0 26px;
  align-items: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  animation: pop 160ms ease-out;
}

@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
}

.key {
  aspect-ratio: 1.35;
  border-radius: 18px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 26px;
  font-weight: 300;
  cursor: pointer;
  transition: transform 90ms ease, background 120ms ease;
}

.key:active { transform: scale(0.94); background: #1e2534; }

/* Fire TV navigates this keypad with a D-pad, so the focused key must shout. */
.key:focus {
  outline: none;
  border-color: var(--accent);
  background: #1e2534;
  box-shadow: 0 0 0 3px var(--accent);
  transform: scale(1.04);
}
.key-ghost { background: transparent; font-size: 15px; color: var(--dim); }

body.is-wrong .dots { animation: shake 420ms ease; }
body.is-wrong .hint { color: var(--bad); }

@keyframes shake {
  10%, 50%, 90% { transform: translateX(-7px); }
  30%, 70% { transform: translateX(7px); }
}
