/* Form validation styles */
.contact-form input.is-invalid,
.contact-form select.is-invalid,
.contact-form textarea.is-invalid {
  border: 2px solid #dc3545;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
  transition: all 0.3s ease-in-out;
}

.contact-form .invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}

.contact-form .is-invalid ~ .invalid-feedback {
  display: block;
}

/* Sweet Alert customization */
.swal2-popup.swal2-show-validation-errors {
  padding: 2em;
  border-radius: 10px;
  width: 400px !important;
}

.swal2-popup .swal2-title {
  color: #1a3a6c;
  font-size: 1.5em;
  font-weight: 600;
  margin-bottom: 1em;
}

.swal2-html-container.swal2-html-container-left-align {
  text-align: left !important;
  margin: 1em 0;
}

.validation-errors {
  background-color: #fff;
  border-radius: 8px;
  padding: 15px;
}

.validation-errors .error-summary {
  font-size: 1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.validation-errors .error-list {
  margin: 0;
  padding: 0;
}

.validation-errors .error-list li {
  margin-bottom: 10px;
  padding-left: 25px;
  position: relative;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Animation for error messages */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.invalid-feedback {
  animation: fadeIn 0.3s ease-in-out;
}

/* Focus styles */
.contact-form input:focus:not(.is-invalid),
.contact-form select:focus:not(.is-invalid),
.contact-form textarea:focus:not(.is-invalid) {
  border-color: #1a3a6c;
  box-shadow: 0 0 0 0.2rem rgba(26, 58, 108, 0.25);
}

/* Real-time validation feedback */
.contact-form input:valid,
.contact-form select:valid,
.contact-form textarea:valid {
  border-color: #198754;
}

.contact-form input.is-invalid:focus,
.contact-form select.is-invalid:focus,
.contact-form textarea.is-invalid:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Form messages container */
#form-messages {
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-radius: 4px;
  animation: fadeIn 0.3s ease-in-out;
}

#form-messages.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

#form-messages.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}
