* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  height: 100vh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 20px;
}

.terminal-box {
  background: #111;
  border: 1px solid #222;
  border-radius: 16px;
  padding: 40px 32px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.logo-area {
  text-align: center;
  margin-bottom: 32px;
}

.logo-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a5c2e, #0d7a3a);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #fff;
}

.logo-circle svg {
  width: 28px;
  height: 28px;
}

h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 4px;
  color: #fff;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 13px;
  color: #666;
}

.input-area {
  margin-bottom: 24px;
}

.code-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
  height: 40px;
  align-items: center;
}

.code-display .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #333;
  transition: all 0.15s ease;
}

.code-display .dot.filled {
  background: #0d7a3a;
  border-color: #0d7a3a;
  box-shadow: 0 0 8px rgba(13, 122, 58, 0.4);
}

.code-display .dot.error {
  border-color: #c0392b;
  background: #c0392b;
  box-shadow: 0 0 8px rgba(192, 57, 43, 0.4);
  animation: shake 0.4s ease;
}

.code-display .dot.success {
  background: #0d7a3a;
  border-color: #0d7a3a;
  animation: pulse 0.3s ease;
}

#codeInput {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.error-msg {
  text-align: center;
  font-size: 12px;
  color: #c0392b;
  height: 18px;
  line-height: 18px;
  margin-top: 4px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.key {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  color: #e0e0e0;
  font-size: 22px;
  font-weight: 500;
  padding: 16px;
  cursor: pointer;
  transition: all 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.key:active {
  background: #2a2a2a;
  transform: scale(0.96);
}

.key:hover {
  background: #222;
}

.key-clear {
  color: #888;
  font-size: 18px;
  font-weight: 600;
}

.key-enter {
  background: linear-gradient(135deg, #1a5c2e, #0d7a3a);
  border-color: #0d7a3a;
  color: #fff;
  font-size: 24px;
}

.key-enter:hover {
  background: linear-gradient(135deg, #1e6b35, #0f8c42);
}

.key-enter:active {
  background: linear-gradient(135deg, #155024, #0a6830);
}

.footer {
  position: fixed;
  bottom: 20px;
  color: #333;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Blocca menu contestuale e selezione */
body {
  -webkit-touch-callout: none;
}

/* Responsive per schermi piccoli */
@media (max-height: 600px) {
  .terminal-box {
    padding: 24px 24px 20px;
  }
  .logo-area {
    margin-bottom: 20px;
  }
  .key {
    padding: 12px;
    font-size: 20px;
  }
}
