/* =============================================================================
   Forms (Quote + Careers) — shared styles
   -----------------------------------------------------------------------------
   Owned by the Forms agent (Wave 2, task 9). Loaded by both
   /request-a-quote and /careers, after tokens/base/components.css.

   Contains everything the two pages share: page hero, cream form-band layout
   with the gold divider and "What to expect" rail, validation states, the
   error summary, the post-submit success panel, the honeypot, and the submit
   row. Page-specific rules live in forms-quote.css / forms-careers.css.

   Scope: only names defined here (.forms-hero, .forms-*, plus the
   .quote-form / .careers-form section hooks) — no collision with other pages.
   Field chrome (.field, .btn, .card) comes from components.css.
   ============================================================================= */

/* --- Page hero ----------------------------------------------------------------- */
/* Copy left, image right (Elevate 6 / Elevate 7). Both export crops are
   686x372 native — the media box reserves that exact ratio so the photo is
   never cropped on desktop; smaller viewports shift to 4/3 with a cap. */
.forms-hero {
  padding-block: clamp(var(--space-7), 6vw, var(--space-9));
}

.forms-hero__media {
  aspect-ratio: 686 / 372;
  background-color: var(--color-cream-deep);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.forms-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 56.25em) {
  .forms-hero__media {
    aspect-ratio: 4 / 3;
    max-height: 20rem;
  }
}

/* --- Form band layout ------------------------------------------------------------ */
/* Cream section: form column + gold hairline divider + "What to expect" rail.
   Columns top-align (the base .split centres, which doesn't match the export). */
.quote-form__layout,
.careers-form__layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(var(--space-6), 4vw, var(--space-8));
  align-items: start;
}

.quote-form__rail,
.careers-form__rail {
  border-left: 1px solid var(--color-gold);
  padding-left: clamp(var(--space-5), 3vw, var(--space-7));
}

.quote-form__rail h2,
.careers-form__rail h2 {
  margin-bottom: var(--space-5);
}

@media (max-width: 56.25em) {
  .quote-form__layout,
  .careers-form__layout {
    grid-template-columns: 1fr;
  }

  .quote-form__rail,
  .careers-form__rail {
    border-left: 0;
    border-top: 1px solid var(--color-gold);
    padding-left: 0;
    padding-top: var(--space-5);
  }
}

/* --- Validation states ------------------------------------------------------------ */
/* Server render marks .field--error on the wrapper + fills .field__error spans.
   Client (jquery.validate.unobtrusive) adds .input-validation-error to the
   control and .field-validation-error to the span — style both paths alike. */
.field--error .field__input,
.field--error .field__textarea,
.field--error .field__select,
.field__input.input-validation-error,
.field__textarea.input-validation-error,
.field__select.input-validation-error {
  border-color: #B3423A;
}

.field--error .field__input:focus,
.field--error .field__textarea:focus,
.field--error .field__select:focus,
.field__input.input-validation-error:focus,
.field__textarea.input-validation-error:focus,
.field__select.input-validation-error:focus {
  box-shadow: 0 0 0 3px rgba(179, 66, 58, 0.35);
}

/* Error spans (server + client) hide entirely while empty — the tag helper
   leaves an empty span behind on valid fields. */
.field__error:empty {
  display: none;
}

.field__hint {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

.field__file-name {
  margin: 0;
  min-height: 1.3em;
  font-size: var(--text-small);
  color: var(--color-navy);
}

/* --- Error summary ------------------------------------------------------------------ */
/* role="alert" + links to each invalid field (accessible error-summary pattern).
   Server renders the links after a rejected POST; forms.js rebuilds them live. */
.form-summary {
  background-color: #FBF1EF;
  border: 1px solid rgba(179, 66, 58, 0.45);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}

.form-summary[hidden] {
  display: none;
}

.form-summary__title {
  margin: 0 0 var(--space-2);
  color: #B3423A;
  font-weight: var(--fw-semibold);
}

.form-summary__list {
  margin: 0;
  padding-left: 1.25em;
}

.form-summary__list a {
  color: #B3423A;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.form-summary__list a:hover,
.form-summary__list a:focus-visible {
  color: #8F352F;
}

/* --- Success panel (post-submit, PRG) ------------------------------------------------ */
.form-success {
  background-color: var(--color-white);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-5), 3vw, var(--space-7));
  box-shadow: var(--shadow-card);
}

.form-success__icon {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: var(--space-3);
  background-color: var(--color-gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m8 12.5 2.5 2.5L16 9.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m8 12.5 2.5 2.5L16 9.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.form-success h2 {
  font-size: var(--text-h3);
  margin-bottom: var(--space-2);
}

.form-success p:last-child {
  color: var(--color-ink-muted);
  font-size: var(--text-small);
}

/* --- Honeypot (spam trap) ------------------------------------------------------------ */
/* CSS-hidden "Company" field. Humans never see it; bots that autofill it get
   their submission silently discarded server-side (Models/Forms/FormSpam.cs).
   tabindex="-1" keeps it out of the tab order so it never traps focus. */
.form-honeypot {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Submit row ---------------------------------------------------------------------- */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-2);
}

.form-actions__note {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}
