/*
 * Single-column, high-contrast form styles.
 * Colours meet WCAG 2.1 AA contrast (text 4.5:1, UI components 3:1).
 */
:root {
  --text: #0b0c0c;
  --muted: #505a5f;
  --border: #0b0c0c;
  --focus: #ffdd00;
  --error: #d4351c;
  --link: #1d70b8;
  --link-visited: #4c2c92;
  --button: #00703c;
  --button-hover: #005a30;
  --bg: #ffffff;
  --bg-alt: #f3f2f1;
}

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

html {
  font-size: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 1rem 0 0.75rem;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  text-decoration-thickness: 0.15em;
}

/* Highly visible focus indicator (2.4.7, 1.4.11) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  box-shadow: 0 0 0 6px var(--text);
}

a:focus-visible {
  background: var(--focus);
  color: var(--text);
  box-shadow: 0 -2px var(--focus), 0 4px var(--text);
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--focus);
  color: var(--text);
  z-index: 10;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.breadcrumbs {
  font-size: 1rem;
  color: var(--muted);
}

.lead {
  font-size: 1.25rem;
  color: var(--muted);
}

.section {
  border: 0;
  padding: 0;
  margin: 2.5rem 0 0;
  min-width: 0;
}

.section-legend {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 0;
  margin-bottom: 0.5rem;
}

.section-description {
  color: var(--muted);
  margin-top: 0;
}

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

.field--error {
  border-left: 5px solid var(--error);
  padding-left: 1rem;
}

.label,
.legend {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  padding: 0;
}

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

.help {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.error-message {
  margin: 0 0 0.5rem;
  color: var(--error);
  font-weight: 700;
  font-size: 1rem;
}

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 0.5rem;
  min-height: 2.75rem;
}

.input--date {
  max-width: 14rem;
}

.field--error .input,
.field--error .select,
.field--error .textarea {
  border-color: var(--error);
}

.textarea {
  resize: vertical;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  position: relative;
}

.radio,
.checkbox {
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--text);
  cursor: pointer;
}

.option-label {
  padding-top: 0.1rem;
  cursor: pointer;
}

.conditional {
  margin: 0.75rem 0 0 0.9rem;
  padding-left: 1rem;
  border-left: 4px solid #b1b4b6;
}

.conditional[hidden] {
  display: none;
}

.error-summary {
  border: 5px solid var(--error);
  padding: 1rem;
  margin: 1.5rem 0;
}

.error-summary:focus {
  outline: 3px solid var(--focus);
}

.error-summary-title {
  margin-top: 0;
}

.error-summary-list {
  margin: 0;
  padding-left: 1.25rem;
}

.error-summary-list a {
  color: var(--error);
  font-weight: 700;
}

.actions {
  margin-top: 2.5rem;
}

.button {
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--button);
  border: 2px solid transparent;
  border-bottom: 2px solid #002d18;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  min-height: 2.75rem;
}

.button:hover {
  background: var(--button-hover);
}

.form-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.form-list-item {
  padding: 1rem 0;
  border-top: 1px solid #b1b4b6;
}

.form-list-link {
  font-size: 1.25rem;
  font-weight: 700;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (forced-colors: active) {
  .field--error {
    border-left-color: LinkText;
  }
}
