/* ==========================================================================
   SightIQ — forms
   --------------------------------------------------------------------------
   The card a form sits in, and the fields inside it. Lifted out of the
   contact-sales page when the careers page grew a second form: two copies of
   a text input is how two pages stop looking like one site.

   The states a form can be in -- sending, sent, failed -- live here too, so
   a page that posts somewhere and a page that opens a mail client still
   answer a reader the same way.

   What is NOT here: anything about where a form posts, or what it asks.
   That belongs to the page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   The section a form sits in
   --------------------------------------------------------------------------
   Promise on the left, fields on the right. The left column sticks on a
   desktop so what happens after the button stays beside the button.
   -------------------------------------------------------------------------- */
.talk__grid { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) {
  .talk__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 4rem; }
  .talk__copy { position: sticky; top: 7rem; }
}

.talk__points { margin-top: 1.75rem; display: grid; gap: .625rem; }
.talk__points li {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .9375rem; color: var(--neutral-600);
}
.talk__points .icon { flex: none; margin-top: .15rem; color: var(--primary-600); }
.talk__points a { color: var(--primary-700); font-weight: 600; }

.applyform {
  display: grid; gap: 1rem;
  padding: 1.75rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(16, 24, 40, .05));
}
.applyform__row { display: grid; gap: 1rem; }
@media (min-width: 560px) {
  .applyform__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.applyform__hint {
  margin-bottom: .25rem;
  font-size: .8125rem; line-height: 1.5; color: var(--neutral-500);
}
.applyform__send { margin-top: .25rem; justify-self: start; }
.applyform__note { font-size: .75rem; color: var(--neutral-500); }

.field { display: grid; gap: .3125rem; }
.field__label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  font-size: .875rem; font-weight: 700; color: var(--neutral-900);
}
/* An optional field says so in its own label, rather than every other
   field carrying a "required" mark. */
.field__opt { font-size: .75rem; font-weight: 600; color: var(--neutral-400); }
.field__input {
  width: 100%;
  padding: .75rem .875rem;
  border: 1px solid var(--neutral-300); border-radius: var(--r-sm);
  background: #fff;
  font: inherit; font-size: .9375rem; color: var(--neutral-900);
}
.field__input::placeholder { color: var(--neutral-400); }
.field__input:hover { border-color: var(--neutral-400); }
.field__input:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(0, 122, 112, .16);
}
.field__textarea { resize: vertical; min-height: 7rem; }
/* The select as it stands with scripting off: our border and our chevron,
   drawn here so it sits at the same height as the inputs. */
.field__select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--neutral-500) 50%),
                    linear-gradient(135deg, var(--neutral-500) 50%, transparent 50%);
  background-position: calc(100% - 1.125rem) 1.2rem, calc(100% - .8125rem) 1.2rem;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* --------------------------------------------------------------------------
   What happens after the button
   --------------------------------------------------------------------------
   One line under the form, in one of three states. It is a live region, so
   a screen reader hears the answer rather than only seeing it, and it is
   never empty of meaning: a form that goes quiet after a click reads as
   broken whether or not it worked.
   -------------------------------------------------------------------------- */
.formstate {
  display: none;
  align-items: flex-start; gap: .5rem;
  padding: .75rem .875rem;
  border-radius: var(--r-md, 10px);
  font-size: .875rem; line-height: 1.5;
}
.formstate[data-state] { display: flex; }
.formstate .icon { flex: none; margin-top: .125rem; }

.formstate[data-state="sent"] {
  background: var(--primary-50, #E7F4F1);
  color: var(--primary-800);
  border: 1px solid var(--primary-200, #A8DCD3);
}
.formstate[data-state="error"],
.formstate[data-state="offline"] {
  background: #FEF3F2;
  color: #912018;
  border: 1px solid #FDA29B;
}
.formstate a { color: inherit; font-weight: 700; text-decoration: underline; }

/* The button while a request is in flight. Disabled rather than hidden, so
   the form does not resize under the cursor that just clicked it. */
.applyform[data-busy="true"] .applyform__send { opacity: .6; pointer-events: none; }

@media (max-width: 559px) {
  .applyform { padding: 1.25rem; }
}
