/* Contact form
 *
 * NOT FROM THE HANDOFF — the mockup has no form of any kind. Built from the
 * existing tokens so it reads as part of the system: the same pill radius as
 * the buttons, the same hairline as the cards, accent on focus, wine for
 * errors (both are already in the palette).
 *
 * Field NAMES mirror the live form exactly so saved submissions and any mail
 * filtering keyed to them keep working. See inc/ notes and BUILD-NOTES.md.
 *
 * Loaded after the section files so it can override without !important.
 */

.cform { margin-top: var(--space-md); }

.cform__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
}
.cform__grid--tail { margin-top: var(--space-sm); grid-template-columns: 1fr; }
.cform__field { margin: 0; }
.cform__field--wide { grid-column: 1 / -1; }

/* CF7 wraps every control in <span class="wpcf7-form-control-wrap">, which is
 * inline by default and collapses the field to its content width. */
.cform .wpcf7-form-control-wrap { display: block; }

.cform input[type="text"],
.cform input[type="email"],
.cform input[type="tel"],
.cform textarea {
  width: 100%;
  min-height: var(--btn-h);
  padding: 0.7em 1em;
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
/* A pill is wrong for a multi-line box — the first and last lines of text
 * would sit inside the curve. */
.cform textarea {
  border-radius: var(--radius-core);
  min-height: 8rem;
  resize: vertical;
}
.cform input::placeholder,
.cform textarea::placeholder { color: var(--color-text-mut); opacity: 1; }

.cform input:focus-visible,
.cform textarea:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgb(0 85 116 / 0.15);
}

/* -- Area of Interest --------------------------------------------------- */
.cform__interests {
  margin: var(--space-md) 0 0;
  padding: var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-core);
  background: var(--color-surface);
}
.cform__legend {
  padding: 0 var(--space-2xs);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: var(--fw-bold);
}
.cform__checks { margin-top: var(--space-2xs); }

/* CF7 emits the whole group as one <span class="wpcf7-checkbox"> of inline
 * <span class="wpcf7-list-item">. Made a grid so twelve long labels do not
 * become twelve ragged inline runs. */
.cform .wpcf7-checkbox {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-3xs) var(--space-sm);
}
.cform .wpcf7-list-item { margin: 0; }
.cform .wpcf7-list-item label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6em;
  align-items: start;
  padding: 0.35em 0;
  cursor: pointer;
  line-height: var(--leading-snug);
}
.cform input[type="checkbox"] {
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.15em;
  accent-color: var(--color-accent);
  cursor: pointer;
}

/* -- Submit -------------------------------------------------------------- */
.cform__actions { margin: var(--space-md) 0 0; display: flex; align-items: center; gap: var(--space-sm); }
.cform input[type="submit"] { border: 0; cursor: pointer; }

/* CF7's inline spinner is display:none until submit, but it still occupies a
 * margin, which shunts the button left by 24px on load. */
.cform .wpcf7-spinner { margin: 0; }

/* -- Validation ---------------------------------------------------------- */
.cform .wpcf7-not-valid { border-color: var(--color-primary); }
.cform .wpcf7-not-valid-tip {
  display: block;
  margin-top: 0.35em;
  padding-inline: 1em;
  color: var(--color-primary);
  font-size: var(--step--1);
}
.wpcf7-response-output {
  margin: var(--space-sm) 0 0;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-core);
  font-size: var(--step-0);
}
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output { border-color: var(--color-primary); }
.wpcf7 form.sent .wpcf7-response-output { border-color: var(--color-accent); }

@media (max-width: 768px) {
  .cform__grid { grid-template-columns: 1fr; }
}
