/*
 * Firefighter Pfister — contact
 *
 * The form is our own markup rather than an embed, so it can carry the design
 * system properly: Onest labels, Source Serif inputs, ember focus.
 */

.contact {
  width: 100%;
  max-width: var(--layout-container);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

.contact__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-block: 40px;
  text-align: center;
}

@media (min-width: 1000px) {
  .contact__title {
    gap: var(--space-sm);
    padding-block: 88px 56px;
  }
}

.contact__rule {
  width: 48px;
  height: 2px;
  margin: 0;
  border: 0;
  background: var(--accent-solid);
}

@media (min-width: 1000px) {
  .contact__rule {
    width: 64px;
  }
}

.contact__lede {
  max-width: var(--layout-measure);
  margin-inline: auto;
  padding-bottom: var(--space-lg);
  text-align: center;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------- *
 * Form
 * ---------------------------------------------------------------- */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: var(--layout-measure);
  margin-inline: auto;
  padding-bottom: var(--space-xl);
}

@media (min-width: 1000px) {
  .form {
    padding-bottom: 120px;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.field__label {
  font-family: var(--font-display);
  font-size: var(--type-small);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.field__optional {
  font-weight: 400;
  color: var(--text-secondary);
}

/*
 * Border is Smoke/500, not Bone/300. A field boundary is a UI component and
 * needs 3:1 against the page; Bone/300 manages only 1.29:1. Smoke/500 is
 * 5.23:1.
 */
.field__input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: 1.5;
}

textarea.field__input {
  min-height: 180px;
  resize: vertical;
}

.field__input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.field__input:hover {
  border-color: var(--text-primary);
}

/* :focus-visible in base.css supplies the ember ring; this keeps the border
   from fighting it. */
.field__input:focus {
  border-color: var(--text-primary);
  outline: 2px solid var(--accent-solid);
  outline-offset: 2px;
}

/*
 * Invalid state never depends on colour alone — the message carries the
 * meaning, and ember on Bone is only 2.07:1 anyway, so it could not be the
 * signal even if we wanted it to be.
 */
.field__input[aria-invalid="true"] {
  border-width: 2px;
  border-color: var(--text-primary);
}

.field__error {
  display: none;
  font-family: var(--font-display);
  font-size: var(--type-small);
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
}

.field__error::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--accent-solid);
  vertical-align: 1px;
}

.field[data-invalid="true"] .field__error {
  display: block;
}

/* Honeypot — off-screen for pointers and screen readers alike. A bot fills it;
   a person never sees it. */
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__submit {
  align-self: flex-start;
  padding: 17px 46px;
  border: 0;
  border-radius: var(--radius-sm);
  /* Ash on Ember is 8.61:1. Bone on Ember would be 2.07:1 — never that way. */
  background: var(--accent-solid);
  color: var(--ash-900);
  font-family: var(--font-display);
  font-size: var(--type-small);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.form__submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

.form__submit:disabled {
  background: var(--border-strong);
  cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
  .form__submit,
  .field__input {
    transition: none;
  }
}

/* Status region — announced, so the outcome is not conveyed visually alone. */
.form__status {
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--ember-100);
  color: var(--ash-900);
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: var(--lh-body);
}

.form__status:empty {
  display: none;
}

.form__status a {
  color: inherit;
}

.contact__sent {
  max-width: var(--layout-measure);
  margin-inline: auto;
  padding: var(--space-lg);
  border-radius: var(--radius-sm);
  background: var(--ember-100);
  color: var(--ash-900);
  text-align: center;
}

.contact__sent h2 {
  font-family: var(--font-display);
  font-size: var(--type-h4);
  font-weight: 700;
  line-height: var(--lh-h4);
  margin-bottom: var(--space-xs);
}
