/* Lead capture card for the /tools/ pages (TRLDL-201). External on purpose:
   the prod/QA CSP has no 'unsafe-inline' for scripts, and one stylesheet beats
   one copy per page. Uses the pages' own custom properties (--brand, --ink, --muted,
   --line, --card) so it inherits each page's palette. Cache-busted by ?v=.

   WHICH TOKEN A RULE MAY USE DEPENDS ON WHETHER IT PAINTS TEXT.
   --brand (#0282C8) is 4.18:1 on white and --good (#1a8f5e) is 4.09:1. Both
   clear the 3:1 that WCAG 1.4.11 asks of a border or a focus ring, and
   NEITHER clears the 4.5:1 that 1.4.3 asks of text below 18.66px bold /
   24px regular. Every piece of text in this widget is below that threshold:
   the submit button is 16px/600, the consent link 0.85rem, the status line
   0.9rem. So text here uses --brand-dark (#026aa3, 5.84:1) and --good-ink
   (#14653f, 7.09:1), while --brand stays on the focus outline where 3:1 is
   the bar. The tool pages make the same distinction in their own <style>
   blocks and say so in a comment; this file did not, and shipped three
   AA failures on all seven pages until 2026-10-05. Do not put --brand or
   --good back on a text colour. `toolsLeadCaptureContrast.test.ts`
   recomputes every ratio below and fails the build.

   A CONTROL'S BORDER IS NOT A DECORATIVE RULE, and this file had them on the
   same token until 2026-10-17. --line (#dfe8ee) is 1.24:1 on white, which is
   fine for the CARD edge below and fails 1.4.11 for the email field and the
   select, whose border is all that marks them as fields on a white card.
   Those two now use --line-control (#7a8c9e, 3.46:1 on #fff and 3.24:1 on the
   --bg page colour); the card keeps --line. The fallback literal matters
   here: this widget is injected into pages that define the token, but the
   fallback is what paints if one ever does not. */
.rdp-lead { background: var(--card, #fff); border: 1px solid var(--line, #dfe8ee); border-radius: 14px; padding: 20px 22px; margin: 28px 16px 0; max-width: 760px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); }
@media (min-width: 792px) { .rdp-lead { margin-left: auto; margin-right: auto; } }
.rdp-lead__done h2:focus { outline: none; }
.rdp-lead h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--ink, #1a2733); }
.rdp-lead p { margin: 0 0 14px; color: var(--muted, #5b6b78); font-size: 0.95rem; line-height: 1.5; }
.rdp-lead__row { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .rdp-lead__row { grid-template-columns: 1fr 1fr; } }
.rdp-lead label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink, #1a2733); margin-bottom: 4px; }
.rdp-lead input[type="email"], .rdp-lead select { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line-control, #7a8c9e); border-radius: 8px; font: inherit; color: var(--ink, #1a2733); background: #fff; }
.rdp-lead input[type="email"]:focus, .rdp-lead select:focus { outline: 2px solid var(--brand, #0282C8); outline-offset: 1px; }
.rdp-lead__consent { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 14px; font-size: 0.85rem; color: var(--muted, #5b6b78); line-height: 1.45; }
.rdp-lead__consent input { margin-top: 3px; flex: none; }
.rdp-lead__consent a { color: var(--brand-dark, #026aa3); }
.rdp-lead button { background: var(--brand-dark, #026aa3); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.rdp-lead button:hover { background: var(--brand-darker, #01527f); }
.rdp-lead button[disabled] { opacity: 0.6; cursor: default; }
.rdp-lead__status { margin: 10px 0 0; font-size: 0.9rem; min-height: 1.2em; }
/* `p.` IS LOAD-BEARING, do not simplify these two back to a single class.
   lead-capture.js builds the status line as a <p> inside .rdp-lead, so
   `.rdp-lead p { color: var(--muted) }` above (specificity 0,1,1) beat a bare
   `.rdp-lead__status--err` (0,1,0) and BOTH state colours were dead from the
   day they were written: a failed submission's message rendered in body grey
   instead of red, which is the one message on the card a reader has to notice.
   Qualifying with the element type takes these to 0,2,1. Guarded by
   toolsLeadCaptureContrast.test.ts, which resolves the cascade rather than
   reading the declaration. */
.rdp-lead p.rdp-lead__status--ok { color: var(--good-ink, #14653f); }
.rdp-lead p.rdp-lead__status--err { color: #b42318; }
.rdp-lead__hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
