/* Form block (T35) with Boyd's look for the site's forms (master's Views/Partials/SiteForms/Form.cshtml). Tokens only; mobile first.
   Prototype: the form in 8 of 12 columns, a grey side panel (Light Grey, 26 px corners, sticky) in the other 4;
   bold 14–15 px labels, 52 px fields with a grey border (Grey 600, so the field edge passes 3:1, CC11) and 14 px corners, 120 px text areas, a dark pill to send.
   Errors have no colour of their own in the design system: they are bold ink text with a drawn "!" mark, and the
   field gets a heavy border, so the state never depends on colour. Every input, choice and the upload area is
   at least 44 px tall (B6). */

/* ── Contact page: fallback title inside the page gutter (D42) ───────── */
.contact__title { padding-top: var(--space-10); }

/* ── Block layout ───────────────────────────────────────────────────── */
.form-block__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-12) var(--gutter);
  align-items: start;
}
.form-block__main { min-width: 0; display: flex; flex-direction: column; gap: var(--space-7); }
.form-block__heading {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: var(--fw-regular);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--color-heading);
}

@media (min-width: 1024px) {
  .form-block__inner { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .form-block__main { grid-column: 1 / span 8; }
  .form-block__panel { grid-column: 9 / span 4; position: sticky; top: 110px; }
}

/* ── Side panel ─────────────────────────────────────────────────────── */
.form-block__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-card);
  background: var(--color-surface-quiet);
  color: var(--color-text);
  font-size: var(--fs-body-md);
  line-height: var(--lh-body-tight);
}
@media (min-width: 600px) { .form-block__panel { padding: var(--space-10) var(--space-8); } }
.form-block__panel-heading {
  margin: 0;
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  color: var(--color-heading);
}
/* One office: address, then Get directions and the click-to-load map (move 2, B17; styles in css/site/layout.css). */
.form-block__office-card { display: flex; flex-direction: column; gap: var(--space-2); }
.form-block__office-card .office-directions { align-self: flex-start; padding: 0; }
.form-block__office-card .office-map { margin-top: 0; }
.form-block__office-card .office-map__placeholder { background: var(--c-white); }
.form-block__office { display: flex; flex-direction: column; gap: var(--space-1); font-style: normal; }
.form-block__office-name { color: var(--color-heading); font-weight: var(--fw-bold); }
.form-block__phone {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: var(--tap-min);
  text-decoration: underline;
}
.form-block__reply, .form-block__text { margin: 0; }
.form-block__steps { margin: 0; padding-left: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); }
.form-block__steps li::marker { font-weight: var(--fw-bold); color: var(--color-heading); }

/* ── Tabs (Contact) ─────────────────────────────────────────────────── */
.form-tabs__nav { padding-top: var(--space-10); }
.form-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.form-tabs__tab {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-5);
  border: var(--border-width) solid var(--c-grey-600);
  border-radius: var(--radius-pill);
  background: var(--c-white);
  color: var(--color-heading);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: var(--transition-control);
}
.form-tabs__tab:hover { border-color: var(--btn-primary-bg); color: var(--color-heading); text-decoration: none; }
/* Without script the tabs are jump links: the current one isn't marked. With script, the open tab is a filled pill. */
.form-tabs--enhanced .form-tabs__tab[aria-selected="true"] {
  border-color: var(--btn-primary-bg);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}
.form-tabs__panel[hidden] { display: none; }
.form-tabs__panel .form-block { padding-top: var(--space-8); }
.form-tabs__panel { scroll-margin-top: var(--space-24); }

/* ── Fields ─────────────────────────────────────────────────────────── */
.form__fieldset, .form-field__group { margin: 0; padding: 0; border: 0; min-width: 0; }
.form__fields { display: flex; flex-direction: column; gap: var(--space-7); }
.form-field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.form-field__group { display: flex; flex-direction: column; gap: var(--space-2); }

.form-field__label {
  padding: 0;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  color: var(--color-heading);
}
.form-field__required { font-weight: var(--fw-regular); color: var(--color-muted); }
.form-field__help { margin: 0; font-size: var(--fs-body-sm); line-height: var(--lh-body-tight); color: var(--color-muted); }

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="url"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--c-grey-600);   /* 5.96:1 on white (CC11, round 2); the design's hairline is 1.67:1 */
  border-radius: var(--radius-input);
  background: var(--c-white);
  color: var(--color-heading);
  font: inherit;
  font-size: var(--fs-body-md);     /* 16 px: phones don't zoom into the field */
  line-height: var(--lh-body-tight);
  transition: var(--transition-control);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field input:hover, .form-field textarea:hover, .form-field select:hover { border-color: var(--color-heading); }
.form-field input:focus-visible, .form-field textarea:focus-visible, .form-field select:focus-visible {
  border-color: var(--color-focus);
}

/* Choices: each option is a 44 px row; the whole row takes the click. */
.form-field .radiobuttonlist, .form-field .checkboxlist { display: flex; flex-direction: column; gap: var(--space-1); }
.form-field .radiobuttonlist > div, .form-field .checkboxlist > div { position: relative; }
.form-field .radiobuttonlist label, .form-field .checkboxlist label {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: var(--space-2) 0 var(--space-2) calc(22px + var(--space-3));
  font-size: var(--fs-body-md);
  line-height: var(--lh-label);
  color: var(--color-heading);
  cursor: pointer;
}
.form-field .radiobuttonlist input, .form-field .checkboxlist input {
  position: absolute;
  top: 50%;
  left: 0;
  width: 22px;
  height: 22px;
  margin: -11px 0 0;
  accent-color: var(--btn-primary-bg);
  cursor: pointer;
}

/* ── Errors: next to the field, ink text with a drawn "!" ───────────── */
.form-field__error:empty, .form-field__error.field-validation-valid { display: none; }
.form-field__error.field-validation-error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  color: var(--color-heading);
}
.form-field__error.field-validation-error::before {
  content: "!";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-heading);
  color: var(--c-white);
  font-size: var(--fs-label);
  font-weight: var(--fw-bold);
  line-height: 1;
}
.form-field input.input-validation-error,
.form-field textarea.input-validation-error,
.form-field select.input-validation-error,
.form-field--invalid .upload__zone,
.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-width: var(--border-width-heavy);
  border-color: var(--color-heading);
}

/* ── Upload area ────────────────────────────────────────────────────── */
.upload { display: flex; flex-direction: column; gap: var(--space-3); }
.upload__zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: var(--space-5);
  border: var(--border-width) dashed var(--c-grey-600);
  border-radius: var(--radius-input);
  background: var(--color-surface-subtle);
  text-align: center;
  transition: var(--transition-control);
}
.upload__zone:hover, .upload--over .upload__zone { border-color: var(--btn-primary-bg); background: var(--c-white); }
.upload__zone:focus-within { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
/* The real input covers the whole area, so a click or a drop anywhere reaches it. */
.upload__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.upload__input:focus-visible { outline: none; }
.upload__prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-body-md);
  color: var(--color-text);
  pointer-events: none;
}
.upload__icon { color: var(--color-heading); }
.upload__button { font-weight: var(--fw-bold); color: var(--color-heading); text-decoration: underline; }
.upload__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--fs-body); color: var(--color-heading); overflow-wrap: anywhere; }
.upload__list:empty { display: none; }
.upload__kept { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-bold); }

/* ── Privacy line, send, status ─────────────────────────────────────── */
.form__privacy { margin: var(--space-6) 0 0; font-size: var(--fs-body); line-height: var(--lh-body-tight); color: var(--color-text); }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-6); }
.form__submit[aria-disabled="true"] { cursor: progress; }
.form--sending .form__submit { background: var(--btn-hover-bg); border-color: var(--btn-hover-bg); color: var(--btn-hover-fg); }
.form__status { margin: 0; font-size: var(--fs-body); color: var(--color-text); }
.form__status:empty { display: none; }

/* Forms' hidden helpers (conditions, honeypot). */

/* Forms' own success message, when a form has no thank-you page. */

@media (prefers-reduced-motion: reduce) {
  .form-tabs__tab, .upload__zone, .form-field input, .form-field textarea { transition: none; }
}

/* Master's form partial (SiteForms/Form, BV-c) in Boyd's look: the form fills the main column as the old theme did,
   and the send button keeps Boyd's arrow. */
.form-block__main .site-form { max-width: none; }
.form-block .site-form__submit { display: inline-flex; align-items: center; gap: 0.5rem; }
.form-block .site-form__submit::after {
  content: "";
  inline-size: 15px;
  block-size: 15px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1.5 -1.5 46 46' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.536 21.49H41.464'/%3E%3Cpath d='m23.036 3.071 18.428 18.429-18.428 18.428'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1.5 -1.5 46 46' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.536 21.49H41.464'/%3E%3Cpath d='m23.036 3.071 18.428 18.429-18.428 18.428'/%3E%3C/svg%3E") center / contain no-repeat;
}
