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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  background-size: cover;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.lockscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

/* Time */
.time {
  font-size: 80px;
  font-weight: 200;
  letter-spacing: -2px;
  margin-bottom: 4px;
}

.date {
  font-size: 18px;
  font-weight: 400;
  opacity: 0.8;
  text-transform: capitalize;
  margin-bottom: 40px;
}

/* PIN Container */
.pin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.pin-title {
  font-size: 17px;
  font-weight: 400;
  margin-bottom: 20px;
  opacity: 0.9;
}

/* PIN Display */
.pin-display {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}

.pin-dots {
  display: flex;
  gap: 12px;
}

.pin-text {
  display: none;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 8px;
  height: 18px;
  min-width: 200px;
  text-align: center;
}

.pin-display.show-pin .pin-dots {
  display: none;
}

.pin-display.show-pin .pin-text {
  display: block;
}

.eye-btn {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}

.eye-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.eye-btn svg {
  width: 22px;
  height: 22px;
}

.eye-btn .eye-off-icon {
  display: none;
}

.pin-display.show-pin .eye-btn .eye-icon {
  display: none;
}

.pin-display.show-pin .eye-btn .eye-off-icon {
  display: block;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  transition: all 0.15s ease;
}

.dot.filled {
  background: #fff;
  border-color: #fff;
}

.dot.error {
  border-color: #ff3b30;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Message */
.message {
  height: 24px;
  font-size: 14px;
  color: #ff3b30;
  margin-bottom: 20px;
  text-align: center;
}

.message.success {
  color: #34c759;
}

/* Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 280px;
}

.key {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  user-select: none;
}

.key:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

.key-empty {
  visibility: hidden;
}

.key-number {
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
}

.key-letters {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1px;
  opacity: 0.7;
  margin-top: 2px;
}

.key-delete {
  background: transparent;
  border: none;
}

.key-delete svg {
  width: 28px;
  height: 28px;
  opacity: 0.8;
}

.key-delete:active {
  opacity: 0.5;
}

/* Blocked Overlay */
.blocked-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.blocked-overlay.visible {
  display: flex;
}

.blocked-content {
  text-align: center;
  padding: 40px;
}

.blocked-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.blocked-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.blocked-message {
  font-size: 16px;
  opacity: 0.7;
  max-width: 280px;
}

/* Responsive */
@media (max-width: 380px) {
  .time {
    font-size: 64px;
  }

  .key {
    width: 70px;
    height: 70px;
  }

  .key-number {
    font-size: 28px;
  }

  .keypad {
    gap: 12px;
    max-width: 240px;
  }

  .pin-dots {
    gap: 8px;
  }

  .dot {
    width: 12px;
    height: 12px;
  }
}

/* Loading state */
.lockscreen.loading .keypad {
  pointer-events: none;
  opacity: 0.5;
}
