/**
 * NDK PIN Login - Custom phone keypad styles
 * 
 * Styles for on-screen phone-style keypad
 */

/* Keypad container */
.ndk-keypad {
  margin: 20px auto;
  max-width: 300px;
}

/* Keypad row */
.ndk-keypad-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

/* Individual key button */
.ndk-key {
  flex: 1;
  height: 60px;
  font-size: 24px;
  font-weight: 500;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
}

/* Key hover effect */
.ndk-key:hover {
  background: #f5f5f5;
  border-color: #999;
}

/* Key active (pressed) effect */
.ndk-key:active {
  background: #e8e8e8;
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Action row - backspace and enter side by side */
.ndk-keypad-action-row {
  display: flex;
  gap: 10px;
}

.ndk-keypad-action-row .ndk-key {
  flex: 1;
}

/* Backspace key */
.ndk-key-backspace {
  background: #f0f0f0;
  border-color: #ccc;
}

.ndk-key-backspace:hover {
  background: #e5e5e5;
}

.ndk-key-backspace:active {
  background: #d8d8d8;
}

/* Enter/Login key */
.ndk-key-enter {
  background: #0073aa;
  color: #fff;
  border-color: #005a87;
  font-size: 28px;
  transition: all 0.3s ease;
}

.ndk-key-enter:hover {
  background: #005a87;
}

.ndk-key-enter:active {
  background: #004a6f;
}

/* Enter key emphasis when password is ready (8+ chars) */
.ndk-key-enter.ndk-ready {
  background: #00a0d2;
  border-color: #0073aa;
  animation: ndk-glow 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(0, 160, 210, 0.6), 0 0 40px rgba(0, 160, 210, 0.4);
}

.ndk-key-enter.ndk-ready:hover {
  background: #0087be;
  box-shadow: 0 0 25px rgba(0, 160, 210, 0.7), 0 0 50px rgba(0, 160, 210, 0.5);
}

/* Glow animation */
@keyframes ndk-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 160, 210, 0.6), 0 0 40px rgba(0, 160, 210, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 160, 210, 0.8), 0 0 60px rgba(0, 160, 210, 0.6), 0 0 80px rgba(0, 160, 210, 0.3);
  }
}

/* Display fields styling */
#ndk-member-display,
#ndk-password-display {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  font-family: monospace;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Active field glow effect */
#ndk-member-display.ndk-field-active,
#ndk-password-display.ndk-field-active {
  animation: ndk-field-glow 2s ease-in-out infinite;
}

/* Field glow animation */
@keyframes ndk-field-glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(0, 115, 170, 0.4), 0 0 16px rgba(0, 115, 170, 0.3), 0 0 24px rgba(0, 115, 170, 0.2);
  }
  50% {
    box-shadow: 0 0 12px rgba(0, 115, 170, 0.6), 0 0 24px rgba(0, 115, 170, 0.4), 0 0 36px rgba(0, 115, 170, 0.3);
  }
}

/* Password toggle button */
.ndk-password-toggle {
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ndk-password-toggle:hover {
  opacity: 1;
}

.ndk-password-toggle:active {
  transform: translateY(-50%) scale(0.9);
}

.ndk-eye-icon {
  pointer-events: none;
}

#ndk-member-display:focus,
#ndk-password-display:focus {
  outline: none;
}

/* Error state - light red background */
#ndk-member-display.ndk-field-error,
#ndk-password-display.ndk-field-error {
  background-color: #ffe5e5;
  border-color: #ff6b6b;
}

/* Snackbar notification */
.ndk-snackbar {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #d63638;
  color: #fff;
  padding: 16px 32px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  font-size: 16px;
  text-align: center;
  transition: opacity 0.3s ease;
  opacity: 0;
  min-width: 280px;
  max-width: 90%;
}

.ndk-snackbar.ndk-snackbar-show {
  opacity: 1;
}

.ndk-snackbar-dynamic {
  opacity: 0;
}

/* Responsive adjustments for mobile */
@media (max-width: 480px) {
  .ndk-keypad {
    max-width: 280px;
  }

  .ndk-key {
    height: 55px;
    font-size: 22px;
  }

  .ndk-keypad-row {
    gap: 8px;
    margin-bottom: 8px;
  }
}

/* Larger screens/tablets */
@media (min-width: 768px) {
  .ndk-keypad {
    max-width: 320px;
  }

  .ndk-key {
    height: 65px;
    font-size: 26px;
  }
  
  .ndk-key-enter {
    font-size: 32px;
  }

  .ndk-keypad-row {
    gap: 12px;
    margin-bottom: 12px;
  }
}

/* Accessibility: Focus indicators */
.ndk-key:focus-visible {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

/* Remove spinner arrows for number inputs (if any remain) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

