/* ==========================================================================
   BSA forms — the shared form patterns in bsa-core's shortcode output
   Markup reference: docs/shortcodes.md section 3 (and 10.3, 10.4 for how
   it maps to the design system's .bsa-field, .bsa-label, .bsa-hint,
   .bsa-error, .bsa-input and .bsa-check).
   Values from the design system's components/bundle.css.
   Needs tokens.css, typography.css and buttons.css first. Buttons get
   their looks from buttons.css; this file only places them.

   Every front-end form uses this file: login, password, join, renew,
   auto-renew, redeem, donate, buy gift, the profile editor, and the
   dashboard's account forms. profile-editor.css and member-dashboard.css
   build on it rather than restyling fields.

   Divi classes this file relies on (set in the CSS Class field):
     bsa-form-row    the row holding a form page's heading and the Code
                     module with the shortcode (narrows it to 720px)

   Specificity:
   - Divi styles bare inputs and selects ("input[type=text]" etc.) at low
     weight; the ".bsa-form …" rules here outrank them.
   - Lists, tables and links: ":not(#bsa)" (no element has that ID) adds
     an ID's weight, so these rules beat Divi's ".entry-content table",
     "tr td" and ".et-l--body ul" rules.
   - typography.css underlines links only in Text and Post Content
     modules. Shortcode output sits in Code modules, so links in running
     text here get their own underline.

   Rules this file keeps:
   - The plugin's field order is label, hint, error, control. Never
     reorder with CSS ("order", grid placement that moves things): what's
     seen would no longer match what a screen reader reads.
   - Elements scripts show and hide with the "hidden" attribute must not
     get a display rule (docs/shortcodes.md 3.15). Section 1 guards this.
   - The error icon is drawn with ::before and padding, not display:flex,
     because some error messages hold links and flex would split them.

   Breakpoints follow Divi: 980px (tablet) and 767px (phone).
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Page row and form frame
   -------------------------------------------------------------------------- */

/* A form page's row: centred, and the same width as the form, so the
   heading and intro above it line up with the fields. */
body #et-boc .et-l .et_pb_row.bsa-form-row {
	max-width: 640px;
}

/* One column of fields, 24px apart. Hidden inputs, the nonce and the
   summary's focus script are display:none, so they take no gap. */
.bsa-form {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
	max-width: 640px;          /* a form in a wide column still reads well */
	margin: 0;
	font-family: var(--font-sans);
	color: var(--ink);
}

/* Spacing comes from the gaps; drop Divi's paragraph padding (Divi
   sets only padding-bottom, so that's all this touches). */
.bsa-form p {
	padding-bottom: 0;
}

/* Scripts toggle these with the hidden attribute (3.15). */
.bsa-form [hidden],
.bsa-profile-editor [hidden] {
	display: none !important;
}

/* Fieldsets: no browser border or padding. A legend isn't a flex item,
   so it gets its own space below. */
.bsa-form fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.bsa-form legend {
	padding: 0;
}


/* --------------------------------------------------------------------------
   2. Field: label, hint, error, control (design system .bsa-field)
   -------------------------------------------------------------------------- */

.bsa-form .bsa-field {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	min-width: 0;
}

/* Label and legend: design system .bsa-label. Labels beside a checkbox
   or radio stay at body size (section 4). */
.bsa-form .bsa-field:not(.bsa-field-checkbox) > label,
.bsa-form .bsa-field > legend {
	font-size: 0.9375rem;      /* 15px */
	line-height: 20px;
	font-weight: 600;
	color: var(--ink);
}

.bsa-form .bsa-field > legend {
	margin-bottom: var(--space-2);
}

/* A plain fieldset (not a .bsa-field) groups several labelled fields,
   such as the join form's mailing address: its legend is a small heading
   (the h4 style) and its fields keep the usual 24px gaps. */
.bsa-form fieldset:not(.bsa-field) {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
}

.bsa-form fieldset:not(.bsa-field) > legend {
	margin-bottom: var(--space-4);
	font-size: 1.25rem;        /* 20px */
	line-height: 28px;
	font-weight: 600;
	color: var(--ink);
}

/* Hint: design system .bsa-hint */
.bsa-form .bsa-field-hint {
	font-size: 0.9375rem;
	line-height: 22px;
	color: var(--ink-muted);
}

/* Error: design system .bsa-error. The icon is a filled circle with an
   exclamation mark cut out (a mask, so it takes the text colour). */
.bsa-field-error {
	position: relative;
	margin: 0;
	padding: 0 0 0 26px;
	font-size: 0.9375rem;
	line-height: 22px;
	font-weight: 600;
	color: var(--danger);
}

.bsa-field-error::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 0;
	width: 18px;
	height: 18px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill-rule='evenodd' d='M9 0a9 9 0 1 0 0 18A9 9 0 1 0 9 0zM8 4h2v6.5H8zm0 8.5h2v2H8z'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill-rule='evenodd' d='M9 0a9 9 0 1 0 0 18A9 9 0 1 0 9 0zM8 4h2v6.5H8zm0 8.5h2v2H8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Links in hints and errors (the "Sign in" and "reset your password"
   links in the email error) */
.bsa-form :is(.bsa-field-hint, .bsa-field-error) a:not(#bsa) {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.bsa-form :is(.bsa-field-hint, .bsa-field-error) a:not(#bsa):hover {
	text-decoration-thickness: 2px;
}


/* --------------------------------------------------------------------------
   3. Controls: text inputs, select, textarea (design system .bsa-input)
   -------------------------------------------------------------------------- */

.bsa-form :is(input:is([type=text], [type=email], [type=tel], [type=password], [type=url], [type=number], [type=search]), select, textarea) {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 11px var(--space-4);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	background-color: var(--surface);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 1.0625rem;      /* 17px: never below 16, or phones zoom in */
	line-height: 24px;
	font-weight: 400;
	box-shadow: none;
	transition: border-color 0.15s ease;
}

.bsa-form :is(input, textarea)::placeholder {
	color: var(--ink-muted);
	opacity: 1;
}

.bsa-form :is(input:is([type=text], [type=email], [type=tel], [type=password], [type=url], [type=number], [type=search]), select, textarea):hover {
	border-color: var(--ink-muted);
}

/* :focus, not just :focus-visible: a clicked field shows the ring too. */
.bsa-form :is(input:is([type=text], [type=email], [type=tel], [type=password], [type=url], [type=number], [type=search]), select, textarea):focus {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
	border-color: var(--Blue);
}

/* Error: 2px border, padding trimmed by 1px so the text doesn't move. */
.bsa-form :is(input, select, textarea)[aria-invalid="true"] {
	border: 2px solid var(--danger);
	padding: 10px 15px;
}

/* Keep the red border while an invalid field has focus (the focus rule
   above outweighs the error rule). Same weight, later, so it wins. */
.bsa-form :is(input, select, textarea)[aria-invalid="true"]:focus {
	border-color: var(--danger);
}

.bsa-form :is(input, select, textarea):disabled {
	background-color: var(--paper);
	border-color: var(--border);
	color: var(--ink-muted);
	cursor: not-allowed;
}

/* Select: native, with an ink chevron drawn as a background image
   (a <select> can't have ::after, and there's no wrapper). */
.bsa-form select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 48px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d2033' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 16px 16px;
	cursor: pointer;
}

.bsa-form select[aria-invalid="true"] {
	padding-right: 47px;
}

.bsa-form textarea {
	min-height: 144px;
	resize: vertical;
}

/* Short answers get short boxes, so the box hints at the answer. */
.bsa-form input[autocomplete="postal-code"] {
	max-width: 12rem;
}


/* --------------------------------------------------------------------------
   4. Choices: radio and checkbox rows (design system .bsa-check-row)
   The plugin puts the input first and its label as a sibling.
   -------------------------------------------------------------------------- */

.bsa-form :is(.bsa-field-radio, .bsa-field-checkbox),
.bsa-form .bsa-field.bsa-field-checkbox {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--space-2) var(--space-3);
}

.bsa-form :is(.bsa-field-radio, .bsa-field-checkbox) > input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 4px 0 0;
	accent-color: var(--Blue);
	cursor: pointer;
}

.bsa-form :is(.bsa-field-radio, .bsa-field-checkbox) > label {
	flex: 1 1 0;
	min-width: 0;
	font-size: 1.0625rem;      /* body size, like the design system's check rows */
	line-height: 28px;
	font-weight: 400;
	color: var(--ink);
	cursor: pointer;
}

.bsa-form :is(.bsa-field-radio, .bsa-field-checkbox) > input:disabled,
.bsa-form :is(.bsa-field-radio, .bsa-field-checkbox) > input:disabled + label {
	color: var(--ink-muted);
	cursor: not-allowed;
}

/* A hint or error after the label (auto-renew) drops to its own line,
   lined up with the label text: 20px box + 12px gap. */
.bsa-form .bsa-field-checkbox > :is(.bsa-field-hint, .bsa-field-error) {
	flex-basis: 100%;
	padding-left: 32px;
}

.bsa-form .bsa-field-checkbox > .bsa-field-error::before {
	left: 32px;
}

.bsa-form .bsa-field-checkbox > .bsa-field-error {
	padding-left: 58px;        /* 32px indent + 26px for the icon */
}

/* An error that comes first in the div (close account's confirm box) sits
   above the box, not beside the label: no indent. */
.bsa-form .bsa-field-checkbox > .bsa-field-error:first-child {
	padding-left: 26px;
}

.bsa-form .bsa-field-checkbox > .bsa-field-error:first-child::before {
	left: 0;
}


/* --------------------------------------------------------------------------
   5. Error summary (top of a form whose post had errors)
   Focus is moved here by script on load, so :focus gets the ring.
   -------------------------------------------------------------------------- */

.bsa-error-summary {
	padding: var(--space-6);
	border: 2px solid var(--danger);
	border-radius: var(--radius-md);
	background: var(--surface);
	color: var(--ink);
}

.bsa-error-summary:focus,
.bsa-error-summary:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

/* An h2 for the outline, but in the h4 style (sans 20/28, 600).
   typography.css section 7 styles headings as "body.et-db #et-boc .et-l
   h2", and pages with a Theme Builder header or footer have .et-db, so
   this needs that prefix plus a class. The plain selector covers pages
   without it. */
body.et-db #et-boc .et-l .bsa-error-summary > h2,
.bsa-error-summary > h2:not(#bsa) {
	margin: 0 0 var(--space-3);
	padding: 0;
	font-family: var(--font-sans);
	font-size: 1.25rem;
	line-height: 28px;
	font-weight: 600;
	letter-spacing: normal;
	color: var(--ink);
}

.bsa-error-summary > ul:not(#bsa) {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
	line-height: 26px;
}

.bsa-error-summary > ul:not(#bsa) > li {
	margin: 0;
	padding: 0;
	font-weight: 600;
	color: var(--danger);
}

.bsa-error-summary a:not(#bsa) {
	color: var(--danger);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.bsa-error-summary a:not(#bsa):hover {
	color: var(--danger);
	text-decoration-thickness: 2px;
}


/* --------------------------------------------------------------------------
   6. Notices and plain messages (docs/shortcodes.md 3.7 and 3.8)
   Notices: a Blue-50 panel. Plain messages replace a form and stay plain
   text, but their links still need underlines (Code modules).
   -------------------------------------------------------------------------- */

.bsa-notice:not(#bsa) {
	margin: 0;
	padding: var(--space-4) var(--space-6);
	border-radius: var(--radius-md);
	background: var(--blue-50);
	color: var(--ink);
	font-size: 1.0625rem;
	line-height: 28px;
}

/* Outside a form, keep a notice off whatever follows it. */
:not(.bsa-form) > .bsa-notice:not(#bsa):not(:last-child) {
	margin-bottom: var(--space-6);
}

.bsa-notice a:not(#bsa),
:is(.bsa-signed-in, .bsa-payments-unavailable, .bsa-renew-not-member,
    .bsa-auto-renew-not-member, .bsa-redeem-not-member, .bsa-renew-nothing,
    .bsa-set-password-invalid, .bsa-set-password-other-account,
    .bsa-receipt-not-found, .bsa-receipt-void, .bsa-roster-lapsed,
    .bsa-profile-editor-missing) a:not(#bsa):not(.bsa-button) {
	color: var(--Blue);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.bsa-notice a:not(#bsa):hover,
:is(.bsa-signed-in, .bsa-payments-unavailable, .bsa-renew-not-member,
    .bsa-auto-renew-not-member, .bsa-redeem-not-member, .bsa-renew-nothing,
    .bsa-set-password-invalid, .bsa-set-password-other-account,
    .bsa-receipt-not-found, .bsa-receipt-void, .bsa-roster-lapsed,
    .bsa-profile-editor-missing) a:not(#bsa):not(.bsa-button):hover {
	color: var(--blue-700);
	text-decoration-thickness: 2px;
}


/* --------------------------------------------------------------------------
   7. Buttons and notes in forms (looks come from buttons.css)
   -------------------------------------------------------------------------- */

/* In the form's column a button would stretch full width; keep it its
   own size, at the start. */
.bsa-form > .bsa-button,
.bsa-form .bsa-form-actions > .bsa-button {
	align-self: flex-start;
}

/* Small print after the submit button, and the join form's "Been a
   member before?" line: the small style (15/24), muted. */
.bsa-form :is(.bsa-form-note, .bsa-form-links, .bsa-join-returning) {
	font-size: 0.9375rem;
	line-height: 24px;
	color: var(--ink-muted);
}

/* The note belongs to the button above it: pull it closer. */
.bsa-form > .bsa-button + .bsa-form-note,
.bsa-form > .bsa-button + .bsa-form-links {
	margin-top: calc(var(--space-2) - var(--space-6));
}

.bsa-form :is(.bsa-form-note, .bsa-form-links, .bsa-join-returning) a:not(#bsa) {
	color: var(--Blue);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.bsa-form :is(.bsa-form-note, .bsa-form-links, .bsa-join-returning) a:not(#bsa):hover {
	color: var(--blue-700);
	text-decoration-thickness: 2px;
}


/* --------------------------------------------------------------------------
   8. Composite fields: donation, gift code, amount due, Turnstile
   -------------------------------------------------------------------------- */

/* 8.1 Donation (3.12). The Other amount field sits under the "Other
   amount" radio, lined up with the radio labels. */
.bsa-form .bsa-donation-other {
	padding-left: 32px;
	margin-top: var(--space-2);
}

.bsa-form .bsa-donation-other > input {
	max-width: 12rem;
}

/* 8.2 Gift code (3.13): input and Apply on one row. A wrapping flex row
   keeps the source order: label, hint, error and result each take a full
   line; the input and the button share the last one. (A grid was tried
   first: the long hint, spanning both columns, widened the button's.) */
.bsa-form .bsa-gift-code {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--space-2) var(--space-3);
}

.bsa-form .bsa-gift-code > :not(input):not(button) {
	flex-basis: 100%;
}

/* Grows to 20rem; on a phone it shrinks so Apply stays beside it. */
.bsa-form .bsa-gift-code > input {
	flex: 1 1 10rem;
	max-width: 20rem;
}

.bsa-form .bsa-gift-code > button {
	flex: none;
}

/* A good code: success colour, a check icon, and words that say so. */
.bsa-form .bsa-gift-applied {
	position: relative;
	padding-left: 26px;
	font-size: 0.9375rem;
	line-height: 22px;
	font-weight: 600;
	color: var(--success);
}

.bsa-form .bsa-gift-applied::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 0;
	width: 18px;
	height: 18px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill-rule='evenodd' d='M9 0a9 9 0 1 0 0 18A9 9 0 1 0 9 0zM4.6 9.3l1.4-1.4 2 2 4.1-4.3 1.4 1.4-5.5 5.7z'/%3E%3C/svg%3E") center / contain no-repeat;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill-rule='evenodd' d='M9 0a9 9 0 1 0 0 18A9 9 0 1 0 9 0zM4.6 9.3l1.4-1.4 2 2 4.1-4.3 1.4 1.4-5.5 5.7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 8.3 Amount due (3.14): a Paper panel with the breakdown table and the
   live total sentence. */
.bsa-form :is(.bsa-join-total, .bsa-renew-total) {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	padding: var(--space-6);
	border-radius: var(--radius-md);
	background: var(--paper);
}

.bsa-form :is(.bsa-join-breakdown, .bsa-renew-breakdown):not(#bsa) {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.bsa-form :is(.bsa-join-breakdown, .bsa-renew-breakdown):not(#bsa) caption {
	caption-side: top;
	padding: 0 0 var(--space-2);
	text-align: left;
	font-size: 1.25rem;        /* h4 style */
	line-height: 28px;
	font-weight: 600;
	color: var(--ink);
}

.bsa-form :is(.bsa-join-breakdown, .bsa-renew-breakdown):not(#bsa) :is(th, td) {
	padding: var(--space-2) 0;
	border: 0;
	border-bottom: 1px solid var(--border);
	background: none;
	font-size: 1.0625rem;
	line-height: 26px;
	font-weight: 400;
	color: var(--ink);
	vertical-align: top;
}

.bsa-form :is(.bsa-join-breakdown, .bsa-renew-breakdown):not(#bsa) th {
	padding-right: var(--space-4);
	text-align: left;
}

.bsa-form :is(.bsa-join-breakdown, .bsa-renew-breakdown):not(#bsa) td {
	text-align: right;
	white-space: nowrap;
}

/* 8.4 Turnstile (3.11): Cloudflare's iframe can't be styled. Reserve its
   height so the page doesn't jump when it loads. */
.bsa-form .bsa-turnstile .cf-turnstile {
	min-height: 65px;
}


/* --------------------------------------------------------------------------
   9. Per-form extras
   Join, login, forgot/set password, donate and buy gift need nothing
   beyond 1–8.
   -------------------------------------------------------------------------- */

/* 9.1 Renew (5.2): the member's status as a Paper panel above the form
   (or alone, when renewals aren't open yet). */
.bsa-renew-status {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	max-width: 640px;            /* the form's width */
	margin: 0 0 var(--space-8);
	padding: var(--space-6);
	border-radius: var(--radius-md);
	background: var(--paper);
}

.bsa-renew-status > p:not(#bsa) {
	margin: 0;
	padding: 0;
}

/* "Back to your dashboard" after the renew thank-you */
.bsa-renew-back a:not(#bsa) {
	color: var(--Blue);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

/* 9.2 Auto-renew (5.3): status lines, then the button form. When it's
   on there are two buttons (Change card, Turn off): side by side, and
   they wrap on a phone. The note under them takes its own line. */
.bsa-auto-renew {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	max-width: 640px;
}

/* When it shares a Code module with [bsa_renew], keep it off whatever
   the renew shortcode printed (form, status, thank-you and its link). */
:is(.bsa-form, .bsa-renew-status, .bsa-renew-nothing, .bsa-renew-back, .bsa-notice) ~ .bsa-auto-renew {
	margin-top: var(--space-12);
}

.bsa-auto-renew > p:not(#bsa) {
	margin: 0;
	padding: 0;
}

.bsa-auto-renew > p > a:not(#bsa) {
	color: var(--Blue);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

.bsa-form.bsa-auto-renew-form {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--space-2) var(--space-3);
	margin-top: var(--space-2);
}

.bsa-form.bsa-auto-renew-form > .bsa-form-note {
	flex-basis: 100%;
}

.bsa-form.bsa-auto-renew-form > .bsa-button + .bsa-form-note {
	margin-top: 0;               /* the row gap is already 8px */
}

/* 9.3 Redeem gift (5.4): codes are short (BSA-ABCD-2345). */
.bsa-redeem-form input {
	max-width: 20rem;
}


/* --------------------------------------------------------------------------
   10. Receipt (5.7): a bordered sheet, details as two columns, and a
   print version without the site header, breadcrumbs or footer.
   Page 26 uses the bsa-form-row row like the forms.
   -------------------------------------------------------------------------- */

.bsa-receipt {
	padding: var(--space-8);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
	color: var(--ink);
}

.bsa-receipt > p:not(#bsa) {
	margin: 0;
	padding: 0;
}

/* The organisation's name and address, from settings */
.bsa-receipt > .bsa-receipt-org:not(#bsa) {
	margin-bottom: var(--space-6);
	font-size: 0.9375rem;
	line-height: 24px;
	color: var(--ink-muted);
}

/* An h2 for the outline, sized like the design system's h3 (25/32). */
body.et-db #et-boc .et-l .bsa-receipt-title,
.bsa-receipt-title:not(#bsa) {
	margin: 0 0 var(--space-6);
	padding: 0;
	font-size: 1.5625rem;
	line-height: 32px;
}

.bsa-receipt-details {
	display: grid;
	grid-template-columns: minmax(8rem, max-content) 1fr;
	margin: 0;
	border-top: 1px solid var(--border);
}

.bsa-receipt-details > :is(dt, dd) {
	margin: 0;
	padding: var(--space-3) 0;
	border-bottom: 1px solid var(--border);
	line-height: 26px;
}

.bsa-receipt-details > dt {
	padding-right: var(--space-6);
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ink-muted);
}

.bsa-receipt-details > dd {
	font-variant-numeric: tabular-nums;
}

/* The tax note, from settings */
.bsa-receipt > .bsa-receipt-note:not(#bsa) {
	margin-top: var(--space-6);
	font-size: 0.9375rem;
	line-height: 24px;
	color: var(--ink-muted);
}

@media print {
	/* Only on a page holding a receipt: drop the site around it. */
	body:has(.bsa-receipt) :is(.et-l--header, .et-l--footer, #main-header, #top-header, #main-footer, .bsa-breadcrumbs, nav[aria-label="Breadcrumb"]) {
		display: none !important;
	}

	body:has(.bsa-receipt) #page-container {
		padding-top: 0 !important;
	}

	body:has(.bsa-receipt) #et-boc .et-l .et_pb_section {
		padding: 0 !important;
	}

	.bsa-receipt {
		padding: 0;
		border: 0;
	}
}


/* --------------------------------------------------------------------------
   11. Phone (767px and narrower)
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
	.bsa-error-summary,
	.bsa-form :is(.bsa-join-total, .bsa-renew-total),
	.bsa-renew-status {
		padding: var(--space-4);
	}

	.bsa-receipt {
		padding: var(--space-6) var(--space-4);
	}

	/* Details stack: label over value. */
	.bsa-receipt-details {
		grid-template-columns: 1fr;
	}

	.bsa-receipt-details > dt {
		padding-bottom: 0;
		border-bottom: 0;
	}

	.bsa-receipt-details > dd {
		padding-top: var(--space-1);
	}

	.bsa-notice:not(#bsa) {
		padding: var(--space-3) var(--space-4);
	}
}


/* --------------------------------------------------------------------------
   12. Forced colours (Windows High Contrast): masks draw with a
   background colour, which forced colours removes. Keep the icons.
   -------------------------------------------------------------------------- */

@media (forced-colors: active) {
	.bsa-field-error::before,
	.bsa-form .bsa-gift-applied::before {
		forced-color-adjust: none;
		background-color: CanvasText;
	}
}
