/**
 * Ninja Forms Custom Styling
 * Matches the Simple Form Block design system
 */

/* Form Container */
.nf-form-cont {
  max-width: 100%;
}

.nf-form-wrap {
  padding: 0;
}

/* Hide "Fields marked with *" message */
.nf-form-fields-required {
  display: none !important;
}

/* Form Labels */
.nf-form-content label {
  font-size: 16px !important;
  line-height: 24px !important;
  margin-bottom: 9px !important;
  color: #2c4b75;
  font-weight: 500;
  display: block;
}

/* Required asterisk */
.ninja-forms-req-symbol {
  color: #dc2626;
  margin-left: 2px;
}

/* Text Inputs, Email, Phone, Zip */
.nf-form-content input[type="text"],
.nf-form-content input[type="email"],
.nf-form-content input[type="tel"],
.nf-form-content select,
.nf-form-content textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 1rem;
  background-color: white;
  color: #334155;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nf-form-content input[type="text"]:focus,
.nf-form-content input[type="email"]:focus,
.nf-form-content input[type="tel"]:focus,
.nf-form-content select:focus,
.nf-form-content textarea:focus {
  outline: none;
  border-color: #36567e;
  box-shadow: 0 0 0 3px rgba(54, 86, 126, 0.1);
}

/* Textarea specific */
.nf-form-content textarea {
  min-height: 120px;
  resize: vertical;
}

/* Select Dropdowns */
.nf-form-content select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  appearance: none;
}

/* Radio Buttons */
.nf-form-content .list-radio-wrap .nf-field-element {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nf-form-content .list-radio-wrap .nf-field-element > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nf-form-content input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
  accent-color: #36567e;
}

.nf-form-content .list-radio-wrap label {
  margin-bottom: 0 !important;
  cursor: pointer;
  font-weight: 400;
}

/* Checkbox */
.nf-form-content .checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.nf-form-content input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: #36567e;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.nf-form-content .checkbox-container.label-right .field-wrap {
  display: inline-flex !important;
  align-items: flex-start;
  gap: 0.75rem;
}

.nf-form-content .checkbox-container.label-right label {
  margin-bottom: 0 !important;
  cursor: pointer;
  order: 2;
}

.nf-form-content .checkbox-container.label-right input[type="checkbox"] {
  order: 1;
}

/* Field Description */
.nf-field-description {
  font-size: 0.875rem;
  color: #475569;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* HTML Field (like the notice) */
.nf-form-content .html-wrap .nf-field-element {
  font-size: 0.875rem;
  color: #475569;
  font-style: italic;
  padding: 0.75rem;
  background-color: #f1f5f9;
  border-left: 3px solid #36567e;
  border-radius: 0.25rem;
  margin: 1rem 0;
}

/* Submit Button */
.nf-form-content input[type="submit"],
.nf-form-content button[type="submit"],
.nf-form-content .submit-wrap input[type="submit"] {
  background-color: #36567e !important;
  color: white !important;
  font-weight: 600 !important;
  padding: 10px 25px !important;
  border-radius: 9999px !important;
  border: none !important;
  cursor: pointer !important;
  transition: background-color 0.2s !important;
  font-size: 1rem !important;
  width: auto !important;
  min-width: 150px;
}

.nf-form-content input[type="submit"]:hover,
.nf-form-content button[type="submit"]:hover,
.nf-form-content .submit-wrap input[type="submit"]:hover {
  background-color: #2c4666 !important;
}

.nf-form-content input[type="submit"]:disabled,
.nf-form-content button[type="submit"]:disabled {
  background-color: #94a3b8 !important;
  cursor: not-allowed !important;
}

/* Error Styling */
.nf-error-msg,
.nf-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: block;
}

.nf-form-content input.nf-error,
.nf-form-content select.nf-error,
.nf-form-content textarea.nf-error {
  border-color: #dc2626;
}

.nf-form-content input.nf-error:focus,
.nf-form-content select.nf-error:focus,
.nf-form-content textarea.nf-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Success Message */
.nf-response-msg {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.nf-response-msg.nf-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.nf-response-msg.nf-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Multi-cell Grid Layout (for rows with multiple fields) */
.nf-form-content .nf-row {
  margin-bottom: 1.5rem;
  /* Let Ninja Forms handle the layout naturally */
}

.nf-form-content .nf-cell {
  box-sizing: border-box;
  /* Let Ninja Forms handle the width via inline styles */
}

/* Responsive: Stack on mobile */
@media (max-width: 767px) {
  .nf-form-content .nf-row {
    flex-direction: column;
  }

  .nf-form-content .nf-cell {
    width: 100% !important;
  }
}

/* Field Container Spacing */
.nf-field-container {
  margin-bottom: 1.5rem;
}

.nf-field-container:last-child {
  margin-bottom: 0;
}

/* reCAPTCHA Styling */
.nf-form-content .recaptcha-wrap {
  margin: 1.5rem 0;
}

.nf-form-content .g-recaptcha {
  display: inline-block;
}

/* Hidden Field (Honeypot) */
.nf-form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Processing/Loading State */
.nf-form-content .nf-loading {
  opacity: 0.6;
  pointer-events: none;
}

.nf-form-content .nf-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #f3f4f6;
  border-top-color: #36567e;
  border-radius: 50%;
  animation: nf-spinner 0.8s linear infinite;
}

@keyframes nf-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Form Title (if shown) */
.nf-form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c4b75;
  margin-bottom: 1.5rem;
}

/* Help Text */
.nf-help {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
  display: block;
}

/* Placeholder Styling */
.nf-form-content input::placeholder,
.nf-form-content textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

/* Focus Visible for Accessibility */
.nf-form-content input:focus-visible,
.nf-form-content select:focus-visible,
.nf-form-content textarea:focus-visible,
.nf-form-content button:focus-visible {
  outline: 2px solid #36567e;
  outline-offset: 2px;
}

/* Remove default Ninja Forms advanced CSS if present */
.nf-form-content .nf-field-label label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Ensure proper spacing in multi-part forms */
.nf-mp-body {
  padding: 0;
}

.nf-next-previous {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  list-style: none;
  padding: 0;
}

.nf-next-previous input[type="button"] {
  background-color: #36567e;
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 1rem;
}

.nf-next-previous input[type="button"]:hover {
  background-color: #2c4666;
}

