/* Overlay */
.pv-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  transition: opacity 0.3s ease-in-out;
}

/* Show modal */
.pv-modal.active {
  display: flex;
  opacity: 1;
}

/* Modal content */
.pv-modal-content {
  background: #ffffff;
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  padding: 24px;
  position: relative;
  animation: slideDown 0.4s ease-out forwards;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  text-align: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Animation */
@keyframes slideDown {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Close button */
.pv-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  transition: color 0.2s ease;
}

.pv-close:hover,
.pv-close:focus {
  color: #333;
  outline: none;
}

/* Title */
.pv-modal-content h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
}

/* Phone display */
.pv-phone {
  margin: 0 0 16px;
  font-size: 16px;
  color: #374151;
}

/* OTP input container */
.pv-otp-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 16px;
  direction: ltr; /* Ensure left-to-right layout */
}

/* Individual OTP input */
.pv-otp-input {
  width: 40px;
  height: 48px;
  padding: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pv-otp-input:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.pv-otp-input:disabled {
  background: #f3f4f6;
  cursor: not-allowed;
}

.pv-otp-input.error {
  border-color: #dc3545; /* Red border for error state */
}

/* Buttons */
.pv-btn {
  display: inline-block;
  padding: 12px 20px;
  margin: 6px 4px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.pv-btn-primary {
  background: #007bff;
  color: #fff;
}

.pv-btn-primary:hover,
.pv-btn-primary:focus {
  background: #0056b3;
  outline: none;
}

.pv-btn-success {
  background: #28a745;
  color: #fff;
}

.pv-btn-success:hover,
.pv-btn-success:focus {
  background: #1e7e34;
  outline: none;
}

.pv-btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.pv-btn-secondary:hover,
.pv-btn-secondary:focus {
  background: #d1d5db;
  outline: none;
}

/* Button loading state */
.pv-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.pv-btn .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.pv-btn.loading .spinner {
  display: inline-block;
}

.pv-btn.loading span {
  visibility: hidden;
}

/* Spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Global spinner */
.pv-spinner {
  display: none;
  margin: 16px auto;
  width: 32px;
  height: 32px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.pv-spinner.active {
  display: block;
}

/* Timer & message */
.pv-timer {
  margin-top: 10px;
  font-size: 13px;
  color: #6b7280;
}

.pv-message {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
}

/* Responsive design */
@media (max-width: 480px) {
  .pv-modal-content {
    padding: 20px 16px;
    max-width: 100%;
  }

  .pv-btn {
    width: 100%;
    margin: 8px 0;
  }

  .pv-modal-content h2 {
    font-size: 20px;
  }

  .pv-otp-input {
    width: 36px;
    height: 44px;
    font-size: 16px;
  }
}