/* Lane f-forms: the Contact Form 7 forms on Contact Us, Learn More, and the three service pages, in the look of the
   "Request a showing" form (z-showing.css): labels above fields, 48 px fields, choices as tiles, a navy Send button
   that takes the whole width on phones, and a panel in place of the form once it's sent. Every edge that has to show
   is navy, never the pale rule or wash, so it shows on every screen. f-forms.php marks the forms with .gl-f, and the
   long selectors outweigh b-services.css, which styles the same forms more generally. */

#main .wpcf7 .wpcf7-form.gl-f {
  --gl-f-alert: #b20000;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  max-width: 720px;
  margin: 0;
  color: var(--gl-ink);
  font-family: var(--gl-sans);
}
#main .wpcf7 .wpcf7-form.gl-f > * { grid-column: 1 / -1; min-width: 0; margin: 0; }
#main .wpcf7 .wpcf7-form.gl-f > .hidden-fields-container { display: none; }
#main .wpcf7 .wpcf7-form.gl-f[hidden] { display: none; }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
/* b-services.js marks required fields "(required)". These forms mark the optional ones instead, as z-showing does. */
#main .wpcf7 .wpcf7-form.gl-f .gl-b-req { display: none; }

/* Groups: a heading, then its fields, with space and one thin rule between groups. */
#main .wpcf7 .wpcf7-form.gl-f fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
#main .wpcf7 .wpcf7-form.gl-f fieldset > legend { display: block; float: left; width: 100%; margin: 0 0 10px; padding: 0; border: 0; }
#main .wpcf7 .wpcf7-form.gl-f fieldset > legend + * { clear: both; }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-set { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-set > legend.gl-f-set-title {
  margin: 0 0 2px;
  color: var(--gl-navy);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}
#main .wpcf7 .wpcf7-form.gl-f .gl-f-set + .gl-f-set { padding-top: 24px; border-top: 1px solid var(--gl-rule); }

/* Labels sit above their fields. */
#main .wpcf7 .wpcf7-form.gl-f .gl-f-field { display: flex; flex-direction: column; min-width: 0; margin: 0; }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-field > label,
#main .wpcf7 .wpcf7-form.gl-f .gl-f-group > legend {
  display: block;
  margin: 0 0 6px;
  color: var(--gl-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}
#main .wpcf7 .wpcf7-form.gl-f .gl-f-group > legend { margin-bottom: 8px; }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-opt { color: var(--gl-muted); font-weight: 400; }
#main .wpcf7 .wpcf7-form.gl-f .wpcf7-form-control-wrap { display: block; margin: 0; }

/* Fields: 48 px tall, 17 px text, a navy edge. Focus adds a second pixel and the site's focus ring. */
#main .wpcf7 .wpcf7-form.gl-f :is(input[type="text"], input[type="email"], input[type="tel"], textarea) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--gl-navy);
  border-radius: var(--gl-radius);
  background: #fff;
  box-shadow: none;
  color: var(--gl-ink);
  font-family: var(--gl-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.3;
  transition: box-shadow var(--gl-fast);
}
#main .wpcf7 .wpcf7-form.gl-f textarea { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
#main .wpcf7 .wpcf7-form.gl-f :is(input[type="text"], input[type="email"], input[type="tel"], textarea):focus {
  border-color: var(--gl-navy);
  box-shadow: inset 0 0 0 1px var(--gl-navy);
  outline: 3px solid #5b7bd5;
  outline-offset: 1px;
}

/* Two short fields side by side from 600 px. A pair with one field keeps it half wide, as a short field should be. */
#main .wpcf7 .wpcf7-form.gl-f .gl-f-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 16px; }
/* When one label wraps to two lines, the shorter one grows with it, so the two fields still line up. */
#main .wpcf7 .wpcf7-form.gl-f .gl-f-pair > .gl-f-field > label { flex: 1 0 auto; }

/* Choices as tiles: the box covers its tile, unseen, so a tap anywhere picks it. Chosen: a 2 px navy edge and a
   white check in a navy square. */
#main .wpcf7 .wpcf7-form.gl-f .wpcf7-checkbox.gl-f-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
#main .wpcf7 .wpcf7-form.gl-f .wpcf7-checkbox.gl-f-tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles:not(.gl-f-tiles--3) > .wpcf7-list-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles > .wpcf7-list-item { display: block; min-width: 0; margin: 0; }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles .wpcf7-list-item label {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 56px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--gl-navy);
  border-radius: var(--gl-radius);
  background: #fff;
  color: var(--gl-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition: box-shadow var(--gl-fast), transform 160ms cubic-bezier(.23, 1, .32, 1);
}
#main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles .wpcf7-list-item label:active { transform: scale(.98); }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles .wpcf7-list-item input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
#main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles .wpcf7-list-item-label { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles .wpcf7-list-item-label::before {
  content: "";
  flex: none;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border: 1px solid var(--gl-navy);
  border-radius: var(--gl-radius);
  background: #fff no-repeat center / 16px 16px;
  transition: background-color var(--gl-fast);
}
#main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles input:checked + .wpcf7-list-item-label::before {
  background-color: var(--gl-navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
#main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles .wpcf7-list-item label:has(> input:checked) { box-shadow: inset 0 0 0 1px var(--gl-navy); }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles .wpcf7-list-item label:has(> input:focus-visible) { outline: 3px solid #5b7bd5; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  #main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles .wpcf7-list-item label:hover { box-shadow: inset 0 0 0 1px var(--gl-navy); }
}

/* A problem with a field: the alert red, which reads at 7:1 on white, with a 2 px edge. */
#main .wpcf7 .wpcf7-form.gl-f .wpcf7-not-valid { border-color: var(--gl-f-alert) !important; box-shadow: inset 0 0 0 1px var(--gl-f-alert); }
#main .wpcf7 .wpcf7-form.gl-f .wpcf7-not-valid-tip {
  position: static;
  display: block;
  margin: 6px 0 0;
  padding: 0;
  background: none;
  color: var(--gl-f-alert);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

/* Send: navy, 52 px tall; the whole width on phones. */
#main .wpcf7 .wpcf7-form.gl-f .gl-f-actions { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 4px; }
#main .wpcf7 .wpcf7-form.gl-f input.wpcf7-submit.gl-f-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  height: 52px;
  min-height: 52px;
  margin: 0 !important;
  padding: 0 32px !important;
  border: 0;
  border-radius: var(--gl-radius);
  background: var(--gl-navy);
  box-shadow: none;
  color: #fff;
  font-family: var(--gl-sans);
  font-size: 17px !important;
  font-weight: 600;
  line-height: 52px;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background-color var(--gl-fast), transform var(--gl-fast);
}
@media (hover: hover) { #main .wpcf7 .wpcf7-form.gl-f input.wpcf7-submit.gl-f-send:hover { background: var(--gl-navy-hover); } }
#main .wpcf7 .wpcf7-form.gl-f input.wpcf7-submit.gl-f-send:active { transform: scale(.98); }
#main .wpcf7 .wpcf7-form.gl-f input.wpcf7-submit.gl-f-send:focus-visible { outline: 3px solid #5b7bd5; outline-offset: 2px; }
#main .wpcf7 .wpcf7-form.gl-f.submitting input.wpcf7-submit.gl-f-send { background: var(--gl-navy-deep); cursor: progress; }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-actions .wpcf7-spinner { margin: 0; }
#main .wpcf7 .wpcf7-form.gl-f .gl-f-foot { flex: 1 1 100%; margin: 0; color: var(--gl-muted); font-size: 15px; line-height: 1.45; }
/* Contact Us says the same just above its form. */
#main .gl-bc-message .wpcf7 .wpcf7-form.gl-f .gl-f-foot { display: none; }

/* Contact Form 7's line after a send that didn't go: a red edge, and the phone number as a link (f-forms.js). */
#main .wpcf7 .wpcf7-form.gl-f .wpcf7-response-output { margin: 0; padding: 12px 14px; border: 2px solid var(--gl-f-alert); border-radius: var(--gl-radius); background: #fff; color: var(--gl-ink); font-size: 16px; line-height: 1.45; }
#main .wpcf7 .wpcf7-form.gl-f .wpcf7-response-output:empty,
#main .wpcf7 .wpcf7-form.gl-f.init .wpcf7-response-output { display: none; }
#main .wpcf7 .wpcf7-form.gl-f.sent .wpcf7-response-output { border-color: var(--gl-navy); }
#main .wpcf7 .wpcf7-form.gl-f .wpcf7-response-output a { color: var(--gl-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* After sending: a check in a navy square, the heading, what happens next, and a way to send another. */
#main .wpcf7 .gl-f-done { max-width: 720px; margin: 0; padding: 24px; border: 1px solid var(--gl-navy); border-radius: var(--gl-radius); background: #fff; color: var(--gl-ink); }
#main .wpcf7 .gl-f-done[hidden] { display: none; }
#main .wpcf7 .gl-f-done.is-new { animation: gl-f-in 240ms cubic-bezier(.23, 1, .32, 1) both; }
@keyframes gl-f-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#main .wpcf7 .gl-f-done-head { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 4px 16px; }
#main .wpcf7 .gl-f-done-mark { display: flex; grid-row: 1 / span 2; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--gl-radius); background: var(--gl-navy); color: #fff; }
#main .wpcf7 .gl-f-done-mark svg { width: 26px; height: 26px; }
#main .wpcf7 .gl-f-done h3.gl-f-done-title { margin: 0; padding: 0; color: var(--gl-navy); font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: 0; text-transform: none; outline: none; }
#main .wpcf7 .gl-f-done-head p { grid-column: 2; margin: 0; font-size: 17px; line-height: 1.45; }
#main .wpcf7 .gl-f-done-more { margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--gl-rule); }
#main .wpcf7 .gl-f-done-more p { margin: 0 0 4px; font-size: 17px; line-height: 1.5; }
#main .wpcf7 .gl-f-done-more a { display: inline-flex; align-items: center; min-height: 44px; color: var(--gl-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
#main .wpcf7 .gl-f-done button.gl-f-again {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 12px 0 0;
  padding: 0 24px;
  border: 1px solid var(--gl-navy);
  border-radius: var(--gl-radius);
  background: #fff;
  box-shadow: none;
  color: var(--gl-navy);
  font-family: var(--gl-sans);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
@media (hover: hover) { #main .wpcf7 .gl-f-done button.gl-f-again:hover { background: var(--gl-navy); color: #fff; } }
#main .wpcf7 .gl-f-done button.gl-f-again:focus-visible { outline: 3px solid #5b7bd5; outline-offset: 2px; }

@media (max-width: 599px) {
  #main .wpcf7 .wpcf7-form.gl-f { gap: 18px; }
  /* Phone and email each take the full width; short fields such as Township and Section keep sharing a row, which
     keeps the long forms shorter on a phone. */
  #main .wpcf7 .wpcf7-form.gl-f .gl-f-pair { gap: 18px 12px; }
  #main .wpcf7 .wpcf7-form.gl-f .gl-f-pair:has(input[type="email"]) { grid-template-columns: minmax(0, 1fr); }
  #main .wpcf7 .wpcf7-form.gl-f .gl-f-set + .gl-f-set { padding-top: 20px; }
  /* Choice labels read at 16 px on phones too, the least the site sets for text people act on (CTA review, 11/4). */
  #main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles .wpcf7-list-item label { padding: 8px 10px; font-size: 16px; }
  #main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles .wpcf7-list-item-label { gap: 10px; }
  #main .wpcf7 .wpcf7-form.gl-f .wpcf7-checkbox.gl-f-tiles { gap: 8px; }
  #main .wpcf7 .wpcf7-form.gl-f input.wpcf7-submit.gl-f-send { width: 100%; min-width: 0; }
  #main .wpcf7 .wpcf7-form.gl-f .gl-f-actions .wpcf7-spinner { position: absolute; top: 14px; right: 14px; }
  #main .wpcf7 .gl-f-done { padding: 18px 16px; }
  #main .wpcf7 .gl-f-done button.gl-f-again { width: 100%; }
}
@media (max-width: 359px) {
  #main .wpcf7 .wpcf7-form.gl-f .gl-f-pair { grid-template-columns: minmax(0, 1fr); }
}
/* Three tiles in a row leave about 100 px each on the narrowest phones, so the check goes above the word. */
@media (max-width: 400px) {
  #main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles--3 .wpcf7-list-item label { justify-content: center; min-height: 72px; padding: 8px 4px; text-align: center; }
  #main .wpcf7 .wpcf7-form.gl-f .gl-f-tiles--3 .wpcf7-list-item-label { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  #main .wpcf7 .gl-f-done.is-new { animation: gl-f-fade 160ms ease-out both !important; }
  @keyframes gl-f-fade { from { opacity: 0; } to { opacity: 1; } }
  #main .wpcf7 .wpcf7-form.gl-f :is(label, input):active { transform: none !important; }
}
