/* Accessibility Clinic — Request an Assistive Technology Evaluation
   Contrast targets: body text >= 4.5:1, UI borders/focus >= 3:1 on #ffffff. */

:root {
  --ink:        #1a1a1a;   /* 16.1:1 on white */
  --ink-muted:  #4a4a4a;   /*  8.9:1 on white */
  --accent:     #1a4f8a;   /*  7.5:1 on white */
  --accent-dk:  #123a66;
  --error:      #a4141e;   /*  6.5:1 on white */
  --error-bg:   #fdf2f2;
  --border:     #6b6b6b;   /*  4.9:1 — exceeds 3:1 UI minimum */
  --border-soft:#c4c4c4;
  --bg:         #ffffff;
  --bg-soft:    #f4f6f9;
  --focus:      #b5341a;   /*  5.3:1 — visible against white and against accent */
  --radius: 6px;
  --measure: 44rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;   /* 16px side gutter at narrow widths */
}

header.site {
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-soft);
}
header.site .wrap { padding: 1rem 1rem; }
header.site a { color: var(--accent); }

h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.25rem);
  line-height: 1.25;
  margin: 0 0 0.75rem;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 2.5rem 0 0.5rem;
}
p { margin: 0 0 1rem; max-width: 42rem; }
.lede { color: var(--ink-muted); }

a { color: var(--accent); }
a:hover { color: var(--accent-dk); }

/* --- Focus: always visible, never removed ------------------------------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
/* Fallback for engines without :focus-visible */
:focus:not(:focus-visible) { outline: none; }

/* --- Fields ------------------------------------------------------------- */
.field { margin: 0 0 1.75rem; }

.field > label,
fieldset > legend {
  display: block;
  font-weight: 600;
  margin: 0 0 0.25rem;
  padding: 0;
}

.req {
  font-weight: 400;
  color: var(--ink-muted);
}

.hint {
  display: block;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  margin: 0 0 0.5rem;
  max-width: 42rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  display: block;
  width: 100%;
  max-width: 34rem;
  min-height: 2.75rem;            /* >= 44px target */
  padding: 0.5rem 0.625rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
textarea { min-height: 8rem; resize: vertical; }

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--error);
  background: var(--error-bg);
}

fieldset {
  border: 0;
  margin: 0 0 1.75rem;
  padding: 0;
  min-width: 0;
}

.choices { margin: 0.25rem 0 0; }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.5rem 0.25rem;        /* generous hit area */
  min-height: 2.75rem;
}
.choice input { margin: 0.3rem 0 0; width: 1.15rem; height: 1.15rem; flex: none; }
.choice label { font-weight: 400; }

.other-text { margin: 0.25rem 0 0 1.75rem; max-width: 28rem; }

/* --- Errors ------------------------------------------------------------- */
.error-summary {
  border: 3px solid var(--error);
  background: var(--error-bg);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
}
.error-summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.error-summary h2 { margin: 0 0 0.5rem; font-size: 1.125rem; color: var(--error); }
.error-summary ul { margin: 0; padding-left: 1.25rem; }
.error-summary li { margin: 0.25rem 0; }
.error-summary a { color: var(--error); font-weight: 600; }

.field-error {
  display: block;
  color: var(--error);
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 0 0 0.375rem;
}
.field-error::before { content: "Error: "; }   /* not colour alone */

[hidden] { display: none !important; }

/* --- Buttons ------------------------------------------------------------ */
.actions { margin-top: 2rem; }

button[type="submit"] {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  min-height: 2.75rem;
  cursor: pointer;
}
button[type="submit"]:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
button[type="submit"][aria-disabled="true"] { opacity: 0.7; cursor: progress; }

/* --- Notices ------------------------------------------------------------ */
.notice {
  background: var(--bg-soft);
  border-left: 5px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 2rem 0;
}
.notice h2 { margin-top: 0; font-size: 1.125rem; }
.notice p:last-child { margin-bottom: 0; }

/* --- Honeypot: hidden from sight AND from assistive tech ---------------- */
.hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px; height: 1px; overflow: hidden;
}

/* --- Thank-you ---------------------------------------------------------- */
.confirm { border-top: 6px solid var(--accent); padding-top: 1.5rem; }
.next-steps li { margin: 0.5rem 0; }

/* --- Turnstile security check ------------------------------------------
   The widget is an iframe, not a form control, so it gets a group label
   rather than a <label for>. */
.field-label {
  display: block;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
#turnstile-widget { margin-top: 0.5rem; min-height: 68px; }
#turnstile-widget[aria-invalid="true"] {
  outline: 2px solid var(--error);
  outline-offset: 4px;
  border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  input, textarea { border-width: 3px; }
}
