:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #22c55e;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #0b1220 0%, var(--bg) 100%);
  color: var(--text);
}

.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  width: min(92vw, 420px);
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(5px);
}

h1 {
  font-size: 24px;
  margin: 0 0 10px;
}

#subtitle {
  color: var(--muted);
  margin: 0 0 20px;
}

.pin-boxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.box {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
}

.box.filled::after {
  content: "•";
}

.message {
  min-height: 24px;
  margin: 0;
  font-size: 14px;
}

.message.success {
  color: var(--accent);
}

.message.error {
  color: var(--error);
}

.keypad {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.keypad-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.key {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  height: 48px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 8px;
}

.key:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.key:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.key-wide {
  font-size: 14px;
  font-weight: 600;
}

.key-ok {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.45);
}

.key-ok:not(:disabled):active {
  background: rgba(34, 197, 94, 0.4);
}

.hidden-input {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}
