/* ============================================================
   GEM — shared form feedback (2026-10). Loaded AFTER styles.css on the
   pages that carry a form (member profile, member story, contributor
   portal, contact, registration, Share Your Story, sign-in). Existing
   tokens only; nothing here touches the header, menu or layout.

   1. Consent panel: a helper line above the box (the site's .field__hint
      look), a 24 px purple checkbox with a 44 px hit area, and a
      "confirmed" state once ticked (purple border, soft lavender tint,
      a small ✓ line under the text). Unticking returns to neutral.
   ============================================================ */

/* ---- 1. Consent panel ---------------------------------------------------- */
.consent-field .consent__help { margin: 0 0 0.5rem; }        /* .field__hint carries the look */

.consent { flex-wrap: wrap; }                                 /* room for the ✓ line under the text */
.consent input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  margin: 0.1rem 0.9rem 0 0;
  border: 2px solid var(--purple);
  border-radius: 6px;
  background: var(--white);
  accent-color: var(--purple);
  cursor: pointer;
}
/* 44 px tap target: an invisible 10 px halo around the 24 px box. */
.consent input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: -10px; right: -10px; bottom: -10px; left: -10px;
}
.consent input[type="checkbox"]:hover { border-color: var(--purple-bright); }
.consent input[type="checkbox"]:checked {
  background: var(--purple);
  border-color: var(--purple);
}
/* The tick: a rotated white corner. Shape + fill, so the state never
   rests on colour alone. */
.consent input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid var(--white);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.consent input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--purple-bright);                    /* 6.5:1 on white */
  outline-offset: 2px;
}
.consent label { cursor: pointer; flex: 1 1 0; min-width: 0; }

/* Confirmed state (toggled by form-feedback.js on the .consent-field). */
.consent__confirmed {
  flex: 0 0 100%;
  margin: 0.55rem 0 0;
  padding-left: calc(24px + 0.9rem);                          /* aligns under the label text */
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--purple);                                       /* 11.4:1 on lavender-light */
}
.consent__confirmed[hidden] { display: none; }
.consent-field.is-confirmed .consent {
  border-color: var(--purple);
  background: var(--lavender-light);
}

/* ---- 2. Error state (form-feedback.js marks the .field) ------------------
   Red-toned border from the site's existing red token (--guide-help,
   #9B1C1C: 8.2:1 on white, 7.5:1 on lavender-light), plus the short note
   under the field - so the colour is never the only signal. */
.field.has-error input,
.field.has-error textarea,
.field.has-error select { border-color: var(--guide-help); }
.field.has-error .consent,
.field.has-error.consent-field .consent { border-color: var(--guide-help); }
.field.has-error .consent input[type="checkbox"]:not(:checked) { border-color: var(--guide-help); }
.field.has-error > .choice { border-color: var(--guide-help); }      /* a radio group: its option cards */
.field.has-error .field__error { color: var(--guide-help); }

/* ---- 3. The banner's list: one line per missing item, each a button that
   goes to its field (44 px rows, link look, inherits the banner's colour). */
.form-status__list { margin: 0; padding: 0; list-style: none; }
.form-status__list li { margin: 0; }
.form-status__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}
.form-status__link:hover { text-decoration-thickness: 2px; }
.form-status__link:focus-visible { outline: 3px solid var(--purple-bright); outline-offset: 2px; border-radius: 4px; }

/* The contact page's summary card keeps its own quiet look; its lines take
   the card's purple-deep weight. */
.contact2__errsum .form-status__link { color: var(--purple-deep); font-weight: 600; }
