/*
 * .site-form — one form of phase 2 in three looks (template-parts/global/site-form.php):
 * --panel (Contact, Figma 18:43273 / 18:50675), --light (FAQ, 18:44319 / 18:51371),
 * --dark (Strategy Session CTA, 18:43072; phones get the same stack as the other forms).
 * Measurements: docs/phase2/analysis/forms-values.md. Fields: field.css; trust line: form-note.css.
 *
 * The fields look the same everywhere (white, 10 px radius, blue 10 % frame); only the grid differs:
 * Contact one column, FAQ and Strategy pairs from 768 px with the wide ones (topic, message) across.
 */

/* .site-form — fields, buttons, trust line: 10 px apart */
.site-form {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
}

/* .site-form__fields — one column; pairs from 768 px in the light and dark looks */
.site-form__fields {
  display: grid;
  gap: 0.625rem;
}

/* .site-form--light .site-form__fields, .site-form--dark .site-form__fields — Full Name | E-mail, First | Last, E-mail | Company */
:is(.site-form--light, .site-form--dark) .site-form__fields {
  /* @media (width >= 48em) :is(.site-form--light, .site-form--dark) .site-form__fields */
  @media (width >= 48em) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* .site-form__field — a grid cell may shrink below its content */
.site-form__field {
  min-width: 0;
}

/* .site-form__field--wide — topic and message across both columns */
.site-form__field--wide {
  grid-column: 1 / -1;
}

/* .site-form .field__input — blue 10 % frame, 1.5 px (the webinar and subscribe forms keep the grey one) */
.site-form .field__input {
  border-width: 1.5px;
  border-color: rgba(26, 121, 191, 0.1);

  /* .site-form .field__input:focus-visible — the frame follows field.css */
  &:focus-visible {
    border-color: var(--nv-blue);
  }

  /* .site-form .field__input[aria-invalid="true"] */
  &[aria-invalid="true"] {
    border-color: #c53030;
  }
}

/* .site-form__actions — buttons one under another, 20 px apart; in a row from 768 px (Strategy: Submit | Readiness Assessment) */
.site-form__actions {
  display: grid;
  gap: 1.25rem;

  /* @media (width >= 48em) .site-form__actions */
  @media (width >= 48em) {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0.625rem;
  }
}

/* .site-form__button — 64 → 74 px, 16 → 20 px, as wide as its cell; a longer label from the admin grows it */
.site-form__button {
  justify-content: center;
  width: 100%;
  min-height: 4rem;
  font-size: 1rem;

  /* @media (width >= 48em) .site-form__button */
  @media (width >= 48em) {
    min-height: 4.625rem;
    font-size: 1.25rem;
  }
}

/* .site-form__note, .contact-form__note — the trust line: navy 70 %, centred, 18 → 16 px, tracking −4 %;
   on phones the rhombs sit on their own lines between the three texts (Figma 18:50675) */
:is(.site-form__note, .contact-form__note) {
  flex-direction: column;
  justify-content: center;
  gap: 0.3125rem;
  color: rgba(19, 33, 50, 0.7);
  text-align: center;
  letter-spacing: -0.04em;

  /* :is(.site-form__note, .contact-form__note) .form-note__item */
  & .form-note__item {
    flex-direction: column;
    gap: 0.3125rem;
    margin-block: 0;
  }

  /* :is(…) .form-note__item:first-child, :last-child — the cap / baseline trim stays only on the first and last
     line: whole line boxes around each rhomb, so it sits midway between the texts (Pavlo, 2026-11-16) */
  & .form-note__item:first-child {
    margin-top: -0.14em;
  }

  & .form-note__item:last-child {
    margin-bottom: -0.14em;
  }

  /* @media (width >= 48em) :is(.site-form__note, .contact-form__note) — one row, 12 px apart */
  @media (width >= 48em) {
    flex-direction: row;
    gap: 0.75rem;

    /* @media (width >= 48em) :is(…) .form-note__item — the trim of form-note.css is back on each item in the row */
    & .form-note__item {
      flex-direction: row;
      gap: 0.75rem;
      margin-block: -0.14em;
    }
  }
}

/* .site-form__note — 20 px more under the buttons than the form's own 10 px (30 on desktop) */
.site-form__note {
  margin-top: 0.625rem;

  /* @media (width >= 48em) .site-form__note */
  @media (width >= 48em) {
    margin-top: 1.25rem;
  }
}

/* .site-form--dark .site-form__note — white on the blue card, 60 px under the buttons on desktop (Figma 18:43072) */
.site-form--dark .site-form__note {
  color: var(--nv-white);

  /* @media (width >= 48em) .site-form--dark .site-form__note */
  @media (width >= 48em) {
    margin-top: 3.125rem;
  }
}

/* .site-form__trap — honeypot, out of sight for people */
.site-form__trap {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* .site-form__captcha — the widget; nothing until the script fills it */
.site-form__captcha:empty {
  display: none;
}

/* .site-form__message — error / success text under the form */
.site-form__message {
  color: var(--nv-navy);
  text-align: center;
}

/* .site-form--dark .field__error — light red on the blue card: 4.72:1 on --nv-blue (the default red is 1.65:1) */
.site-form--dark .field__error {
  color: #ffc2c2;
}

/* .site-form--dark .site-form__message — on the blue card */
.site-form--dark .site-form__message {
  color: var(--nv-white);
}

/* .cta--site-form .cta__subtitle — Strategy Session CTA with the form: 936 px paragraph (the bundle's max-width stays,
   the width is the narrower one), 55 px to the first field on desktop (Figma 18:43072) */
.page-sections .cta--site-form .cta__subtitle {
  width: min(100%, 58.5rem);

  /* @media (width >= 48em) .page-sections .cta--site-form .cta__subtitle */
  @media (width >= 48em) {
    padding-bottom: calc(3.75rem - 0.25em);
  }
}

/* .cta--site-form .cta__form — above the card's wave image (the bundle lifts only the heading and the paragraph), 935 px */
.cta--site-form .cta__form {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 58.4375rem;
}
