/*
 * enquiry-form.css: shared styles for [data-enquiry-form] (spec §6/§7). Owner: contact agent.
 * Pages keep the design's inline styles on their controls; this file adds only what the
 * design lacks: labels, focus rings, a cross-engine <select>, errors, status, opt-in and the
 * failure fallback. Each page's palette comes from the custom properties below,
 * chosen by the form's data-enquiry-form value. A page may override any --ef-* property.
 * Several rules use !important because the design's controls carry inline styles.
 */

/* ---------- palettes ---------- */
[data-enquiry-form],
[data-enquiry-success] {
  --ef-accent: #154734;             /* focus ring */
  --ef-check: #154734;              /* checkbox fill */
  --ef-text: #1E2A26;
  --ef-muted: #5A6863;              /* opt-in and status text (5.9:1 on white) */
  --ef-link: #154734;
  --ef-error: #B4442E;              /* 5.5:1 on white */
  --ef-placeholder: #757575;        /* Chromium's default, 4.6:1 on white */
  --ef-panel-bg: #F2F3F2;
  --ef-panel-border: rgba(23, 64, 46, .2);
  --ef-panel-text: #1E2A26;
  --ef-gap: 16px;                   /* the form's flex gap */
  --ef-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M.7.7l3.8 3.8L8.3.7' fill='none' stroke='%231E2A26' stroke-width='1.9'/%3E%3C/svg%3E");
}

/* Home #register: navy and copper on the white form card */
[data-enquiry-form="home"],
[data-enquiry-success="home"] {
  --ef-accent: #C48A6A;
  --ef-check: #0F1C2E;
  --ef-text: #0F1C2E;
  --ef-muted: rgba(26, 26, 26, .7);  /* 6.4:1 on white */
  --ef-link: #0F1C2E;
  --ef-error: #B4442E;
  --ef-panel-bg: #F5F1EC;
  --ef-panel-border: rgba(15, 28, 46, .14);
  --ef-panel-text: #0F1C2E;
  --ef-gap: 20px;
  --ef-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6' viewBox='0 0 9 6'%3E%3Cpath d='M.7.7l3.8 3.8L8.3.7' fill='none' stroke='%230F1C2E' stroke-width='1.9'/%3E%3C/svg%3E");
}

/* ---------- helpers ---------- */
.ef-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Honeypot: off-screen, never seen or tabbed to by people */
.ef-honeypot,
[data-enquiry-form] input[name="website"] {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.ef-honeypot input,
[data-enquiry-form] input[name="website"] { font-size: 16px; }

.ef-nowrap { white-space: nowrap; }

/* Turnstile renders an invisible, zero-height widget (appearance interaction-only); a container
   placed directly in the form's flex column should not add an empty gap. */
[data-enquiry-form] > [data-turnstile] {
  margin-top: calc(-1 * var(--ef-gap));
}
/* ... but while Cloudflare shows a visible challenge (interactive), keep the normal gap above it. */
[data-enquiry-form] > [data-turnstile].ef-ts-open {
  margin-top: 0;
}

/* ---------- controls ---------- */
[data-enquiry-form] input::placeholder,
[data-enquiry-form] textarea::placeholder {
  color: var(--ef-placeholder);
  opacity: 1;
}

/* One look in Chromium, WebKit and Firefox: no native chrome, the arrow Chromium draws */
[data-enquiry-form] select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: var(--ef-select-arrow) !important;
  background-repeat: no-repeat !important;
  background-position: right 3.75px center !important;
  background-size: 9px 6px !important;
  padding-right: 28px !important;
  cursor: pointer;
  text-overflow: ellipsis;
}
/* Chromium insets a native select's text 4px inside its padding; keep that position
   (design padding: Contact 16px, Home 0) */
[data-enquiry-form="contact"] select { padding-left: 20px !important; }
[data-enquiry-form="home"] select { padding-left: 4px !important; }
[data-enquiry-form] select:-moz-focusring {
  color: transparent;
  text-shadow: 0 0 0 var(--ef-text);
}

[data-enquiry-form] input[type="checkbox"] {
  accent-color: var(--ef-check);
}

/* Visible focus ring (inline outline:none on the design's controls is overridden) */
[data-enquiry-form] input:focus-visible,
[data-enquiry-form] select:focus-visible,
[data-enquiry-form] textarea:focus-visible,
[data-enquiry-form] button:focus-visible,
[data-enquiry-form] a:focus-visible,
.ef-fallback a:focus-visible {
  outline: 2px solid var(--ef-accent) !important;
  outline-offset: 2px !important;
}
[data-enquiry-success]:focus,
.ef-fallback:focus {
  outline: none;
}

[data-enquiry-form] [aria-invalid="true"] {
  border-color: var(--ef-error) !important;
}

[data-enquiry-form] [aria-disabled="true"] {
  cursor: progress !important;
  opacity: .75;
}

/* ---------- inline errors ---------- */
.ef-error {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ef-error);
}
.ef-error[hidden] { display: none !important; }

/* ---------- marketing opt-in (§7) ----------
   The privacy notice above Submit (.ef-notice) was removed from the forms on 2026-10-10
   (owner decision), and its rules with it. */
.ef-optin a {
  color: var(--ef-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.ef-optin {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
}
.ef-optin input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
}
.ef-optin span {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ef-muted);
}

/* ---------- status and failure fallback ---------- */
.ef-status,
[data-form-status] {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ef-muted);
}
/* an empty status adds no extra gap to the design's flex column */
[data-enquiry-form] > [data-form-status]:empty {
  margin-top: calc(-1 * var(--ef-gap));
}

.ef-fallback {
  border: 1px solid var(--ef-panel-border);
  background: var(--ef-panel-bg);
  border-radius: 2px;
  padding: 16px 18px;
  color: var(--ef-panel-text);
  font-size: 15px;
  line-height: 1.7;
}
.ef-fallback p { margin: 0; }
.ef-fallback a {
  color: var(--ef-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  font-weight: 500;
}

/* Used only when a page has no success panel of its own */
.ef-success {
  border: 1px solid var(--ef-panel-border);
  background: var(--ef-panel-bg);
  border-radius: 2px;
  padding: 32px 24px;
  color: var(--ef-panel-text);
  text-align: center;
  font-size: 15px;
  line-height: 1.7;
}
.ef-success p { margin: 0; }

/* Panels land below any sticky header (pages set --ef-scroll-offset) */
[data-enquiry-form],
[data-enquiry-success],
.ef-fallback {
  scroll-margin-top: var(--ef-scroll-offset, 16px);
}
