/* OTP Verification Styles */
#send-otp-btn {
  margin-left: 10px;
  padding: 8px 16px;
  background: #0073aa;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#send-otp-btn:hover:not(:disabled) {
  background: #005a87;
}

#send-otp-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.otp-message {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
}

.otp-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.otp-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.otp-valid {
  border-color: #28a745 !important;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.otp-invalid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* OTP Multi-Box Visual Styles */
.otp-container {
  position: relative;
  margin-top: 10px;
}

.otp-hidden-input {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Hide Gravity Forms instruction for OTP field when boxes are active */
.gfield .otp-boxes-created + .otp-container ~ .instruction {
  display: none;
}

/* Gravity Forms integration styles */
.gfield .otp-container {
  margin-top: 5px;
}

.gfield .otp-boxes {
  margin-bottom: 10px;
}

/* Ensure OTP boxes are clickable and accessible */
.otp-box:focus {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

.otp-box[tabindex] {
  cursor: pointer;
}

.otp-boxes {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.otp-box {
  width: 45px;
  height: 45px;
  border: 2px solid #ddd;
  border-radius: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  line-height: 41px;
  background: #fff;
  cursor: text;
  transition: all 0.2s ease;
  user-select: none;
}

.otp-box:hover {
  border-color: #0073aa;
}

.otp-box.active {
  border-color: #0073aa;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.otp-box.filled {
  background: #f8f9fa;
  border-color: #28a745;
}

.otp-box.error {
  border-color: #dc3545;
  background: #fff5f5;
}

.otp-box.success {
  border-color: #28a745;
  background: #f0fff4;
}

.otp-box.disabled {
  background: #f5f5f5;
  border-color: #e0e0e0;
  color: #999;
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #send-otp-btn {
    display: block;
    margin: 8px 0 0 0;
    width: 100%;
  }
  
  .otp-boxes {
    justify-content: center;
    gap: 6px;
  }
  
  .otp-box {
    width: 40px;
    height: 40px;
    font-size: 16px;
    line-height: 36px;
  }
}

@media (max-width: 480px) {
  .otp-boxes {
    gap: 4px;
  }
  
  .otp-box {
    width: 35px;
    height: 35px;
    font-size: 14px;
    line-height: 31px;
  }
}