/* Forms: the form card, fields, choice lists, the security check, error messages
   and the thank-you message. Load after site.css on pages with a form; the
   inquiry-form component adds the behavior. */

inquiry-form {
  display: block;
}

.form-card {
  padding: 1.375rem 1rem 1.5rem;
  background: var(--cream-50);
  border: 1px solid var(--line-strong);
}

.form-group,
.field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-group + .form-group {
  margin-top: 2.125rem;
}

/* Legends float so they lay out like any other block. */
.form-group__title,
legend.field__label {
  float: left;
  width: 100%;
  padding: 0;
}

/* Group title with a rule running to the edge. */
.form-group__title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green-900);
}

.form-group__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.form-grid {
  display: grid;
  clear: both;
  gap: 1.25rem;
}

.field__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-600);
}

.field__required {
  color: var(--amber-700);
}

.field__optional {
  font-size: 0.71875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

.field__input {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.6875rem 0.875rem;
  background: #fff;
  border: 1px solid var(--line-field);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-900);
}

.field__input::placeholder {
  color: var(--ink-600);
  opacity: 1;
}

.field__input:focus-visible {
  border-color: var(--green-900);
  outline: 2px solid var(--amber-700);
  outline-offset: 1px;
}

textarea.field__input {
  min-height: 7.375rem;
  resize: vertical;
}

.field__input[aria-invalid="true"] {
  border-color: var(--red-600);
  box-shadow: inset 0 0 0 1px var(--red-600);
}

.field__chips {
  display: flex;
  flex-wrap: wrap;
  clear: both;
  gap: 0.625rem;
}

.field__radios {
  display: grid;
  clear: both;
  gap: 0.75rem 1.5rem;
}

.radio {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.96875rem;
  line-height: 1.4;
  cursor: pointer;
}

.radio input {
  flex: none;
  width: 1.0625rem;
  height: 1.0625rem;
  margin: 0.125rem 0 0;
  background: #fff;
  border: 1.5px solid var(--line-field);
  border-radius: 50%;
  cursor: pointer;
  appearance: none;
}

.radio input:checked {
  border: 5px solid var(--green-900);
}

.radio input:focus-visible {
  outline: 2px solid var(--amber-700);
  outline-offset: 2px;
}

.radio strong {
  font-weight: 600;
}

.radio__hint {
  color: var(--ink-600);
}

.field__error,
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--red-700);
}

.field__error {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.field__error::before,
.form-alert::before {
  content: "!";
  content: "!" / "";
  display: grid;
  place-items: center;
  flex: none;
  width: 0.9375rem;
  height: 0.9375rem;
  margin-top: 0.125rem;
  background: var(--red-600);
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.form-note {
  display: flex;
  gap: 0.875rem;
  margin-top: 1.875rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.90625rem;
  line-height: 1.6;
  color: var(--ink-600);
}

.form-note::before {
  content: "";
  flex: none;
  align-self: flex-start;
  width: 0.6875rem;
  aspect-ratio: 1.1547;
  margin-top: calc(0.8em - 0.3rem);
  background: var(--gold-500);
  clip-path: var(--hexagon);
}

.form-alert {
  gap: 0.75rem;
  margin-top: 1.375rem;
  padding: 0.875rem 1rem;
  background: color-mix(in srgb, var(--red-600) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--red-600) 30%, #fff);
  border-left: 3px solid var(--red-600);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.form-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.375rem;
  margin-top: 1.625rem;
}

.form-submit .btn {
  width: 100%;
  padding-inline: 1.875rem;
}

/* The Cloudflare security check is a fixed 300 × 65 frame. Its space is reserved
   so nothing moves when it loads, and on the narrowest phones it may run into
   the card's padding rather than overflow the screen. */
.form-check {
  flex: none;
  width: 18.75rem;
  margin-inline: min(0px, (100% - 18.75rem) / 2);
}

/* The widget's frame sits on a line of text; without line-height: 0 the line adds
   9px under it, and the page shifts when the widget loads. */
.cf-turnstile {
  min-height: 4.0625rem;
  line-height: 0;
}

.cf-turnstile[aria-invalid="true"] {
  outline: 1.5px solid var(--red-600);
}

.form-success {
  padding: 1.875rem 1.375rem 2rem;
  background: var(--cream-50);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--gold-500);
  text-align: center;
}

.form-success:focus {
  outline: none;
}

.form-success::before {
  content: "";
  display: block;
  width: 2.625rem;
  aspect-ratio: 1.1547;
  margin-inline: auto;
  background: var(--gold-500);
  clip-path: var(--hexagon);
}

.form-success :is(h2, h3) {
  margin-top: 1.25rem;
  font-size: 1.625rem;
  line-height: 1.2;
}

.form-success p {
  margin-top: 0.75rem;
  line-height: 1.6;
  color: var(--ink-700);
}

@media (min-width: 40rem) {
  .form-card {
    padding: 2rem;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.5rem;
  }

  .field--wide {
    grid-column: 1 / -1;
  }

  .form-grid.form-grid--single {
    grid-template-columns: 1fr;
  }

  .field__radios {
    grid-template-columns: 1fr 1fr;
  }

  .form-submit {
    align-items: center;
  }

  .form-submit .btn {
    width: auto;
  }

  .form-success {
    padding: 2.5rem 2rem;
  }
}

@media (min-width: 64rem) {
  .form-card {
    padding: 2.375rem 2.5rem 2.25rem;
  }
}
