/* ==========================================================================
   BRAND TOKENS
   Navy and gold, taken from the campaign logo (V6, "15044 - Actum - Vote LA
   _V6 JD.pdf"): navy #003466 and gold #fbad24, the same values the main site
   (acountyoucantrust.org) uses. Nothing else in this file hard-codes a color
   or font. The typeface stays the system font.

   Contrast (WCAG AA needs 4.5:1 for text, 3:1 for borders and focus rings):
   text on white 16.5:1 | muted on page 6.9:1 | navy on white 12.5:1 |
   white on navy button 12.5:1 | deep navy on gold badge 8.6:1 |
   navy on gold tint 11.5:1 | input borders 4.4:1. Gold on white is 1.9:1,
   so gold is only ever a background or decoration, never text on white.
   ========================================================================== */
:root {
  --navy: #003466;                /* logo navy: links, focus, buttons, headings */
  --navy-deep: #00213f;           /* button hover, dark accent text */
  --gold: #fbad24;                /* logo gold: badges, top rule */
  --gold-tint: #fff5dc;           /* chosen options */
  --tint: #f1f4f8;                /* page, quiet panels */
  --rule: #d5dde7;                /* dividers */
  --edge: #b9c4d2;                /* option tile edges */

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-body);

  --color-page: var(--tint);
  --color-card: #ffffff;
  --color-text: #14202c;
  --color-muted: #465567;
  --color-heading: var(--navy);
  --color-rule: var(--rule);
  --color-line: var(--edge);
  --color-border: #6b7a8c;        /* text inputs */
  --color-subtle: var(--tint);
  --color-masthead: #ffffff;
  --color-top-rule: var(--gold);
  --color-accent: var(--navy);
  --color-accent-dark: var(--navy-deep);
  --color-accent-soft: var(--gold);
  --color-button: var(--navy);
  --color-button-hover: var(--navy-deep);
  --color-on-button: #ffffff;
  --color-selected: var(--gold-tint);
  --color-link: var(--navy);
  --color-focus: var(--navy);
  --color-error: #b00020;         /* 7.3:1 on white */
  --color-notice-bg: #fff6d6;

  --radius: 12px;
  --radius-small: 8px;
  --shadow: 0 1px 2px rgba(0, 33, 63, 0.06);
  --shadow-popup: 0 12px 40px rgba(0, 33, 63, 0.25);
  --color-backdrop: rgba(0, 33, 63, 0.55); /* dims the page behind the popup */
}

/* ---- Base ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--color-heading);
}

h1 {
  font-size: 2.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 1rem;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

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

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

/* Parts that only work with JavaScript stay hidden without it. */
html:not(.js) .needs-js {
  display: none !important;
}

[hidden] {
  display: none !important;
}

/* ---- Layout -------------------------------------------------------------- */

.wrap {
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.wrap-narrow {
  max-width: 42rem;
}

.wrap-wide {
  max-width: 90rem;
}

/* Header and headline share a white band, with a thin gold rule on top. */
.masthead {
  background: var(--color-masthead);
  border-top: 4px solid var(--color-top-rule);
  border-bottom: 1px solid var(--color-rule);
}

.site-header {
  padding: 1rem 0 0;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
}

.logo {
  display: block;
  height: clamp(3rem, 2.6rem + 1.5vw, 3.75rem);
  width: auto;
}

.site-header:last-child {
  padding-bottom: 1rem;
}

.hero {
  padding: 1.5rem 0 2rem;
}

.hero h1,
.hero .lede {
  max-width: 40rem;
}

.hero .lede {
  color: var(--color-muted);
}

main {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

.lede {
  font-size: 1.125rem;
  margin-bottom: 0;
}

.site-footer {
  border-top: 1px solid var(--color-rule);
  color: var(--color-muted);
  font-size: 0.9375rem;
  padding: 1.5rem 0 2.25rem;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.card {
  background: var(--color-card);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1rem;
}

@media (min-width: 34rem) {
  .card {
    padding: 1.75rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  .hero {
    padding: 2rem 0 2.5rem;
  }
}

/* The contact line under the intro on the form page. */
.hero .questions {
  color: var(--color-muted);
  font-size: 0.9375rem;
  margin: 0.75rem 0 0;
  overflow-wrap: anywhere;
}

/* ---- Form sections ------------------------------------------------------- */

form {
  margin: 0;
}

.form-section {
  margin-bottom: 1rem;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
}

.section-number {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-size: 0.9375rem;
  font-weight: 800;
}

.section-intro {
  margin: -0.5rem 0 1.25rem;
  color: var(--color-muted);
}

.field {
  margin: 0 0 1.375rem;
}

.form-section > .field:last-child,
.form-section > .row:last-child .field:last-child {
  margin-bottom: 0;
}

fieldset.field {
  border: 0;
  padding: 0;
  min-width: 0;
}

label,
legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

legend {
  padding: 0;
}

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

.hint {
  color: var(--color-muted);
  margin: -0.125rem 0 0.625rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea {
  display: block;
  width: 100%;
  min-height: 2.875rem;
  padding: 0.625rem 0.75rem;
  font: inherit;
  font-size: max(1rem, 16px); /* 16px or more stops iOS from zooming in */
  color: var(--color-text);
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-small);
  transition: border-color 0.15s;
}

textarea {
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--color-focus);
}

.row {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 34rem) {
  .row {
    grid-template-columns: 1fr 1fr;
  }

  .form-section > .row:last-child .field {
    margin-bottom: 0;
  }
}

.counter {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  text-align: right;
}

/* ---- File upload --------------------------------------------------------- */

input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.875rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--color-muted);
  background: var(--color-subtle);
  border: 2px dashed var(--color-line);
  border-radius: var(--radius-small);
  cursor: pointer;
}

input[type="file"]:hover {
  border-color: var(--color-accent);
}

input[type="file"]::file-selector-button {
  margin-right: 0.875rem;
  padding: 0.5rem 1.125rem;
  font: inherit;
  font-weight: 700;
  color: var(--color-accent-dark);
  background: var(--color-card);
  border: 2px solid var(--color-accent);
  border-radius: 999px;
  cursor: pointer;
}

.has-error > input[type="file"] {
  border-color: var(--color-error);
}

.file-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.file-thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-small);
  background: var(--color-subtle);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-muted);
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  flex: none;
  margin-left: auto;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* ---- Option tiles (checkboxes and radios) -------------------------------- */

.options {
  display: grid;
  gap: 0.5rem;
}

.options-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label.option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 0.875rem;
  font-weight: 400;
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

label.option:hover {
  border-color: var(--color-accent);
}

label.option:has(input:checked) {
  border-color: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
  background: var(--color-selected);
}

.option input {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0.0625rem 0 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.option-label {
  line-height: 1.45;
}

.option-strong .option-label {
  font-weight: 600;
}

/* Languages: compact chips that wrap. */
.options-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.options-chips label.option {
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.5rem 0.75rem;
  border-radius: 999px;
}

.options-chips .option input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
}

.other-language {
  margin: 1rem 0 0;
}

.js .other-language:not(.is-open) {
  display: none;
}

/* "I'm in for all of it" */
.button-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  margin: 0 0 0.75rem;
  padding: 0.375rem 1.125rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  background: var(--color-card);
  border: 2px solid var(--color-accent);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

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

.button-chip[aria-pressed="true"] {
  color: var(--color-on-button);
  background: var(--color-button);
}

.button-chip[aria-pressed="true"]::before {
  content: "\2713" / "";
}

/* ---- Profile preview card ------------------------------------------------ */

.listing-preview {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: 0;
  padding: 0.875rem 1rem;
  background: var(--color-subtle);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-small);
}

.listing-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: 0.03em;
}

.listing-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-text {
  min-width: 0;
}

.listing-label {
  margin: 0 0 0.125rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.listing-name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}

.listing-affiliation,
.listing-website {
  margin: 0;
}

.listing-website {
  font-size: 0.9375rem;
  color: var(--color-accent);
  overflow-wrap: anywhere;
}

.is-placeholder {
  color: var(--color-muted);
  font-style: italic;
  font-weight: 400;
}

/* ---- Consent ------------------------------------------------------------- */

.consent-text {
  padding: 1rem 1.125rem;
  background: var(--color-subtle);
  border-radius: var(--radius-small);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.placeholder {
  font-weight: 600;
}

/* ---- Errors -------------------------------------------------------------- */

.has-error > input,
.has-error > textarea {
  border-color: var(--color-error);
}

.field.has-error {
  border-left: 4px solid var(--color-error);
  padding-left: 0.875rem;
}

.card.has-error {
  border: 2px solid var(--color-error);
}

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

.error-summary {
  background: var(--color-card);
  border: 3px solid var(--color-error);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  margin: 0 0 1rem;
}

.error-summary h2 {
  font-size: 1.125rem;
}

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

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

.error-summary p:last-child {
  margin: 0;
}

/* ---- Buttons ------------------------------------------------------------- */

.button {
  display: inline-block;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  color: var(--color-on-button);
  background: var(--color-button);
  border: 2px solid var(--color-button-hover);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: background-color 0.15s;
}

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

.button-submit {
  width: 100%;
  min-height: 3.5rem;
  margin-top: 0.5rem;
  font-size: 1.125rem;
}

@media (min-width: 34rem) {
  .button-submit {
    width: auto;
    padding: 0.875rem 2.5rem;
  }
}

.button-secondary {
  color: var(--color-accent-dark);
  background: var(--color-card);
  border-color: var(--color-line);
}

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

/* ---- Thank-you page ------------------------------------------------------ */

.confirmation-mark {
  display: block;
  margin-bottom: 1rem;
}

.confirmation-mark circle {
  fill: var(--color-accent-soft);
}

.confirmation-mark path {
  stroke: var(--color-accent-dark);
}

/* Confirmation popup, opened by form.js right after a sign-up. The padding
   sits on .popup-body so a click on the dialog itself means the backdrop. */
.popup {
  width: min(26rem, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--color-card);
  color: var(--color-text);
  box-shadow: var(--shadow-popup);
  text-align: center;
}

.popup::backdrop {
  background: var(--color-backdrop);
}

.popup-body {
  padding: 2rem 1.5rem 1.5rem;
}

.popup .confirmation-mark {
  margin: 0 auto 1rem;
}

.popup p {
  color: var(--color-muted);
  margin: 0 0 1.5rem;
}

.popup form {
  margin: 0;
}

.popup .button {
  width: 100%;
}

.recap h2 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.recap h3 {
  margin-top: 1.5rem;
}

.checklist,
.plain-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.plain-list {
  margin: 0;
}

.checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0.375rem;
  top: 0.3rem;
  width: 0.4375rem;
  height: 0.8125rem;
  border: solid var(--color-accent);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.recap-details {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.recap-details div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
}

.recap-details dt {
  font-weight: 600;
}

.recap-details dt::after {
  content: ":";
}

.recap-details dd {
  margin: 0;
}

.recap-stacked div {
  display: block;
}

.recap-stacked dt::after {
  content: none;
}

.bio {
  white-space: pre-wrap;
}

.next-step {
  padding: 0.75rem 1rem;
  background: var(--color-selected);
  border-radius: var(--radius-small);
}

.recap p:last-child,
p.card {
  margin-bottom: 0;
}

/* ---- Admin --------------------------------------------------------------- */

.narrow {
  max-width: 24rem;
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-bar h1 {
  margin: 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-actions form {
  display: contents;
}

.notice {
  background: var(--color-notice-bg);
  border-left: 4px solid var(--color-text);
  padding: 1rem 1.125rem;
  margin-bottom: 1.25rem;
}

.notice h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.notice ul {
  margin: 0;
  padding-left: 1.25rem;
}

.table-wrap {
  overflow-x: auto;
  background: var(--color-card);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-small);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--color-rule);
}

th {
  background: var(--color-subtle);
  white-space: nowrap;
}

.nowrap {
  white-space: nowrap;
}

.muted {
  color: var(--color-muted);
}

.notes {
  min-width: 16rem;
  white-space: pre-wrap;
}

.tag {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.0625rem 0.5rem;
  border: 1px solid var(--color-line);
  background: var(--color-subtle);
  border-radius: 999px;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.thumb {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  object-fit: cover;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-small);
  background: var(--color-subtle);
}

.file-chip {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-small);
  background: var(--color-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

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