/* ============================================================================
   Floom — get in touch (the home page's last section)
   ----------------------------------------------------------------------------
   A demo request: the head, then the form, set on the 12-column grid. The
   form is a subgrid of the page's own columns, so a half-width field is three
   page columns and both halves start on column edges the rest of the page
   uses:

     ≥1024   head over columns 3–10, form over 4–9 (each half three columns)
     720–1023 head and form over 2–11 (each half five columns)
     <720    everything over all twelve, one field to a row

   floom-request.js validates, posts to the API and swaps the form for its
   confirmation. Errors are said in words beside the field; colour only
   reinforces them (the palette's orange is under 4.5:1 for small text, so the
   message itself is ink, marked with the orange square).
   ========================================================================== */

.rq{
  position: relative;
  background: var(--ap-cream);
  padding: var(--fl-pad-section) 0;
}
.rq-grid{ row-gap: 0; }

/* ── the head ──────────────────────────────────────────────────────────── */
.rq-head{
  grid-column: 3 / span 8;
  display: grid;
  text-align: center;
  margin-bottom: var(--fl-gap-head);
}
.rq-head .ap-eyebrow{ margin: 0 0 var(--fl-gap-eyebrow); }
.rq-head h2{
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fl-head-size);
  font-weight: var(--fl-head-weight);
  letter-spacing: var(--fl-head-track);
  line-height: var(--fl-head-lead);
  text-transform: uppercase;
  color: var(--black);
  text-wrap: balance;
}
.rq-stand{
  margin: var(--fl-gap-stand) 0 0;
  font-family: var(--font);
  font-size: var(--fl-t-lede);
  font-weight: 450;
  line-height: 1.3;
  color: var(--text-secondary);
  text-wrap: balance;
}

/* ── the form ──────────────────────────────────────────────────────────── */
.rq-form,
.rq-done{
  grid-column: 4 / span 6;
}
.rq-form[hidden]{ display: none; }
.rq-form{
  display: grid;
  grid-template-columns: subgrid;
  row-gap: var(--sp-6);
  margin: 0;
}
.rq-f{
  grid-column: span 3;
  display: grid;
  align-content: start;
  gap: var(--sp-2);
  min-width: 0;
}
.rq-f.is-full,
.rq-terms,
.rq-send,
.rq-alert{ grid-column: 1 / -1; }

.rq-f > label{
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--black);
}
.rq-f > label .rq-req{ color: var(--text-secondary); font-weight: 450; }

/* A field: filled, no border at rest, 48 tall (the HIG's 44 plus the grid).
   Scoped to the form so it outranks the theme's input[type=…] defaults. */
.rq-form .rq-in{
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 var(--sp-4);
  border: 1px solid transparent;
  border-radius: 8px;
  background: color-mix(in srgb, var(--black) 4.5%, transparent);
  box-shadow: none;
  font-family: var(--font);
  font-size: 15.79px;
  font-weight: 450;
  line-height: 1.3;
  color: var(--black);
  transition: background-color .2s ease, border-color .2s ease;
  -webkit-appearance: none;
          appearance: none;
}
.rq-form .rq-in::placeholder{ color: var(--text-secondary); opacity: 1; }
.rq-form .rq-in:hover{ background: color-mix(in srgb, var(--black) 6.5%, transparent); }
.rq-form .rq-in:focus{
  outline: none;
  border-color: var(--ap-orange);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ap-orange) 18%, transparent);
}
.rq-form .rq-in[aria-invalid="true"]{ border-color: var(--ap-orange); }

/* A phone's keyboard zooms the page into any field set under 16px; the next
   step up the ladder stops it. */
@media (hover: none) and (pointer: coarse){
  .rq-form .rq-in{ font-size: 17.81px; }
}

/* The selects: the native control, its arrow drawn in the field's own ink. */
.rq-sel{ position: relative; }
/* Scoped like the field so its room for the arrow outranks the field's own
   padding (unscoped, the field's 16 won and long text ran under the arrow).
   Text longer than the field ends in an ellipsis rather than a cut letter. */
.rq-form .rq-in{ text-overflow: ellipsis; }
.rq-form .rq-sel select{ padding-right: var(--sp-12); cursor: pointer; }
.rq-sel select:invalid{ color: var(--text-secondary); }   /* the "Select …" prompt reads as a placeholder */
.rq-sel option{ color: var(--black); }
.rq-sel svg{
  position: absolute;
  right: var(--sp-4);
  top: 50%;
  width: 16px; height: 16px;
  margin-top: -8px;
  color: var(--text-secondary);
  pointer-events: none;
}

/* The message under a field that needs another look. */
.rq-err{
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin: 0;
  font-family: var(--font);
  font-size: 12.41px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--black);
}
/* Centred on the first line, so a message that wraps in half a phone keeps
   its mark beside its first words: half the line box, less half the mark. */
.rq-err::before{
  content: "";
  flex: none;
  margin-top: calc(.65em - 3px);
  width: 6px; height: 6px;
  border-radius: 1px;
  background: var(--ap-orange);
}
.rq-err[hidden]{ display: none; }

/* The trap for form-filling bots: off screen, out of the tab order, unread. */
.rq-hp{
  position: absolute;
  left: -10000px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.rq-terms{
  margin: var(--sp-2) 0 0;
  font-family: var(--font);
  font-size: 12.41px;
  font-weight: 450;
  line-height: 1.3;
  color: var(--text-secondary);
}
.rq-terms a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rq-terms a:hover{ color: var(--black); }

/* The site's own primary button, the width of the form. */
.rq-send{
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  color: #FFFFFF;
  cursor: pointer;
  font-family: var(--font);
}
.rq-send:disabled{ cursor: progress; opacity: .72; }

/* A failure the whole form shares (the network, the server, too many tries). */
.rq-alert{
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ap-orange) 9%, transparent);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 450;
  line-height: 1.3;
  color: var(--black);
}
.rq-alert[hidden]{ display: none; }
.rq-alert a{ color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--ap-orange); text-underline-offset: 2px; }

/* ── sent ──────────────────────────────────────────────────────────────── */
.rq-done{
  display: grid;
  justify-items: center;
  gap: var(--sp-4);
  padding: var(--sp-12) var(--sp-8);
  border-radius: 16px;
  background: #FFFFFF;
  border: 1px solid color-mix(in srgb, var(--ap-ink) 10%, transparent);
  text-align: center;
}
.rq-done[hidden]{ display: none; }
.rq-done-mark{
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ap-orange) 11%, transparent);
  color: var(--ap-orange);
}
.rq-done-mark svg{ width: 20px; height: 20px; }
.rq-done h3{
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fl-t-title3);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--black);
}
.rq-done p{
  margin: 0;
  max-width: 40ch;
  font-family: var(--font);
  font-size: 15.79px;
  font-weight: 450;
  line-height: 1.3;
  color: var(--text-secondary);
}
.rq-done p b{ color: var(--black); font-weight: 600; }

/* ── narrower ──────────────────────────────────────────────────────────── */
@media (max-width: 1023.98px){
  .rq-head{ grid-column: 2 / span 10; }
  .rq-form, .rq-done{ grid-column: 2 / span 10; }
  .rq-f{ grid-column: span 5; }
}
@media (max-width: 719.98px){
  .rq-head{ grid-column: 1 / -1; }
  .rq-form, .rq-done{ grid-column: 1 / -1; }
  /* The pairs stay pairs on a phone (first and last name, email and phone,
     company and website, size and industry); only the title runs across. */
  .rq-f{ grid-column: span 6; }
  /* Half a phone is 156–171 wide: the fields' insides tighten to 12, and the
     select's arrow sits 12 in with 8 before it (12 + 16 + 8 = 36). */
  .rq-form .rq-in{ padding: 0 var(--sp-3); }
  .rq-form .rq-sel select{ padding-right: calc(var(--sp-8) + var(--sp-1)); }
  .rq-sel svg{ right: var(--sp-3); }
  .rq-done{ padding: var(--sp-8) var(--sp-6); }
}

@media (prefers-reduced-motion: reduce){
  .rq-form .rq-in{ transition: none; }
}
