/**
 * Way To Care - Contact Form Styles
 * License: MIT | Version: 1.0.0
 */

/* Form Message Container */
.wtc-form-message {
  display: none;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  align-items: flex-start;
  gap: 0.75rem;
}

.wtc-form-message:not(:empty) {
  display: flex;
}

.wtc-form-message .wtc-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.wtc-form-message ul {
  margin: 0.5rem 0 0 1rem;
  padding: 0;
}

.wtc-form-message li {
  margin: 0.25rem 0;
}

/* Success Message */
.wtc-form-message--success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

/* Error Message */
.wtc-form-message--error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* Field Error Styles */
.wtc-field-error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

.wtc-field-error-message {
  display: block;
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Spinner Animation */
.wtc-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: wtc-spin 0.75s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

@keyframes wtc-spin {
  to { transform: rotate(360deg); }
}

/* Form Field Enhancements */
.nf-field-element input,
.nf-field-element textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nf-field-element input:focus,
.nf-field-element textarea:focus {
  outline: none;
  border-color: var(--wtc-primary, #007bff);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.nf-field-element textarea {
  min-height: 120px;
  resize: vertical;
}

/* Checkbox Styling */
.nf-field-element input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  transform: scale(1.2);
}

/* Submit Button */
.nf-field-container button[type="submit"],
.nf-field-container input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background-color: var(--wtc-primary, #007bff);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.nf-field-container button[type="submit"]:hover,
.nf-field-container input[type="submit"]:hover {
  background-color: var(--wtc-primary-dark, #0056b3);
}

.nf-field-container button[type="submit"]:active,
.nf-field-container input[type="submit"]:active {
  transform: scale(0.98);
}

.nf-field-container button[type="submit"]:disabled,
.nf-field-container input[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Required Field Indicator */
.wtc-form-req-symbol {
  color: #dc3545;
  font-weight: bold;
}

/* Label Styling */
.nf-field-label label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
}

/* Field Container Spacing */
.nf-field-container {
  margin-bottom: 1.25rem;
}

/* Two Column Layout Fix */
@media (min-width: 768px) {
  .nf-row {
    display: flex;
    gap: 1.5rem;
  }
  
  .nf-cell {
    flex: 1;
  }
}

/* Mobile Responsive */
@media (max-width: 767px) {
  .nf-cell {
    width: 100% !important;
  }
  
  .wtc-form-message {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .wtc-form-message--success {
    border-width: 2px;
  }
  
  .wtc-form-message--error {
    border-width: 2px;
  }
  
  .nf-field-element input:focus,
  .nf-field-element textarea:focus {
    outline: 2px solid;
    outline-offset: 2px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .wtc-spinner {
    animation: none;
  }
  
  .nf-field-element input,
  .nf-field-element textarea {
    transition: none;
  }
}

/* Two Column Layout for Contact Form */
.nf-form-content .nf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0;
}

.nf-form-content .nf-cell {
  flex: 0 0 auto;
  min-width: 0;
}

.nf-form-content .nf-cell[style*="width:50%"] {
  flex: 0 0 calc(50% - 0.5rem);
  max-width: calc(50% - 0.5rem);
}

.nf-form-content .nf-cell[style*="width:100%"] {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Mobile: Stack all fields */
@media (max-width: 767px) {
  .nf-form-content .nf-row {
    flex-direction: column;
  }
  
  .nf-form-content .nf-cell,
  .nf-form-content .nf-cell[style*="width:50%"],
  .nf-form-content .nf-cell[style*="width:100%"] {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}
