/* ==========================================================================
   Pavilion — forms (Contact page, Homeowners / Property Managers forms)
   Theme per form with --form-bg and --field-bg.
   ========================================================================== */

.contact-form {
  background: var(--form-bg, var(--color-yellow-200)); border-radius: 30px; padding: 30px;
}
.contact-form form { display: flex; flex-direction: column; gap: 22px; }
.cf-type { border: 0; margin: 0; padding: 0 0 16px; min-width: 0; }
.cf-label { display: block; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--color-black); padding: 0; margin-bottom: 16px; text-box: trim-both cap alphabetic; }
.cf-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.cf-option {
  position: relative; cursor: pointer;
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px; border-radius: 16px; background: var(--color-yellow-300);
  transition: background-color .2s ease;
}
.cf-option:hover { background: #fbf3a4; }
.cf-option:has(input:checked) { background: var(--color-off-white); }
.cf-option input { position: absolute; opacity: 0; pointer-events: none; }
.cf-option:has(input:focus-visible) { outline: 2px solid var(--color-maroon); outline-offset: 2px; }
.cf-radio {
  width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1px solid var(--color-maroon);
  display: grid; place-items: center;
}
.cf-radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--color-maroon); transform: scale(0); transition: transform .15s ease; }
.cf-option input:checked + .cf-radio::after { transform: scale(1); }
.cf-option__text { display: flex; flex-direction: column; gap: 20px; }
.cf-option__label { color: var(--color-black); }

.cf-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; padding-bottom: 18px; }
.cf-field { display: flex; flex-direction: column; min-width: 0; }
.cf-field .cf-label { margin-bottom: 12px; }
.cf-field--wide { grid-column: 1 / -1; }
.cf-input {
  width: 100%; min-height: 58px; padding: 16px 20px; border: 1px solid transparent; border-radius: 14px;
  background: var(--field-bg, var(--color-off-white)); color: var(--color-black);
  font: inherit; font-size: var(--fs-body); line-height: 1.3; letter-spacing: var(--ls-body);
  transition: border-color .15s ease;
}
.cf-input::placeholder { color: rgba(17, 17, 17, .33); opacity: 1; }
.cf-input:hover { border-color: var(--color-gray-200); }
.cf-input:focus { outline: none; border-color: var(--color-maroon); }
.cf-textarea { resize: vertical; display: block; field-sizing: content; max-height: 320px; }
.cf-select { position: relative; }
.cf-select select { appearance: none; -webkit-appearance: none; padding-right: 48px; cursor: pointer; }
.cf-select select:invalid { color: rgba(17, 17, 17, .33); }
.cf-select option { color: var(--color-black); }
.cf-select::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.5px solid var(--color-maroon); border-bottom: 1.5px solid var(--color-maroon);
  transform: rotate(45deg); pointer-events: none;
}

/* Validation (shown after the first submit attempt) */
.cf-error { margin-top: 10px; font-size: 14px; line-height: 1.4; color: var(--color-maroon); }
.is-submitted .cf-input:invalid { border-color: var(--color-maroon); }

.cf-form-error { margin: 0; }
button[aria-busy="true"] { opacity: .6; cursor: progress; }
.cf-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.cf-actions .t-caption { color: var(--color-black); }

/* Thank-you state */
.cf-sent {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 40px;
  text-align: center; padding: 30px 90px; min-height: 100%;
}
.cf-sent:focus { outline: none; }
.cf-sent .t-body-lg { max-width: 607px; }
.contact-form.is-sent { display: flex; }
.contact-form.is-sent .cf-sent { flex: 1; }


@media (max-width: 767px) {
  .contact-form { border-radius: 16px; padding: 20px; }
  .contact-form form { gap: 16px; }
  .cf-type { padding-bottom: 8px; }
  .cf-type .cf-label { margin-bottom: 16px; }
  .cf-options { grid-template-columns: 1fr; gap: 8px; }
  .cf-option { flex-direction: row; align-items: center; gap: 14px; padding: 16px 20px; }
  .cf-option__text { gap: 8px; }
  .cf-fields { grid-template-columns: 1fr; gap: 16px; padding-bottom: 24px; }
  .cf-field .cf-label { margin-bottom: 8px; }
  .cf-input { min-height: 44px; padding: 10px 20px; border-radius: 10px; }
  .cf-sent { gap: 16px; padding: 20px; }
}

/* Spam honeypot — off-screen, never shown */
.cf-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
form { position: relative; }

/* SMS consent */
.cf-consent { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.cf-consent input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--color-maroon, #6b1d2a); cursor: pointer; }
.cf-consent .t-caption { color: var(--text-muted, var(--color-black)); }
.cf-sms-note { color: var(--text-muted, var(--color-black)); margin-top: -8px; }
