/* Contact form. Tokens come from tokens.css, loaded site-wide. */

.ipp-contact { max-width: 720px; }
.ipp-contact * { box-sizing: border-box; }

.ipp-contact .row.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
@media (max-width: 600px) { .ipp-contact .row.two { grid-template-columns: 1fr; gap: 0; } }

.ipp-contact .field { margin: 0 0 var(--s-5); }

/* The label text lives in the placeholder. The label element stays in the
   markup, visually hidden, so screen readers and autofill still name the field:
   a placeholder alone is not an accessible label, and it disappears on typing. */
.ipp-contact .ipp-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ipp-contact ::placeholder {
  color: var(--ink-muted);
  opacity: 1;
}

.ipp-contact input[type="text"],
.ipp-contact input[type="email"],
.ipp-contact textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: var(--fs-16);
  line-height: 1.45;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.ipp-contact textarea { resize: vertical; min-height: 160px; }

.ipp-contact input:focus-visible,
.ipp-contact textarea:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
  border-color: var(--navy);
}

/* off screen rather than display:none, which some bots skip */
.ipp-contact .ipp-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; opacity: 0;
}

.ipp-contact .actions { margin: 0; }

.ipp-contact .btn {
  font-family: var(--sans);
  font-size: var(--fs-16);
  font-weight: 600;
  padding: 14px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--vermillion);
  background: var(--vermillion);
  color: var(--white);
  cursor: pointer;
  line-height: 1.2;
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out);
}
.ipp-contact .btn:hover { background: var(--vermillion-deep); border-color: var(--vermillion-deep); }
.ipp-contact .btn[disabled] { opacity: .6; cursor: default; }

.ipp-contact .ipp-c-msg {
  font-family: var(--sans);
  font-size: var(--fs-14);
  color: var(--navy);
  margin: var(--s-4) 0 0;
  min-height: 1.2em;
}
.ipp-contact .ipp-c-msg:empty { margin: 0; min-height: 0; }

.ipp-contact .form-note {
  font-family: var(--sans);
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--ink-muted);
  margin: var(--s-4) 0 0;
  max-width: 60ch;
}

/* The theme styles bare `input` and `textarea` at a specificity that beat the
   block above, giving typed text rgba(11,26,48,0.5), a half transparent navy,
   in the serif face. Richard reported it as hard to read. These selectors carry
   the form element as well as the wrapper so they win outright. */

.ipp-contact form.ipp-contact-form input[type="text"],
.ipp-contact form.ipp-contact-form input[type="email"],
.ipp-contact form.ipp-contact-form textarea {
  color: var(--navy);
  font-family: var(--sans);
  font-size: var(--fs-16);
  line-height: 1.5;
  opacity: 1;
  -webkit-text-fill-color: var(--navy);   /* Safari honours this over color */
  background-color: var(--white);
}

.ipp-contact form.ipp-contact-form input::placeholder,
.ipp-contact form.ipp-contact-form textarea::placeholder {
  color: var(--ink-muted);
  -webkit-text-fill-color: var(--ink-muted);
  opacity: 1;
}

/* Chrome's autofill repaints the field; keep it legible. */
.ipp-contact form.ipp-contact-form input:-webkit-autofill {
  -webkit-text-fill-color: var(--navy);
  box-shadow: 0 0 0 1000px var(--white) inset;
}
