/* Form validation + AJAX message styles */
.form-message {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.form-message.success:not(:empty) {
  display: block;
  color: #0f5132;
  background: #d1e7dd;
  border: 1px solid #badbcc;
}

.form-message.error:not(:empty) {
  display: block;
  color: #842029;
  background: #f8d7da;
  border: 1px solid #f5c2c7;
}

.field-error {
  margin: -6px 0 10px;
  color: #e1251b;
  font-size: 12px;
  font-weight: 600;
}

.is-invalid {
  border-color: #e1251b !important;
  background: #fff5f5 !important;
}

button[disabled] {
  opacity: 0.72;
  cursor: not-allowed !important;
}


/* Stable validation layout fixes */
.form-control-wrap {
  width: 100%;
  position: relative;
}

.form-control-wrap .form-field,
.form-control-wrap .form-field-red {
  margin-bottom: 0;
}

.form-control-wrap+.form-control-wrap {
  margin-top: 12px;
}

.field-error {
  margin: 8px 0 10px;
  color: #e1251b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.is-invalid {
  border-color: #e1251b !important;
  background: #fff5f5 !important;
}

/* Red CTA form: keep field color consistent and make errors readable on red */
.brand-cta .form-control-wrap+.form-control-wrap {
  margin-top: 14px;
}

.brand-cta .form-field-red.is-invalid {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 0 3px rgba(31, 30, 82, 0.18);
}

.brand-cta .form-field-red.is-invalid::placeholder {
  color: rgba(255, 255, 255, 0.78) !important;
}

.brand-cta .field-error {
  display: inline-block;
  margin: 8px 0 0;
  padding: 7px 10px;
  border-radius: 6px;
  color: #ffffff;
  background: rgba(31, 30, 82, 0.92);
  font-size: 12px;
  font-weight: 700;
}

.brand-cta .form-message.error:not(:empty) {
  color: #ffffff;
  background: rgba(31, 30, 82, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.brand-cta .form-message.success:not(:empty) {
  color: #1f1e52;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.brand-cta .btn-form-navy {
  margin-top: 22px;
}

/* Footer mini form: prevent validation messages from breaking the row */
.footer-lead-form {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
  gap: 10px 12px;
  flex: 1;
  max-width: 880px;
  min-width: 240px;
  align-items: start;
}

.footer-lead-form .form-control-wrap {
  min-width: 0;
}

.footer-lead-form .form-control-wrap+.form-control-wrap {
  margin-top: 0;
}

.footer-field {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.footer-field::placeholder {
  color: rgba(255, 255, 255, 0.52);
}

.footer-field:focus {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
}

.footer-field.is-invalid {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border-color: #e8eff9 !important;
  box-shadow: 0 0 0 2px rgba(225, 37, 27, 0.7);
}

.footer-lead-form .field-error {
  margin: 7px 0 0;
  color: #ffffff;
  background: rgba(225, 37, 27, 0.95);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
}

.footer-submit-btn {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
}

.footer-submit-btn:hover {
  background: var(--red-hover);
}

.footer-lead-form .form-message {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.footer-lead-form .form-message.error:not(:empty) {
  color: #ffffff;
  background: rgba(225, 37, 27, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-lead-form .form-message.success:not(:empty) {
  color: #1f1e52;
  background: #e8eff9;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

@media (max-width: 980px) {
  .footer-lead-form {
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
  }

  .footer-lead-form .footer-submit-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .footer-lead-form {
    grid-template-columns: 1fr;
  }
}