/**
 * Form Validation Styles
 * Parsley.js error and success states
 */

/* Error state */

#draftRefNumber{
 font-size: 14px !important; 
}
.parsley-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

.parsley-error:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Success state */
.parsley-success {
  border-color: #10b981 !important;
  background-color: #f0fdf4 !important;
}

.parsley-success:focus {
  border-color: #059669 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Error messages container */
.parsley-errors-list {
  margin-top: 0.5rem;
  padding: 0;
  list-style: none;
}

.parsley-error-message {
  display: block;
  color: #dc2626;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.25rem;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Error icon */
.parsley-error-message::before {
  content: "⚠️ ";
  margin-right: 0.25rem;
}

/* Select dropdown error state */
select.parsley-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

/* File input error state */
input[type="file"].parsley-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

/* File input wrapper styling for better error visibility */
input[type="file"].parsley-error::file-selector-button {
  background-color: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
}

/* Textarea error state */
textarea.parsley-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

/* Checkbox/Radio error state */
input[type="checkbox"].parsley-error,
input[type="radio"].parsley-error {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* Submit button disabled state */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Focus ring for accessibility */
.parsley-error:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.parsley-success:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .parsley-error-message {
    font-size: 0.8125rem;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  .parsley-error {
    background-color: rgba(239, 68, 68, 0.1) !important;
  }
  
  .parsley-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
  }
  
  .parsley-error-message {
    color: #f87171;
  }
}

/* Loading state for submit button */
button.loading {
  position: relative;
  color: transparent;
}

button.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Validation tooltip (optional enhancement) */
.parsley-tooltip {
  position: absolute;
  z-index: 1000;
  background-color: #dc2626;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Required field indicator */
.required::after {
  content: " *";
  color: #dc2626;
  font-weight: bold;
}

/* Success checkmark animation */
.parsley-success-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 0.5rem;
  animation: checkmark 0.3s ease-in-out;
}

@keyframes checkmark {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}
