:root {
  --bg: #0f172a;
  --card: #111827;
  --accent: #10b981;
  --muted: #6b7280;
  --text: #f9fafb;
  --danger: #ef4444;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.08), transparent 25%),
    radial-gradient(circle at 80% 30%, rgba(59, 130, 246, 0.08), transparent 25%),
    var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app {
  width: min(420px, 100%);
  background: var(--card);
  padding: 28px 24px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.status {
  margin-bottom: 18px;
}

.status-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status-message.success {
  color: var(--accent);
}

.status-message.error {
  color: var(--danger);
}

.indicator {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.dot {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.dot.active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.keypad-wrapper {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.keypad button {
  height: 60px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.keypad button:focus-visible,
.keypad button:hover {
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.keypad button:active {
  transform: scale(0.98);
}

.keypad button.pressed {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(0.99);
}

.keypad .wide {
  grid-column: 1 / span 3;
}

.helper-keys {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.helper-keys button {
  height: 48px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.helper-keys button:hover,
.helper-keys button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.actions {
  margin-top: 12px;
  text-align: center;
}

.door-button {
  width: 100%;
  height: 54px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.65), rgba(5, 150, 105, 0.65));
  color: var(--text);
  cursor: not-allowed;
  opacity: 0.4;
  transition: opacity 140ms ease, transform 120ms ease, box-shadow 140ms ease;
}

.door-button.active {
  cursor: pointer;
  opacity: 1;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.door-button.active:active {
  transform: translateY(1px);
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.error {
  color: var(--danger);
  margin-top: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pin-input:focus {
  outline: none;
}

@media (min-width: 520px) {
  .app {
    padding: 32px 28px;
  }
}
