/* MOV.AP forms (Task 8). Shared by the petition, the poll and the sign-up forms.
   Everything reads the context variables set by .poster / .band--paper / .dossier, so a form works on green or on paper.
   Fields are always paper-coloured with ink text; the page colour only drives labels, hints and errors. */

/* ------------------------------------------------------------------ form skeleton */
.form {
  display: grid;
  gap: var(--s-5);
  max-width: 40rem;
}
.field {
  display: grid;
  gap: var(--s-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.field-row {
  display: grid;
  gap: var(--s-5);
}
@media (min-width: 40rem) {
  .field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
}

.field__label {
  padding: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: var(--label-stretch);
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg);
}
.field__req,
.field__opt {
  margin-left: 0.5em;
  font-family: var(--font-mono);
  font-weight: 400;
  font-stretch: normal;
  font-size: var(--text-xs);
  letter-spacing: 0;
  text-transform: none;
}
.field__req { color: var(--accent); }
.field__opt { color: var(--fg-muted); }
.field__hint {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--fg-muted);
}
.field__hint a { color: inherit; }
.field__hint--why { margin-top: calc(var(--s-3) * -1); }
.field__error {
  margin: 0;
  padding-left: var(--s-3);
  border-left: 4px solid var(--alarm);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  color: var(--alarm);
}

/* ------------------------------------------------------------------ inputs */
.input {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--ink-900);
  border-radius: 0;
  background: var(--paper-50);
  color: var(--ink-900);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.3;
}
.input::placeholder { color: var(--ink-600); opacity: 1; }
.input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.input[aria-invalid="true"] {
  border-color: var(--red-600);
  box-shadow: inset 0 0 0 1px var(--red-600);
}
.select {
  appearance: none;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23151A14' stroke-width='2.5' stroke-linecap='square'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1.2rem;
}

/* ------------------------------------------------------------------ checkboxes */
.check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-3);
  border: 2px solid var(--rule-color);
  cursor: pointer;
}
.check input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.05rem 0 0;
  accent-color: var(--red-600);
  cursor: pointer;
}
.check input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.check:has(input:checked) { border-color: var(--accent); }
.check:has(input[aria-invalid="true"]) { border-color: var(--alarm); }
.check__text {
  font-size: var(--text-base);
  line-height: 1.4;
  color: var(--fg);
}
.check__more {
  margin-left: 0.5em;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
  color: var(--fg-muted);
}
.check--consent { border-width: 3px; }
.check--consent .check__text {
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* ------------------------------------------------------------------ honeypot (kept out of sight, not display:none) */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------------------ messages */
.form-errors,
.notice {
  max-width: 40rem;
  margin-bottom: var(--s-5);
  padding: var(--s-4) var(--s-5);
  border-left: 8px solid var(--red-600);
  background: var(--paper-50);
  color: var(--ink-900);
  --focus: var(--ink-900);
  --accent: var(--red-700);
  --alarm: var(--red-700);
}
.form-errors:focus { outline: 3px solid var(--lime-400); outline-offset: 3px; }
.form-errors__title,
.notice__title {
  margin: 0 0 var(--s-2);
  font-size: var(--text-lg);
  line-height: 1.1;
}
.form-errors ul { margin: 0; padding-left: 1.2rem; }
.form-errors a { color: var(--ink-900); font-weight: 600; }
.notice p { margin: 0 0 var(--s-3); }
.notice p:last-child { margin-bottom: 0; }
.notice--ok { border-left-color: var(--lime-500); }
.notice--warn { border-left-color: var(--amber-500); }
.notice .btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink-900); --btn-shadow: var(--red-600); border-color: var(--ink-900); }

.form-actions {
  display: grid;
  gap: var(--s-3);
  justify-items: start;
}
.btn[disabled],
.btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }

/* ------------------------------------------------------------------ ALTCHA widget (self-hosted, /vendor/altcha) */
altcha-widget {
  display: block;
  --altcha-color-base: var(--paper-50);
  --altcha-color-text: var(--ink-900);
  --altcha-color-border: var(--ink-900);
  --altcha-color-border-focus: var(--red-600);
  --altcha-color-active: var(--red-600);
  --altcha-border-width: 2px;
  --altcha-border-radius: 0;
  --altcha-max-width: 22rem;
}
altcha-widget .altcha { font-family: var(--font-serif); font-size: var(--text-sm); }

/* ------------------------------------------------------------------ petition page */
.ladder {
  display: grid;
  gap: var(--s-3);
  margin: var(--s-5) 0 var(--s-6);
  padding: 0;
  list-style: none;
  max-width: 48rem;
}
@media (min-width: 40rem) {
  .ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ladder__item {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-3) var(--s-4);
  border-left: 4px solid var(--rule-color);
}
.ladder__n {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: var(--display-stretch);
  font-size: var(--display-4);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}
.ladder__l {
  font-size: var(--text-sm);
  line-height: 1.35;
  color: var(--fg-muted);
}
.ladder__item--next { border-left-color: var(--red-600); }
.ladder__item--next .ladder__l { color: var(--fg); }
.ladder__item--done { border-left-color: var(--lime-400); }
.ladder__item--done .ladder__n { color: var(--accent); }

.petition-split { margin-top: var(--s-5); }
.petition-scope { max-width: 52rem; margin-top: var(--s-4); }
.petition-scope a { color: inherit; }

.petition-texts__lede { max-width: var(--measure); color: var(--fg-muted); }
.petition-text {
  max-width: 48rem;
  margin-top: var(--s-4);
  border: 2px solid var(--ink-900);
  background: var(--bg);
}
.petition-text > summary {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-4) 3.2rem var(--s-4) var(--s-4);
  position: relative;
  cursor: pointer;
  list-style: none;
}
.petition-text > summary::-webkit-details-marker { display: none; }
.petition-text > summary::after {
  content: "+";
  position: absolute;
  right: var(--s-4);
  top: var(--s-3);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.8rem;
  line-height: 1;
}
.petition-text[open] > summary::after { content: "\2212"; }
.petition-text > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.petition-text__to {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.petition-text__title {
  font-size: var(--text-md);
  font-weight: 650;
  line-height: 1.25;
}
.petition-text__body {
  padding: var(--s-2) var(--s-4) var(--s-5);
  border-top: 1px solid var(--rule-color);
}
.petition-text__body h2,
.petition-text__body h3 { font-size: var(--display-4); margin-bottom: var(--s-3); }
.petition-text[open] { box-shadow: 6px 6px 0 var(--red-600); }
.petition-text__status { color: var(--fg-muted); }
.petition-text > .notice { margin: 0 var(--s-4) var(--s-3); }
.petition-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--rule-color);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.petition-meta dt { color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.petition-meta dd { margin: 0; font-weight: 600; }
/* Versions and timeline: the public record of what changed and when. */
.petition-history {
  padding: var(--s-3) var(--s-4) var(--s-4);
  border-top: 1px solid var(--rule-color);
  font-size: var(--text-sm);
}
.petition-history > summary { cursor: pointer; font-weight: 650; }
.petition-history h3 { font-size: var(--text-sm); margin: var(--s-4) 0 var(--s-2); text-transform: uppercase; letter-spacing: 0.04em; }
.petition-history__list { margin: 0; padding-left: var(--s-5); display: grid; gap: var(--s-2); }

.petition-grid {
  display: grid;
  gap: var(--s-7);
}
@media (min-width: 62rem) {
  .petition-grid { grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; }
  .why-id { position: sticky; top: var(--s-5); }
}
.petition-sign__title { margin-bottom: var(--s-5); }

/* "Why we ask for your ID number": a paper note on the green band */
.why-id {
  --bg: var(--paper-50);
  --fg: var(--ink-900);
  --fg-muted: var(--ink-600);
  --rule-color: var(--paper-300);
  --accent: var(--red-700);
  --alarm: var(--red-700);
  --cite: var(--red-700);
  --focus: var(--ink-900);
  padding: var(--s-5);
  border-top: 6px solid var(--red-600);
  background: var(--bg);
  color: var(--fg);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.why-id__title {
  margin: 0 0 var(--s-3);
  font-size: var(--text-lg);
  line-height: 1.05;
}
.why-id p { margin: 0 0 var(--s-3); }
.why-id__list {
  margin: 0 0 var(--s-3);
  padding-left: 1.1rem;
}
.why-id__list li + li { margin-top: var(--s-2); }
.why-id__foot { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .btn[aria-busy="true"] { cursor: default; }
}
