/* ==========================================================================
   The contact form, on every page (js/consult-form.js writes the markup).
   Only uses the tokens, fonts and the one button from site.css; loads after it (and after inner.css).
   Markup: .consult > intro, form (name, phone or email, call or text, topics, one-line note, Send), fine print.
   .consult--opened: a form that took the place of a "Request a free 15-minute consult" button.
   ========================================================================== */

.consult { text-align: left; }
.office__text:has(.consult) { width: 100%; }                      /* the closing block is shrink-to-fit; the card needs the room */

/* the card version (home page): paper on the clay gradient, like the cards over the stone strips */
.consult--card {
  margin-top: var(--s-4);
  padding: clamp(var(--s-3), 5vw, var(--s-5));
  background: var(--paper);
  border: 1px solid rgba(48, 49, 43, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(48, 49, 43, 0.10);
}

.consult__intro { font-weight: 500; }
.consult__form { margin-top: var(--s-3); display: grid; gap: var(--s-3); }
.consult__form[hidden], .consult__intro[hidden], .consult__thanks[hidden] { display: none; }
.consult__form:focus { outline: none; }                             /* focus lands here when the form opens; nothing to draw */
[data-consult-open][hidden] { display: none !important; }           /* the button the form replaced (.btn would otherwise win) */

/* ---- Fields ------------------------------------------------------------- */
.cf-field { display: grid; gap: 0.4rem; }
.cf-label { font-weight: 600; line-height: 1.3; }
.cf-optional { font-weight: 400; color: var(--ink-soft); }
.cf-input {
  width: 100%; min-height: 3.5rem; padding: 0.7rem 1rem;
  font: inherit; font-size: max(1.0625rem, 16px);                  /* 16px or more: iOS does not zoom the page on focus */
  color: var(--ink); background: #fff;
  border: 1.5px solid var(--sage-deep); border-radius: 1rem;
  -webkit-appearance: none; appearance: none;
}
.cf-input:hover { border-color: var(--ink); }
.cf-input[aria-invalid="true"] { border-color: var(--terracotta-deep); border-width: 2px; }
.cf-note { min-height: 7rem; resize: vertical; line-height: 1.5; }
.cf-count { margin: 0; color: var(--ink-soft); font-size: var(--t-small); line-height: 1.4; }
.cf-count--low { color: var(--terracotta-deep); font-weight: 600; }
.cf-error { color: var(--terracotta-deep); font-weight: 600; font-size: var(--t-small); line-height: 1.4; }
.cf-error:empty { display: none; }

/* ---- Chips: real checkboxes, shown as pills ------------------------------ */
.cf-chips { margin: 0; padding: 0; border: 0; min-width: 0; }
.cf-chips legend { padding: 0; margin-bottom: var(--s-1); }
.cf-chips__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { position: relative; display: inline-flex; }
.chip input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer;                                      /* the whole pill is the checkbox */
}
.chip span {
  display: inline-flex; align-items: center; min-height: 3rem; padding: 0.55rem 0.95rem;
  border: 1.5px solid var(--sage-deep); border-radius: 999px;
  background: #fff; color: var(--ink);
  font-weight: 500; line-height: 1.2;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.chip:hover span { border-color: var(--ink); background: rgba(48, 49, 43, 0.05); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip input:checked + span::before {                                /* a drawn check, so the state is not color alone */
  content: ""; width: 0.32em; height: 0.62em; margin: -0.15em 0.65em 0 0;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.chip input:focus-visible + span { outline: 3px solid var(--terracotta-deep); outline-offset: 3px; }

/* ---- Send, results, fine print ------------------------------------------- */
.consult .consult__submit { margin-top: var(--s-1); width: 100%; }  /* the one button, full width on phones */
@media (min-width: 40em) { .consult .consult__submit { width: auto; min-width: 12rem; justify-self: start; } }
.consult .consult__submit[disabled] { opacity: 0.7; cursor: progress; }
.consult__fail { margin-top: var(--s-2); padding: var(--s-2) var(--s-3); border-radius: 1rem; background: var(--clay-paper); font-weight: 500; }
.consult__fail:empty { display: none; }
.consult__fail a { white-space: nowrap; font-weight: 600; }
.consult__thanks {
  font-family: var(--font-display); font-weight: 500; font-size: var(--t-h3); line-height: 1.2;
  margin-top: var(--s-1);
}
.consult__thanks:focus { outline: none; }                           /* focus moves here for screen readers; nothing to draw */
.consult__fine { margin-top: var(--s-3); font-size: var(--t-small); color: var(--ink-soft); }

/* the spam trap: off the page, never focusable (the script also marks it inert) */
.cf-hp { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* inside the "Get started" action card the card itself is already there */
.action-card > .consult[data-consult-mount] { margin-top: 0; }
.action-card .consult + p { margin-top: var(--s-3); }

/* ---- Opened in place of a button ------------------------------------------ */
.consult--opened { margin-top: var(--s-3); }
.page-title .consult--opened { max-width: 40rem; margin-top: var(--s-4); }   /* in a title band: a paper card on the greige */
.hero__actions .consult--opened { width: min(100%, 36rem); margin-top: 0; }  /* in the home hero: a card in the sky, centred */
.aside .consult--opened { margin-top: var(--s-2); }

/* ---- Booking: Google Calendar's booking page in a dialog ([data-booking-open], js/consult-form.js) ---- */
/* Get started: the booking button leads the card, the form follows under "Prefer to send a message instead?" */
.action-card > .btn:first-child { margin-top: 0; }
.action-card > h3 + .consult[data-consult-mount] { margin-top: var(--s-2); }

html.booking-open, html.booking-open body { overflow: hidden; }   /* the page behind stays put while the dialog is open */
.booking {
  width: min(56rem, calc(100% - 2rem)); max-width: none;
  height: min(52rem, calc(100% - 2rem)); max-height: none;
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
  box-shadow: 0 24px 70px rgba(48, 49, 43, 0.28);
  overflow: hidden; overscroll-behavior: contain;
}
.booking::backdrop { background: rgba(48, 49, 43, 0.55); }
.booking__inner { display: flex; flex-direction: column; height: 100%; }
.booking__bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid rgba(48, 49, 43, 0.1);
}
.booking__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 1.35rem + 0.6vw, 1.875rem); line-height: 1.15; }
.booking__title span { white-space: nowrap; }                       /* never break "15-minute" at its hyphen */
/* heading and Close on the first row, the check-your-number note across the full width under them */
.booking__bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-2); }
.booking__head { display: contents; }
.booking__title { grid-column: 1; grid-row: 1; }
.booking__close { grid-column: 2; grid-row: 1; }
.booking__note { grid-column: 1 / -1; grid-row: 2; margin: 0.3rem 0 0; font-size: var(--t-small); line-height: 1.35; color: var(--ink-soft); }
.booking__alt { grid-column: 1 / -1; grid-row: 3; margin: 0.15rem 0 0; font-size: var(--t-small); line-height: 1.35; color: var(--ink-soft); }
.booking__alt a { color: var(--ink); font-weight: 600; white-space: nowrap; }
.booking__alt a:hover { color: var(--terracotta-deep); }
.booking__close {                                                   /* the quiet outline button (.btn--ghost on inner pages) */
  flex: none; min-height: 2.75rem; padding: 0.5rem 1.1rem;
  border: 1px solid rgba(48, 49, 43, 0.35); border-radius: 999px;
  background: transparent; color: var(--ink);
  font: inherit; font-size: 1.1875rem; font-weight: 700; line-height: 1.2; cursor: pointer;
  transition: background-color 160ms ease;
}
.booking__close:hover { background: rgba(48, 49, 43, 0.06); }
.booking__frame { display: block; flex: 1 1 auto; min-height: 0; width: 100%; border: 0; background: #fff; }
@media (max-width: 40em) {                  /* phones: a large card, with the dimmed page showing above and around it */
  .booking {
    width: calc(100% - 1.5rem);
    height: calc(100% - 4.25rem); height: calc(100dvh - 4.25rem);
    margin: 3.25rem auto 1rem;
    border-radius: 1.25rem;
  }
  .booking__bar { padding: var(--s-1) var(--s-2) var(--s-1) var(--s-3); }
  .booking__title { font-size: 1.375rem; }
}

@media (prefers-reduced-motion: reduce) {
  .chip span, .booking__close { transition: none; }
}
