/* ============================================================
   Contact page forms. Builds on `form.contact` in style.css
   (underlined fields), restyled here as filled boxes; adds real labels, the two-up grid, focus
   and error states, and the sent / failed note.
   ============================================================ */

form.contact {
  max-width: 760px;
  grid-template-columns: 1fr 1fr;
  gap: 30px 36px;
  margin-top: 0;
}
form.contact .field { display: grid; gap: 9px; min-width: 0; }
form.contact .field.full { grid-column: 1 / -1; }

/* same spaced-caps treatment as the contact-row labels below the forms */
form.contact label {
  text-transform: uppercase;
  letter-spacing: .24em;
  font-size: .72rem;
  font-weight: 500;
  opacity: .6;
}

/* each field is a filled box in the deeper cream, so it is obvious where to type.
   16px+ text so iOS does not zoom the page on focus */
form.contact input,
form.contact textarea {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.5;
  padding: 13px 15px;
  background: var(--cream-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
form.contact textarea { min-height: 160px; }
form.contact input:hover,
form.contact textarea:hover { border-color: rgba(10, 35, 29, .38); }

form.contact input:focus,
form.contact textarea:focus { border-color: var(--forest); }
form.contact input:focus-visible,
form.contact textarea:focus-visible {
  border-color: var(--forest);
  box-shadow: 0 0 0 1px var(--forest);
  background: #FBF1E0;
}
form.contact input:user-invalid,
form.contact textarea:user-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

form.contact button { margin-top: .4rem; }
form.contact button.btn-line { background: transparent; border: 1px solid var(--forest); }
form.contact button:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
form.contact button:disabled { opacity: .55; cursor: default; transform: none; }

/* honeypot: off-screen rather than display:none so naive bots still fill it */
form.contact .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* sent / failed note. Hidden until the script shows it, or until a no-JS
   submission comes back to its #...-sent anchor. */
.form-note { display: none; margin-top: 1.3rem; font-size: 1rem; max-width: 56ch; }
.form-note.show, .form-note:target { display: block; }
.form-note.error { color: var(--red); }
.form-note:focus { outline: none; }

/* the diligence request and the contact details each open with a hairline */
.form-block { max-width: 900px; border-top: 1px solid var(--line); padding-top: clamp(40px, 7vh, 64px); }
.form-block > .kicker { margin-bottom: clamp(1.6rem, 4vh, 2.4rem); }
.contact-rows.form-block { padding-top: 0; }

/* the fixed top bar would otherwise cover an anchored form */
#form, #diligence, #form-sent, #diligence-sent { scroll-margin-top: 110px; }

@media (max-width: 860px) {
  form.contact { grid-template-columns: 1fr; gap: 24px; }
  form.contact button { width: 100%; text-align: center; padding-left: 20px; padding-right: 20px; }
}
