/* ==========================================================================
   portal.css — the farmer portal: the application flow (task A6, spec §7).

   Same palette as the public site, declared once in `root.css` (DESIGN.md rule 1:
   one palette, and it is brand-*). Nothing here introduces a colour, a font or a
   radius that `root.css` does not already define — this file is layout and form
   affordances, not a second design.

   Why a separate file rather than growing `site.css`: §II caps a source file at
   30 KB, and the portal is its own surface (a form column at `--container-narrow`,
   `--container-prose` for the questionnaire — see `.portal__wrap--wide` — not a banded
   marketing page). It is loaded only by the portal templates, through
   `base.html`'s `extra_css` block.

   Two constraints from DESIGN §6 decide the shape of this file:
     * touch targets are >= 44px, including radio and checkbox rows;
     * `:focus-visible` exists on every focusable element, never `outline: none`.
   ========================================================================== */

.portal {
  background-color: var(--brand-cream);
}

.portal__wrap {
  max-width: var(--container-narrow);
}

/* The questionnaire is the one portal surface that is not a single question column: it holds
   a nine-tab strip and 68 items, and at `--container-narrow` the strip showed four of the
   nine tabs and the items wrapped more than they needed to. It takes the readiness
   questionnaire's measure (`/before-you-apply/` is `--container-prose`), so the two long
   forms in this tree are the same width. The apply flow keeps the narrow column: it asks one
   question per screen. */
.portal__wrap--wide {
  max-width: var(--container-prose);
}

.portal__title {
  margin: 0 0 0.75rem;
  color: var(--brand-forestDark);
  font-size: var(--text-3xl);
}

.portal__lede {
  margin: 0 0 1.25rem;
  color: var(--brand-charcoal);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

.portal__ref {
  margin: 0 0 1.5rem;
  color: var(--brand-muted);
  font-size: var(--text-sm);
}

.portal__ref strong {
  color: var(--brand-forestDark);
  letter-spacing: 0.02em;
}

.portal__note {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-sm);
  background-color: var(--brand-creamWarm);
  color: var(--brand-charcoal);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.portal__foot {
  margin-top: 1.5rem;
  color: var(--brand-muted);
  font-size: var(--text-sm);
}

.portal__subtitle {
  margin: 2rem 0 0.5rem;
  color: var(--brand-forestDark);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 400;
}

.portal__form {
  margin-top: 1.5rem;
}

.portal__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

/* --- The step rail -------------------------------------------------------- */

.rail {
  display: grid;
  gap: 0.25rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--brand-sand);
}

.rail__item {
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--brand-sand);
  color: var(--brand-muted);
  font-size: var(--text-sm);
}

.rail__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
}

.rail__state {
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rail__item--done {
  color: var(--brand-charcoal);
}

.rail__item--done .rail__num {
  border-color: var(--brand-moss);
  background-color: var(--brand-moss);
  color: var(--brand-cream);
}

.rail__item--done .rail__state {
  color: var(--brand-moss);
}

.rail__item--current {
  color: var(--brand-forestDark);
  font-weight: 650;
}

.rail__item--current .rail__num {
  border-color: var(--brand-ochre);
  color: var(--brand-ochreInk);
}

.rail__item--current .rail__state {
  color: var(--brand-ochreInk);
}

/* --- Fields --------------------------------------------------------------- */

.field-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-grid > .field:first-child:nth-last-child(odd),
  .field-grid > .field--wide {
    grid-column: 1 / -1;
  }
}

.field {
  display: block;
  margin: 1.25rem 0 0;
}

.field-grid > .field {
  margin-top: 0;
}

.field__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--brand-forestDark);
  font-size: var(--text-sm);
  font-weight: 650;
}

.field__hint {
  margin: 0 0 0.4rem;
  color: var(--brand-muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.field__error {
  margin: 0.35rem 0 0;
  color: var(--brand-warmDark);
  font-size: var(--text-xs);
  font-weight: 600;
}

.portal__form input[type="text"],
.portal__form input[type="email"],
.portal__form input[type="tel"],
.portal__form input[type="number"],
.portal__form input[type="password"],
.portal__form input[type="url"],
.portal__form input[type="file"],
.portal__form textarea,
.portal__form select {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-xs);
  background-color: var(--brand-cream);
  color: var(--brand-charcoal);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.35;
}

.portal__form input:focus-visible,
.portal__form textarea:focus-visible,
.portal__form select:focus-visible,
.consent__tick input:focus-visible {
  outline: 2px solid var(--brand-ochre);
  outline-offset: 2px;
  border-color: var(--brand-ochre);
}

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

/* Radio and checkbox rows are 44px tall targets, not inline text. Django renders a
   `RadioSelect` as a div per option with the input inside its label, so the row is
   the label and the styling follows the label, not the input. */
.portal__form label:has(> input[type="radio"]),
.portal__form label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.35rem 0;
  color: var(--brand-charcoal);
  font-size: var(--text-sm);
  font-weight: 400;
  cursor: pointer;
}

.portal__form input[type="radio"],
.portal__form input[type="checkbox"] {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--brand-forest);
}

/* --- Notices -------------------------------------------------------------- */

.notice {
  margin: 1.25rem 0 0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.notice p {
  margin: 0;
}

.notice + .notice {
  margin-top: 0.75rem;
}

.notice--error {
  border: 1px solid var(--brand-warmDark);
  background-color: var(--brand-creamWarm);
  color: var(--brand-warmDark);
}

.notice--info {
  border: 1px solid var(--brand-sand);
  background-color: var(--brand-sageLight);
  color: var(--brand-charcoal);
}

/* --- The consent block ---------------------------------------------------- */

.consent {
  margin: 2rem 0 0;
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-sm);
  background-color: var(--brand-sageLight);
}

.consent__heading {
  padding: 0;
  color: var(--brand-forestDark);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: var(--leading-tight);
}

.consent__draft {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid var(--brand-ochre);
  background-color: var(--brand-cream);
  color: var(--brand-charcoal);
  font-size: var(--text-xs);
  line-height: 1.6;
}

.consent__body {
  margin: 0.75rem 0 0;
  color: var(--brand-charcoal);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.consent__body p {
  margin: 0 0 0.65rem;
}

.consent__tick {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 44px;
  margin-top: 1rem;
  color: var(--brand-forestDark);
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
}

.consent__tick input {
  margin-top: 0.15rem;
}

/* --- The pledge ----------------------------------------------------------- */

.pledge__ahead {
  margin: 1.5rem 0 0;
  padding-left: 0.9rem;
  border-left: 3px solid var(--brand-ochre);
  color: var(--brand-charcoal);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.pledge {
  margin: 1.75rem 0 0;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-sm);
  background-color: var(--brand-creamWarm);
}

.pledge__title {
  margin: 0 0 0.5rem;
  color: var(--brand-forestDark);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 400;
}

/* A branch heading inside the pledge form: it names which group of fields belongs to the
   choice above it. Serif like the pledge title, but one step down and tighter. */
.pledge__group {
  margin: 1.5rem 0 0.65rem;
  color: var(--brand-forestDark);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: 400;
}

/* The branch the member did not choose. Stated rather than left to the `hidden` attribute's
   default, so a later `display:` on a group cannot silently un-hide the other branch. */
[data-pledge-group][hidden] {
  display: none;
}

/* The definition a reader needs *before* the fields: what "free of prohibited inputs" means.
   Quiet, but not a footnote — it sits between the heading and the grid on purpose. */
.pledge__def {
  margin: 0 0 0.9rem;
  color: var(--brand-charcoal);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.pledge__line {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.pledge__list {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--brand-charcoal);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.pledge__list li {
  margin-bottom: 0.5rem;
}

/* --- Categories ----------------------------------------------------------- */

.choice-list {
  margin: 1.5rem 0 0;
  padding: 0;
  border: 0;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-sm);
  background-color: var(--brand-cream);
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--brand-moss);
  background-color: var(--brand-sageLight);
}

.choice input {
  margin-top: 0.2rem;
}

.choice__title {
  color: var(--brand-forestDark);
  font-size: var(--text-sm);
  font-weight: 650;
}

/* --- The summary ---------------------------------------------------------- */

.summary {
  margin: 2rem 0 0;
  border-top: 1px solid var(--brand-sand);
}

.summary__row {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--brand-sand);
}

@media (min-width: 640px) {
  .summary__row {
    grid-template-columns: 14rem 1fr;
    gap: 1rem;
  }
}

.summary dt {
  color: var(--brand-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary dd {
  margin: 0;
  color: var(--brand-charcoal);
  font-size: var(--text-base);
}

.summary__row--figure dd {
  color: var(--brand-ochreInk);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
}

.summary__tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-pill);
  color: var(--brand-muted);
  font-size: var(--text-nano);
  text-transform: none;
  letter-spacing: 0.02em;
}

.next-steps {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--brand-charcoal);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.next-steps li {
  margin-bottom: 0.5rem;
}

/* --- The pre-visit questionnaire (Q4) -------------------------------------
 *
 * One column, because this is read on a phone at a kitchen table. Every control is at
 * least 44 px tall (DESIGN §5), and no state is carried by colour alone: the NA chip says
 * what it did in words, and the field beside it keeps the farmer's draft visible.
 */

.q {
  margin: 1.5rem 0 0;
}

.q__ref {
  margin: 1.5rem 0 0;
  color: var(--brand-muted);
  font-size: var(--text-sm);
}

.q__ref strong {
  color: var(--brand-forestDark);
}

.q__ref-note {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--text-xs);
}

.q__progress {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-sm);
  background-color: var(--brand-creamWarm);
}

.q__progress-text {
  margin: 0;
  color: var(--brand-forestDark);
  font-size: var(--text-sm);
}

.q__progress-note {
  margin: 0.25rem 0 0;
  color: var(--brand-muted);
  font-size: var(--text-xs);
}

/* --- The document an item asks for (Q6) ------------------------------------
   One block per attachment item: what the FORM wants, what has been supplied, and one control
   to add a file. It is deliberately not a progress line of its own — the design pass cut the
   page to two, and this is an item's fact, not the page's. */
.q__attach {
  margin: 1rem 0 0;
  padding: 0.875rem 1rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-sm);
  background-color: var(--brand-creamWarm);
}

.q__attach-what {
  margin: 0;
  color: var(--brand-charcoal);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.q__attach-label {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--brand-muted);
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.q__attach-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.q__attach-file {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: var(--text-sm);
}

.q__attach-name {
  color: var(--brand-forestDark);
  font-weight: 600;
}

.q__attach-when {
  color: var(--brand-muted);
  font-size: var(--text-xs);
}

.q__attach-state {
  margin: 0.5rem 0 0;
  color: var(--brand-muted);
  font-size: var(--text-xs);
}

.q__attach-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
}

.q__attach-input {
  min-height: 44px;
  max-width: 100%;
  color: var(--brand-charcoal);
  font-size: var(--text-xs);
}

/* --- What is still blank (Q5's refusal) -----------------------------------
   Every blank, in the form's own order, each a link to the section it lives in. The error
   notice's colour carries the news; the list carries the work. */

.q__missing-head {
  margin: 1rem 0 0;
  color: var(--brand-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.q__missing-head:first-of-type {
  margin-top: 0.875rem;
}

.q__missing {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

/* A block, not a flex row: the question text is the flexible part, and as a flex item it
   refused to shrink — 68 links pushed the page wider than a 390 px phone (found in a
   screenshot, and measured by `documentElement.scrollWidth > innerWidth`). */
.q__missing-link {
  display: block;
  min-height: 44px;
  padding: 0.4rem 0;
  color: inherit;
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* --- The section tabs ------------------------------------------------------
   Sixty-eight visible items in nine sections is a sitting, not a screen
   (`PRE_VISIT_QUESTIONNAIRE_PRD` §7). The tabs show one section at a time and the bar
   under it moves between them — the shape the public self-check already uses, in the
   portal's own file so the public stylesheet is not loaded for a form.

   Everything here is additive: with no script, `.q__section` rules as it always did and
   `.q__nav-link` is an in-page anchor, so the page is the stack it was before the tabs.
   `questionnaire.js` sets `data-q-js` on <html> when it starts, and only then do the
   count line, the hidden sections and the bar exist. */

.q__nav {
  position: sticky;
  /* Under the site header, which is itself sticky (`site.css`, `--header-height`) and paints
     above this strip. `top: 0` put the tabs behind it the moment the page scrolled — found in
     a screenshot of section 4, where the strip had vanished. */
  top: var(--header-height);
  z-index: 3;
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--brand-sand);
  border-bottom: 1px solid var(--brand-sand);
  background-color: var(--brand-cream);
}

.q__nav-list {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0.375rem 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.q__nav-list::-webkit-scrollbar {
  display: none;
}

.q__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--brand-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms, color 150ms;
}

.q__nav-link:hover {
  background-color: var(--brand-sageLight);
  color: var(--brand-charcoal);
}

.q__nav-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: var(--radius-pill);
  background-color: var(--brand-sand);
  color: var(--brand-forestDark);
  font-size: var(--text-micro);
}

.q__nav-link[data-done="true"] .q__nav-num {
  background-color: var(--brand-ochre);
  color: var(--brand-cream);
}

.q__nav-link[aria-current="step"] {
  background-color: var(--brand-forest);
  color: var(--brand-cream);
}

.q__nav-link[aria-current="step"] .q__nav-num {
  background-color: var(--brand-ochreLight);
  color: var(--brand-forest);
}

/* The bar under a section. Shown only where the script can honour it. */
.q__bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--brand-sand);
}

html[data-q-js] .q__bar {
  display: flex;
}

/* Q5's submit is the one control that must not depend on the script: with no JavaScript the
   page is every section stacked, and its last line is still a real submit. The bar needs no
   `Back`/`Next` there — there are no steps to move between — so only this modifier shows. */
.q__bar--submit {
  display: flex;
  flex-wrap: wrap;
}

.q__bar-note {
  color: var(--brand-muted);
  font-size: var(--text-xs);
}

html[data-q-js] .q__section:not([data-current]) {
  display: none;
}

.q__section {
  /* No `scroll-margin-top` here: `root.css` already sets `scroll-padding-top` for the sticky
     header, and a second offset would double it. The strip is cleared by
     `questionnaire.js`, which scrolls with the strip's own height in hand. */
  margin: 2rem 0 0;
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid var(--brand-sand);
}

.q__section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.q__section-title {
  margin: 0;
  color: var(--brand-forestDark);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
}

.q__section-count {
  margin: 0;
  color: var(--brand-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.q__item {
  margin: 1.5rem 0 0;
}

.q__num {
  display: inline-block;
  min-width: 2.5rem;
  margin-right: 0.35rem;
  color: var(--brand-ochreDark);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.q__input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-sm);
  background-color: var(--brand-cream);
  color: var(--brand-charcoal);
  font: inherit;
  font-size: var(--text-sm);
}

.q__input--text {
  min-height: 5.5rem;
  resize: vertical;
}

.q__input:focus-visible {
  border-color: var(--brand-ochre);
  outline: 2px solid var(--brand-ochre);
  outline-offset: 1px;
}

.q__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.q__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 5.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--brand-sand);
  border-radius: 999px;
  background-color: var(--brand-cream);
  color: var(--brand-forestDark);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.q__opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.q__opt:has(input:checked) {
  border-color: var(--brand-forest);
  background-color: var(--brand-forest);
  color: var(--brand-cream);
}

.q__opt:has(input:focus-visible) {
  outline: 2px solid var(--brand-ochre);
  outline-offset: 2px;
}

.q__opt--na:has(input:checked) {
  border-color: var(--brand-ochreDark);
  background-color: var(--brand-creamWarm);
  color: var(--brand-ochreDark);
}

.q__na {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--brand-sand);
  border-radius: 999px;
  background-color: var(--brand-cream);
  color: var(--brand-muted);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

.q__na[aria-pressed="true"] {
  border-color: var(--brand-ochreDark);
  background-color: var(--brand-creamWarm);
  color: var(--brand-ochreDark);
  font-weight: 650;
}

.q__item--na .q__input {
  border-style: dashed;
  border-color: var(--brand-ochreDark);
  color: var(--brand-muted);
}

.q__saved {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  color: var(--brand-muted);
  font-size: var(--text-xs);
}

.q__saved--error {
  color: var(--brand-ochreDark);
  font-weight: 650;
}

/* **Nine labelled tabs do not fit, so eight are numerals.** Measured 2026-11-15: with every
   name showing the strip needs 2 073 px and the form column is 832 px at its widest
   (`--container-prose`), so names for all of them would mean three wrapped rows of sticky
   strip. Instead the open tab carries its name and the other eight are their step numerals —
   all nine visible, nothing scrolled past, and no fade needed to say so. The full FORM
   heading is each tab's `title` and its `aria-label` names the section and its progress.

   On a phone the strip can still run past its box (`532 px` into `350`), so the fade stays
   below 640 px — where it is true. */
.q__nav-link:not([aria-current="step"]) .q__nav-title {
  display: none;
}

@media (max-width: 639px) {
  .q__nav-list {
    padding-inline: 0;
  }

  .q__nav::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2rem;
    background-image: linear-gradient(to right, transparent, var(--brand-cream));
    pointer-events: none;
  }
}

/* --- The applicant's declaration (Q7, D100) --------------------------------
   The FORM's signature line, in the last section beside the submit. The pad is a canvas with
   a printed rule under it and no other chrome: what the farmer draws is the picture that will
   print, so a frame and a label must not be mistaken for ink. Everything is one column and
   every control is at least 44 px (DESIGN §5), including `Clear` — a small "clear" is a small
   target on a phone, and it is the one control that can lose a signature. */

.sign {
  margin: 1.75rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px dashed var(--brand-sand);
}

.sign__title {
  margin: 0;
  color: var(--brand-forestDark);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
}

.sign__lede,
.sign__hatch {
  margin: 0.4rem 0 0;
  color: var(--brand-muted);
  font-size: var(--text-xs);
}

.sign__decl {
  margin: 0.75rem 0 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--brand-ochre);
  background-color: var(--brand-ochreLight);
  color: var(--brand-warmDark);
  font-size: var(--text-sm);
}

.sign__signed {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-sm);
  background-color: var(--brand-creamWarm);
  color: var(--brand-forestDark);
  font-size: var(--text-sm);
}

.sign__pad {
  margin: 0.75rem 0 0;
  padding: 0.5rem 0.5rem 0.25rem;
  border: 1px solid var(--brand-sand);
  border-radius: var(--radius-sm);
  background-color: #fffdf9;
}

/* The pad is drawn at CSS size and the backing store is scaled by `signature.js`. `touch-action`
   is what stops a finger drawing from also scrolling the page on a phone. */
.sign__canvas {
  display: block;
  width: 100%;
  height: 11rem;
  touch-action: none;
  cursor: crosshair;
}

.sign__hintline {
  margin: 0;
  padding: 0.25rem 0 0.1rem;
  border-top: 1px solid var(--brand-sand);
  color: var(--brand-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
}

.sign__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0.6rem 0 0;
  color: var(--brand-charcoal);
  font-size: var(--text-sm);
}

.sign__from {
  color: var(--brand-muted);
  font-size: var(--text-xs);
}

.sign__meta .btn {
  min-height: 44px;
}

.sign__saved {
  margin: 0.5rem 0 0;
  color: var(--brand-forest);
  font-size: var(--text-xs);
  min-height: 1.2em;
}

.sign .btn--forest {
  margin: 0.5rem 0 0;
}

/* The box is the declaration's act, so it is a label the whole line of text can be tapped on
   and not a 13 px square beside a paragraph. */
.sign__declare {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 44px;
  margin: 0.75rem 0 0;
  padding: 0.5rem 0;
  color: var(--brand-charcoal);
  font-size: var(--text-sm);
  line-height: 1.5;
  cursor: pointer;
}

.sign__declare input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
}

@media (max-width: 639px) {
  .sign__meta {
    display: block;
  }

  .sign__meta > span {
    display: block;
    margin-bottom: 0.35rem;
  }
}
