/* Plain, high contrast, big targets. Nothing depends on color alone. */
:root {
  --text: #111;
  --bg: #fff;
  --accent: #0b4fa3;      /* 7.6:1 on white */
  --error: #a3000b;       /* 7.9:1 on white */
  --muted: #444;          /* 9.7:1 on white */
  --focus: #ffbf47;
}

* { box-sizing: border-box; }

html { font-size: 112.5%; }

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

main, .site-header, .site-footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

h1 { font-size: 2rem; line-height: 1.2; margin: 1rem 0; }
h2 { font-size: 1.5rem; line-height: 1.25; margin: 1.5rem 0 0.5rem; }

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

:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus);
}

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

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

.plain-list { padding-left: 1.25rem; }

.step { margin-top: 1.5rem; }
.step-count { color: var(--muted); margin-top: 0; }
h2 .step-count { display: block; font-size: 1rem; font-weight: 400; margin-top: 0.25rem; }
.required-note { color: var(--muted); }
.req { color: var(--error); font-weight: 700; }

label { display: block; font-weight: 600; margin: 1rem 0 0.35rem; }

input[type="text"], input[type="email"] {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--text);
  border-radius: 4px;
  min-height: 48px;
}
input[aria-invalid="true"] { border-color: var(--error); border-width: 3px; }

.check-row { display: flex; align-items: flex-start; gap: 0.75rem; margin: 1rem 0; }
.check-row input { width: 28px; height: 28px; margin: 0.2rem 0 0; flex: none; }
.check-row label { margin: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

button {
  font: inherit;
  font-weight: 600;
  min-height: 48px;
  min-width: 48px;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button.secondary { background: var(--bg); color: var(--accent); }
button[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }

.error {
  color: var(--error);
  font-weight: 600;
  border-left: 5px solid var(--error);
  padding-left: 0.75rem;
}
.hint { border-left: 5px solid var(--accent); padding-left: 0.75rem; }

.review dt { font-weight: 600; margin-top: 0.75rem; }
.review dd { margin: 0; word-break: break-word; }
.review .edit-button { display: block; padding: 0.25rem 0; min-height: 44px; }

/* Signup Step 3: what we found for the ZIP code */
.zip-result { border-left: 5px solid var(--accent); padding: 0.25rem 0 0.25rem 0.75rem; margin: 1rem 0; }
.zip-result h3 { font-size: 1.15rem; margin: 0.25rem 0 0.5rem; }
.zip-result-list { margin: 0.25rem 0 0.75rem; padding-left: 1.25rem; }
.zip-result-list li { margin-bottom: 0.35rem; }

/* Honeypot: off screen for people, still in the form for bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.site-footer { border-top: 2px solid var(--text); margin-top: 3rem; font-size: 0.95rem; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  .skip-link, .actions, .site-footer { display: none; }
}

/* ---------- page 2: story and representatives ---------- */
fieldset { border: 2px solid var(--text); border-radius: 4px; padding: 0.75rem 1rem; margin: 1rem 0; }
legend { font-weight: 600; padding: 0 0.25rem; }

textarea {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--text);
  border-radius: 4px;
}
textarea[aria-invalid="true"] { border-color: var(--error); border-width: 3px; }

.rep-list { list-style: none; padding: 0; margin: 0.5rem 0 1.5rem; }
.rep-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--muted);
}
.rep-list input[type="checkbox"] { width: 28px; height: 28px; margin: 0; flex: none; }
.rep-link { font-weight: 600; font-size: 1.1rem; }
.rep-district { flex-basis: 100%; color: var(--muted); padding-left: calc(28px + 1rem); }
.no-phone { color: var(--muted); }

a.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  background: var(--bg);
}

dialog {
  max-width: 36rem;
  width: calc(100% - 2rem);
  border: 3px solid var(--text);
  border-radius: 6px;
  padding: 1.25rem;
  color: var(--text);
  background: var(--bg);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog h3 { font-size: 1.15rem; margin: 1rem 0 0.25rem; }
dialog p { margin: 0.25rem 0; word-break: break-word; }

/* ---------- returning people ---------- */
.welcome-back { border: 3px solid var(--accent); border-radius: 6px; padding: 0.5rem 1.25rem 1rem; margin: 1.5rem 0; }
.returning-link { margin-top: 1.5rem; }
button.link-button {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  font-weight: 600;
  padding: 0.6rem 0;
  min-height: 48px;
}

/* Street address suggestions: plain buttons, one per line */
.field-hint { margin: 0.25rem 0 0.5rem; }
.suggest-heading { font-size: 1.1rem; margin: 1rem 0 0.5rem; }
.suggest-list { list-style: none; padding: 0; margin: 0; }
.suggest-list li { margin: 0 0 0.5rem; }
.suggest-list button {
  width: 100%;
  text-align: left;
  background: var(--bg);
  color: var(--accent);
  border: 2px solid var(--accent);
}
.suggest-list button:hover { background: #eef3fb; }
.suggest-credit { font-size: 0.95rem; margin: 0.25rem 0 0; }

/* ---------- letters: read, edit, done ---------- */
.letter-label { font-size: 1.15rem; margin: 1.25rem 0 0.5rem; }
.letter {
  border: 2px solid var(--text);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  background: var(--bg);
}
.letter p { margin: 0 0 1rem; white-space: pre-line; }
.letter p:last-child { margin-bottom: 0; }
#letter-edit { line-height: 1.6; min-height: 24rem; }
.done-item { border-bottom: 1px solid var(--muted); padding-bottom: 0.75rem; }
.done-item h2 { font-size: 1.25rem; }
.send-actions { flex-direction: column; align-items: stretch; }
.send-actions .btn, .send-actions button { justify-content: flex-start; text-align: left; }
.send-none { margin: 0; }
.sent-question { border: 3px solid var(--accent); border-radius: 6px; padding: 0.25rem 1.25rem 1rem; margin: 1.5rem 0; }

/* Print letter: only the letter on the page. */
@media print {
  body:has([data-step="send"]:not([hidden])) * { visibility: hidden; }
  body:has([data-step="send"]:not([hidden])) #send-letter,
  body:has([data-step="send"]:not([hidden])) #send-letter * { visibility: visible; }
  body:has([data-step="send"]:not([hidden])) #send-letter { position: absolute; left: 0; top: 0; width: 100%; border: none; padding: 0; }
}
