/* Enquiry form and its states. Tokens only; see styles.css header. */

.form > * + * { margin-top: var(--space-4); }
.form-row { display: grid; gap: var(--space-4); }
@media (min-width: 48rem) { .form-row--2 { grid-template-columns: 1fr 1fr; } }

.field > * + * { margin-top: var(--space-2); }
.label { display: block; font-weight: 500; }
.label .optional { color: var(--c-text-muted); font-weight: 400; }
.input {
  display: block; width: 100%; min-height: var(--touch-min); padding: var(--space-2) var(--space-3);
  font: 400 var(--text-body) / var(--leading-body) var(--font-sans); color: var(--c-text);
  background: rgb(var(--surface-raised)); border: 1px solid var(--c-border-control); border-radius: var(--radius-control);
  transition: border-color var(--dur-fast) var(--ease-out);
}
textarea.input { min-height: calc(var(--space-16) * 2); resize: vertical; }
select.input { appearance: auto; }
.input[aria-invalid="true"] { border-color: var(--c-danger); }
.hint { color: var(--c-text-muted); }
.field-error { display: flex; gap: var(--space-2); align-items: flex-start; color: var(--c-danger); }
.field-error .icon { margin-top: 2px; }
.field-error[hidden] { display: none; }

/* Honeypot. ReDeal reads a filled `website` field as a bot. Off-screen, not display:none, because
   some bots skip hidden inputs. Out of the tab order and hidden from assistive tech. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Turnstile, shown only when ReDeal gives the form a site key. The flexible widget can't overflow. */
.captcha { max-width: 100%; overflow: hidden; }

/* ---- Notices: icon + text, never colour alone -------------------------------------------------- */
.notice {
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-control);
  border: 1px solid var(--c-border-control); background: rgb(var(--surface-sunken));
}
.notice .icon { margin-top: 2px; }
.notice > div > * + * { margin-top: var(--space-2); }
.notice--info .icon { color: var(--c-info); }
.notice--error { border-color: var(--c-danger); }
.notice--error .icon { color: var(--c-danger); }
.notice[hidden] { display: none; }

.details summary { cursor: pointer; color: var(--c-text-muted); width: fit-content; border-radius: var(--radius-control); }
.details pre {
  margin: var(--space-2) 0 0; padding: var(--space-3); overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  font: 400 var(--text-caption) / var(--leading-caption) var(--font-mono);
  background: rgb(var(--surface)); border: 1px solid var(--c-border); border-radius: var(--radius-control);
}

/* ---- Success panel ---------------------------------------------------------------------------- */
.done > * + * { margin-top: var(--space-3); }
.done__title { display: flex; gap: var(--space-2); align-items: center; }
.done__title .icon { color: var(--c-success); }
.done[hidden], .form[hidden] { display: none; }
.done:focus { outline: none; }
.done:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 4px; }

@media (prefers-reduced-motion: no-preference) {
  .done:not([hidden]), .notice:not([hidden]) { animation: enter var(--dur-enter) var(--ease-out); }
}
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
