/* Contact page layout + form. Loaded after /site.css (tokens, font,
   header, footer). Behaviour lives in contact.js; the class names and
   [hidden]/[aria-*] hooks it relies on are unchanged. */

.contact { padding-top: 56px; padding-bottom: 96px; }

/* Phones: heading, then the form, then what happens next — the form
   shouldn't sit a full screen below the fold. Desktop: copy left, form right. */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "form" "next";
  row-gap: 40px;
}
.contact-head { grid-area: head; max-width: 34rem; }
.contact-next { grid-area: next; max-width: 34rem; }
.contact-form { grid-area: form; }

/* ---------- Left column: the human part ---------- */
.contact-head h1 {
  margin: 0;
  font-size: clamp(2.25rem, 1.75rem + 2vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.lede {
  margin: 16px 0 0;
  font-size: 18px; line-height: 1.6; color: var(--ink-2);
}

.next-title {
  margin: 16px 0 12px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
}
.next-steps {
  margin: 0; padding: 0; list-style: none;
  counter-reset: step;
  border-top: 1px solid var(--rule);
}
.next-steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2); font-size: 16px; line-height: 1.55;
}
.next-steps li::before {
  content: counter(step);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.direct { margin: 28px 0 0; color: var(--ink-2); }
.direct a { font-weight: 500; }

/* ---------- Right column: the form ---------- */
.contact-form { max-width: 36rem; min-width: 0; }

form { margin: 0; }
.required-note { margin: 0 0 20px; font-size: 14px; color: var(--muted); }
.req { color: var(--muted); }
.optional { color: var(--muted); font-weight: 400; }

.row { display: grid; gap: 0 16px; }
.row.two { grid-template-columns: minmax(0, 1fr); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
@media (min-width: 600px) {
  .row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field { margin-bottom: 20px; min-width: 0; }
label {
  display: block; margin-bottom: 6px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}

input, textarea {
  display: block; width: 100%;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zoom-on-focus */
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--field-border);
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 44px;
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.15s var(--ease-out);
}
textarea { resize: vertical; min-height: 120px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:hover, textarea:hover { border-color: var(--ink-2); }
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
  border-radius: 6px;
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }
input[aria-invalid="true"]:focus-visible, textarea[aria-invalid="true"]:focus-visible {
  outline-color: var(--error);
  border-color: var(--error);
}
.field-error { margin: 6px 0 0; font-size: 14px; line-height: 1.4; color: var(--error); }

/* "Company details" groups three short number fields. No box — the legend
   reads as a label for the row. */
fieldset.group { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
legend {
  padding: 0; margin-bottom: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
fieldset.group .field { margin-bottom: 0; }
fieldset.group label { font-weight: 400; color: var(--ink-2); }

/* Honeypot — off-screen, not display:none (some bots skip hidden inputs) */
.hp {
  position: absolute !important; left: -10000px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* ---------- Alert + buttons ---------- */
.form-alert {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin: 0 0 20px; padding: 12px 16px;
  border-left: 3px solid var(--error);
  background: var(--error-bg);
  color: var(--error); font-size: 15px; line-height: 1.5;
}
.form-alert p { margin: 0; flex: 1 1 220px; }
.form-alert a { color: var(--error); }

.btn-retry {
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink); cursor: pointer;
  min-height: 36px; padding: 0 14px; border-radius: 6px;
  background: var(--paper);
  border: 1px solid var(--field-border);
  white-space: nowrap;
}
.btn-retry:hover:not(:disabled) { border-color: var(--ink); }
.btn-retry:disabled { cursor: progress; opacity: 0.6; }

.btn-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 48px; padding: 0 28px; margin-top: 4px;
  font: inherit; font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  color: #fff; cursor: pointer; white-space: nowrap;
  border: 0; border-radius: 6px;
  background: var(--accent);
  transition: background-color 0.15s var(--ease-out);
}
.btn-submit:hover:not(:disabled) { background: var(--accent-ink); }
.btn-submit:active:not(:disabled) { background: #1e40af; }
.btn-submit:focus-visible { outline-offset: 3px; border-radius: 6px; }
.btn-submit:disabled { cursor: progress; opacity: 0.8; }
@media (min-width: 600px) {
  .btn-submit { width: auto; min-width: 160px; }
}

.spinner {
  display: none;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.btn-submit[aria-busy="true"] .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Success ---------- */
.success { padding: 8px 0 0; }
.success-mark {
  width: 40px; height: 40px; margin: 0 0 20px;
  display: grid; place-items: center; border-radius: 50%;
  color: var(--success);
  border: 1.5px solid currentColor;
}
.success-mark svg { width: 20px; height: 20px; }
.success h2 {
  margin: 0 0 8px;
  font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -0.02em;
}
.success h2:focus { outline: none; }
.success h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.success p { margin: 0 0 24px; color: var(--ink-2); max-width: 32em; }
.btn-secondary {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 16px; border-radius: 6px;
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: var(--ink);
  border: 1px solid var(--field-border);
}
.btn-secondary:hover { color: var(--ink); border-color: var(--ink); }
.btn-secondary:focus-visible { border-radius: 6px; }

@media (min-width: 960px) {
  .contact { padding-top: 88px; }
  .contact-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "head form" "next form";
    column-gap: clamp(4rem, 8vw, 7rem);
    row-gap: 0;
    align-items: start;
  }
  .contact-form { padding-top: 6px; }
  .next-title { margin-top: 40px; }
}
