/* =====================================================================
   CiviCRM UI Boost – CiviCRM public forms for the Kadence theme.
   Membership / contribution forms, review and thank-you pages.

   Written for CiviCRM's front-end theme set to "None (Unstyled)".
   Colours and fonts come from Kadence's global palette, so the forms
   follow any changes you make to the theme's colours.
   Setting: CiviCRM → UI Boost → Form styling.
   ===================================================================== */

/* ---------- Basics ---------- */

#crm-container.crm-public {
	--aln-radius: 8px;
	--aln-border: var(--global-palette7, #e2e8f0);
	--aln-accent: var(--global-palette1, #2b6cb0);
	--aln-text: var(--global-palette3, #1a202c);
	--aln-muted: var(--global-palette5, #4a5568);

	/* Higher-contrast colours for form fields (easier to read) */
	--aln-field-border: #6b7280; /* ~4.8:1 against white */
	--aln-field-text: #111827;
	--aln-placeholder: #4b5563;
	--aln-soft-bg: var(--global-palette8, #f7fafc);
	--aln-error: #c53030;

	max-width: 760px;
	color: var(--aln-text);
	font-family: inherit;
	font-size: 1.0625rem;
	line-height: 1.5;
}

/* CiviCRM's float-clearing helpers are not needed with this layout */
#crm-container.crm-public .clear {
	display: none;
}

/* Elements CiviCRM shows and hides with JavaScript
   (e.g. the Total Amount line before a membership is chosen) */
#crm-container.crm-public .hiddenElement {
	display: none;
}

/* Spacing between the main blocks of the form */
#crm-container.crm-public .crm-public-form-item {
	margin: 0 0 2rem;
}

/* Empty blocks (premiums, on-behalf, CMS user) take no space */
#crm-container.crm-public .crm-public-form-item:empty,
#crm-container.crm-public #on-behalf-block:empty,
#crm-container.crm-public #payment_information:empty {
	display: none;
	margin: 0;
}

/* ---------- Section cards and headings ---------- */

#crm-container.crm-public fieldset {
	margin: 0;
	padding: 1.75rem;
	background: #fff;
	border: 1px solid var(--aln-border);
	border-radius: 12px;
	min-width: 0; /* Lets long content shrink inside the card. */
}

#crm-container.crm-public legend {
	float: left; /* Places the legend inside the card instead of on its border. */
	width: 100%;
	margin: 0 0 1.25rem;
	padding: 0;
	font-family: var(--global-heading-font-family, inherit);
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--aln-text);
}

#crm-container.crm-public legend + * {
	clear: both;
}

/* ---------- Labels and fields ---------- */

/* Stack each label above its field */
#crm-container.crm-public .crm-section {
	margin: 0 0 1.25rem;
}

/* No extra gap at the bottom of the membership card */
#crm-container.crm-public .price_set-section,
#crm-container.crm-public .membership_amount-section {
	margin-bottom: 0;
}

#crm-container.crm-public .crm-section > .label {
	display: block;
	margin: 0 0 0.35rem;
	font-weight: 600;
	font-size: 1rem;
	color: var(--aln-field-text);
}

#crm-container.crm-public .crm-section > .label label {
	font-weight: inherit;
}

/* Required-field asterisk */
#crm-container.crm-public .crm-marker {
	color: var(--aln-error);
	margin-left: 0.15em;
	text-decoration: none;
	border: 0;
}

/* Text inputs, text areas and selects fill the column */
#crm-container.crm-public input[type="text"],
#crm-container.crm-public input[type="email"],
#crm-container.crm-public input[type="tel"],
#crm-container.crm-public input[type="number"],
#crm-container.crm-public textarea,
#crm-container.crm-public select {
	width: 100%;
	max-width: 100%;
	padding: 0.6em 0.8em;
	background: #fff;
	border: 2px solid var(--aln-field-border);
	border-radius: var(--aln-radius);
	color: var(--aln-field-text);
	font: inherit;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#crm-container.crm-public ::placeholder {
	color: var(--aln-placeholder);
	opacity: 1;
}

#crm-container.crm-public textarea {
	min-height: 7rem;
	resize: vertical;
}

#crm-container.crm-public input:focus,
#crm-container.crm-public textarea:focus,
#crm-container.crm-public select:focus {
	outline: none;
	border-color: var(--aln-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--aln-accent) 35%, transparent);
}

/* Short fields stay short */
#crm-container.crm-public input.six {
	max-width: 10rem;
}

/* ---------- Two-column layout for name and address ---------- */

#crm-container.crm-public fieldset.crm-profile {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 1.25rem;
}

/* Everything spans both columns by default... */
#crm-container.crm-public fieldset.crm-profile > * {
	grid-column: 1 / -1;
}

/* ...except these pairs, which sit side by side */
#crm-container.crm-public fieldset.crm-profile > #editrow-first_name,
#crm-container.crm-public fieldset.crm-profile > #editrow-last_name,
#crm-container.crm-public fieldset.crm-profile > #editrow-city-1,
#crm-container.crm-public fieldset.crm-profile > #editrow-postal_code-1,
#crm-container.crm-public fieldset.crm-profile > #editrow-country-1,
#crm-container.crm-public fieldset.crm-profile > #editrow-state_province-1 {
	grid-column: auto;
}

/* ---------- Membership options as selectable cards ---------- */

#crm-container.crm-public .membership_amount-content {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
}

#crm-container.crm-public .price-set-row,
#crm-container.crm-public .price-set-option-content {
	display: block;
	height: 100%;
}

#crm-container.crm-public .price-set-row .crm-option-label-pair {
	position: relative;
	height: 100%;
}

/* Hide the radio button visually but keep it usable for keyboards and screen readers */
#crm-container.crm-public .price-set-row input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

#crm-container.crm-public .price-set-row label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	height: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 1rem 1.1rem 1rem 3rem;
	background: #fff;
	border: 2px solid var(--aln-field-border);
	border-radius: 10px;
	cursor: pointer;
	position: relative;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

/* Custom radio circle */
#crm-container.crm-public .price-set-row label::before {
	content: "";
	position: absolute;
	left: 1.1rem;
	top: 1.15rem;
	width: 1.1rem;
	height: 1.1rem;
	border: 2px solid var(--aln-field-border);
	border-radius: 50%;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#crm-container.crm-public .price-set-row label:hover {
	border-color: color-mix(in srgb, var(--aln-accent) 50%, var(--aln-field-border));
}

/* Selected option */
#crm-container.crm-public .price-set-row input:checked + label {
	border-color: var(--aln-accent);
	background: color-mix(in srgb, var(--aln-accent) 6%, #fff);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#crm-container.crm-public .price-set-row input:checked + label::before {
	border-color: var(--aln-accent);
	box-shadow: inset 0 0 0 0.22rem #fff;
	background: var(--aln-accent);
}

#crm-container.crm-public .price-set-row input:focus-visible + label {
	outline: 3px solid color-mix(in srgb, var(--aln-accent) 35%, transparent);
	outline-offset: 2px;
}

/* Option name and price */
#crm-container.crm-public .crm-price-amount-label {
	font-weight: 600;
	line-height: 1.3;
}

#crm-container.crm-public .crm-price-amount-label-separator {
	display: none;
}

#crm-container.crm-public .crm-price-amount-amount {
	font-family: var(--global-heading-font-family, inherit);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--aln-accent);
}

/* Total amount line */
#crm-container.crm-public #pricesetTotal:not(.hiddenElement) {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin: 1.25rem 0 0;
	padding: 0.9rem 1.1rem;
	background: var(--aln-soft-bg);
	border-radius: var(--aln-radius);
}

#crm-container.crm-public #pricesetTotal .label {
	margin: 0;
	font-weight: 600;
}

#crm-container.crm-public #pricevalue {
	font-size: 1.2rem;
	font-weight: 700;
}

/* ---------- Email block (sits outside the profile card) ---------- */

#crm-container.crm-public .email-5-section {
	padding: 1.25rem 1.75rem;
	background: #fff;
	border: 1px solid var(--aln-border);
	border-radius: 12px;
}

/* ---------- Checkbox and radio groups ---------- */

#crm-container.crm-public .crm-multiple-checkbox-radio-options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem 1.25rem;
}

#crm-container.crm-public .crm-multiple-checkbox-radio-options .crm-option-label-pair {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
}

#crm-container.crm-public .crm-form-checkbox,
#crm-container.crm-public .crm-form-radio {
	flex: 0 0 auto;
	width: 1.3rem;
	height: 1.3rem;
	margin: 0.2rem 0 0;
	accent-color: var(--aln-accent);
	cursor: pointer;
}

#crm-container.crm-public .crm-multiple-checkbox-radio-options label {
	margin: 0;
	font-weight: 400;
	color: var(--aln-field-text);
	cursor: pointer;
}

/* ---------- Yes/No toggles ---------- */

#crm-container.crm-public .crm-form-toggle-container {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
}

#crm-container.crm-public .crm-form-toggle {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	width: 2.75rem;
	height: 1.5rem;
	margin: 0;
	background: var(--aln-field-border);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.2s ease;
}

#crm-container.crm-public .crm-form-toggle::after {
	content: "";
	position: absolute;
	top: 0.2rem;
	left: 0.2rem;
	width: 1.1rem;
	height: 1.1rem;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
	transition: transform 0.2s ease;
}

#crm-container.crm-public .crm-form-toggle:checked {
	background: var(--aln-accent);
}

#crm-container.crm-public .crm-form-toggle:checked::after {
	transform: translateX(1.25rem);
}

#crm-container.crm-public .crm-form-toggle:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--aln-accent) 35%, transparent);
	outline-offset: 2px;
}

/* Show only "Yes" or "No", matching the toggle */
#crm-container.crm-public .crm-form-toggle:checked ~ .crm-form-toggle-text-off,
#crm-container.crm-public .crm-form-toggle:not(:checked) ~ .crm-form-toggle-text-on {
	display: none;
}

#crm-container.crm-public .crm-form-toggle-text {
	font-size: 1rem;
	font-weight: 600;
	color: var(--aln-field-text);
}

/* ---------- Searchable dropdowns (Country, State) ---------- */

#crm-container.crm-public .select2-container {
	display: block;
	width: 100% !important;
}

#crm-container.crm-public .select2-choice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 2.75rem;
	padding: 0.5em 0.8em;
	background: #fff;
	border: 2px solid var(--aln-field-border);
	border-radius: var(--aln-radius);
	color: var(--aln-field-text);
	text-decoration: none;
	cursor: pointer;
}

#crm-container.crm-public .select2-choice.select2-default .select2-chosen {
	color: var(--aln-placeholder);
}

#crm-container.crm-public .select2-container-active .select2-choice,
#crm-container.crm-public .select2-dropdown-open .select2-choice {
	border-color: var(--aln-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--aln-accent) 35%, transparent);
}

#crm-container.crm-public .select2-search-choice-close {
	display: none;
}

/* Down arrow */
#crm-container.crm-public .select2-arrow {
	width: 0.55rem;
	height: 0.55rem;
	margin-left: 0.75rem;
	border-right: 2px solid var(--aln-field-text);
	border-bottom: 2px solid var(--aln-field-text);
	transform: rotate(45deg) translateY(-25%);
}

#crm-container.crm-public .select2-arrow b {
	display: none;
}

/* Screen-reader-only helpers */
#crm-container.crm-public .select2-offscreen,
.select2-drop.crm-public .select2-offscreen {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* The open list (CiviCRM moves it to the end of the page) */
.select2-drop.crm-public {
	position: absolute;
	z-index: 100000;
	margin-top: 4px;
	padding: 0.5rem;
	background: #fff;
	border: 1px solid var(--global-palette7, #e2e8f0);
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
	font-family: var(--global-body-font-family, inherit);
}

.select2-drop.crm-public.select2-display-none {
	display: none;
}

.select2-drop.crm-public .select2-search input {
	width: 100%;
	margin: 0 0 0.4rem;
	padding: 0.5em 0.7em;
	border: 2px solid #6b7280;
	border-radius: 6px;
	box-sizing: border-box;
}

.select2-drop.crm-public .select2-results {
	max-height: 16rem;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
}

.select2-drop.crm-public .select2-results li {
	margin: 0;
	list-style: none;
}

.select2-drop.crm-public .select2-result-label {
	padding: 0.5em 0.7em;
	color: #111827;
	font-size: 1.0625rem;
	border-radius: 5px;
	cursor: pointer;
}

.select2-drop.crm-public .select2-highlighted .select2-result-label {
	background: var(--global-palette1, #2b6cb0);
	color: #fff;
}

.select2-drop.crm-public .select2-no-results,
.select2-drop.crm-public .select2-searching {
	padding: 0.45em 0.7em;
	color: var(--global-palette5, #4a5568);
}

/* ---------- Validation errors ---------- */

#crm-container.crm-public input.error,
#crm-container.crm-public textarea.error,
#crm-container.crm-public select.error,
#crm-container.crm-public .crm-error .select2-choice {
	border-color: var(--aln-error);
}

#crm-container.crm-public label.error,
#crm-container.crm-public .crm-inline-error,
#crm-container.crm-public span.crm-error {
	display: block;
	margin-top: 0.3rem;
	font-size: 0.875rem;
	font-weight: 400;
	color: var(--aln-error);
}

/* Error summary box at the top of the form */
#crm-container.crm-public .messages.crm-error,
#crm-container.crm-public #errorList {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	background: #fff5f5;
	border: 1px solid #feb2b2;
	border-radius: var(--aln-radius);
	color: var(--aln-error);
}

/* ---------- Submit button ---------- */

#crm-container.crm-public .crm-submit-buttons {
	margin: 2rem 0 0;
	padding: 0;
	border: 0;
}

/* Buttons match the site's Kadence buttons: square-ish corners (3px),
   small uppercase text with letter spacing, generous padding.
   Hover = the same colour, darkened, plus the site's hard offset shadow. */
#crm-container.crm-public .crm-submit-buttons .crm-button {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: calc(var(--global-kb-spacing-xs, 1rem) - 2px) calc(var(--global-kb-spacing-sm, 1.5rem) - 2px); /* Minus the 2px border */
	background: var(--aln-accent);
	border: 2px solid transparent; /* Same height as the outlined Go Back button. */
	border-radius: 3px;
	box-shadow: none;
	color: #fff;
	font-family: inherit;
	font-size: var(--global-kb-font-size-sm, 0.9rem);
	font-weight: 600;
	letter-spacing: 1px;
	line-height: 1.6;
	text-transform: uppercase;
	cursor: pointer;
	transition: all 0.2s ease;
}

#crm-container.crm-public .crm-submit-buttons .crm-button:hover,
#crm-container.crm-public .crm-submit-buttons .crm-button:focus-visible {
	background: color-mix(in srgb, var(--aln-accent) 80%, #000); /* Darker accent */
	box-shadow: 8px 8px 0 0 var(--global-palette4, #2D3748); /* Hard shadow, as on the site's buttons */
	color: #fff;
}

#crm-container.crm-public .crm-submit-buttons .crm-button:focus-visible {
	outline: 2px solid var(--aln-accent);
	outline-offset: 2px;
}

/* The arrow icon needs CiviCRM's icon font, which may not load with
   the unstyled theme. Hidden so an empty box doesn't appear. */
#crm-container.crm-public .crm-submit-buttons .crm-i {
	display: none;
}

/* ---------- Payment options ---------- */

/* When "pay later" is the only option, CiviCRM shows it as
   "[x] Bank Deposit" (the label is set under Amounts → Pay later label).
   It's styled as an already-selected option. */
#crm-container.crm-public .pay_later-group .pay_later_receipt-section {
	margin: 0;
	padding: 1rem 1.1rem 1rem 3rem;
	position: relative;
	background: color-mix(in srgb, var(--aln-accent) 6%, #fff);
	border: 2px solid var(--aln-accent);
	border-radius: 10px;
	font-weight: 600;
	color: var(--aln-field-text);
}

/* Filled radio dot, matching the membership options */
#crm-container.crm-public .pay_later-group .pay_later_receipt-section::before {
	content: "";
	position: absolute;
	left: 1.1rem;
	top: 50%;
	width: 1.1rem;
	height: 1.1rem;
	margin-top: -0.55rem;
	border: 2px solid var(--aln-accent);
	border-radius: 50%;
	background: var(--aln-accent);
	box-shadow: inset 0 0 0 0.22rem #fff;
}

/* Empty label column */
#crm-container.crm-public .pay_later-group .pay_later_receipt-section > .label {
	display: none;
}

/* Choice between several payment methods (e.g. Stripe or pay later) */
#crm-container.crm-public .payment_processor-section .crm-option-label-pair,
#crm-container.crm-public .payment_options-group .crm-option-label-pair {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.5rem;
	padding: 0.85rem 1rem;
	background: #fff;
	border: 2px solid var(--aln-field-border);
	border-radius: 10px;
	cursor: pointer;
}

#crm-container.crm-public .payment_processor-section .crm-option-label-pair:has(input:checked),
#crm-container.crm-public .payment_options-group .crm-option-label-pair:has(input:checked) {
	border-color: var(--aln-accent);
	background: color-mix(in srgb, var(--aln-accent) 6%, #fff);
}

#crm-container.crm-public .payment_processor-section .crm-option-label-pair label,
#crm-container.crm-public .payment_options-group .crm-option-label-pair label {
	margin: 0;
	font-weight: 600;
	cursor: pointer;
}

#crm-container.crm-public .payment_processor-section input[type="radio"],
#crm-container.crm-public .payment_options-group input[type="radio"] {
	width: 1.2rem;
	height: 1.2rem;
	margin: 0;
	accent-color: var(--aln-accent);
}

/* ---------- Introduction and footer text ---------- */

/* Introduction text above the form (page settings: "Introductory Message") */
#crm-container.crm-public .intro_text-section {
	margin: 0 0 2rem;
	padding: 1.25rem 1.5rem;
	background: var(--aln-soft-bg);
	border-left: 4px solid var(--aln-accent);
	border-radius: 0 12px 12px 0;
	font-size: 1.125rem;
	line-height: 1.6;
	color: var(--aln-field-text);
}

/* Footer text below the submit button (page settings: "Footer Message") */
#crm-container.crm-public .contribution_footer_text-section {
	margin: 2rem 0 0;
	padding: 1.25rem 0 0;
	border-top: 1px solid var(--aln-border);
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--aln-muted);
}

/* Shared formatting for text typed in CiviCRM's editor */
#crm-container.crm-public :is(.intro_text-section, .contribution_footer_text-section) p {
	margin: 0 0 0.75em;
}

#crm-container.crm-public :is(.intro_text-section, .contribution_footer_text-section) > :last-child {
	margin-bottom: 0;
}

/* CiviCRM's editor often adds empty paragraphs; don't let them add space */
#crm-container.crm-public :is(.intro_text-section, .contribution_footer_text-section) p:empty {
	display: none;
}

#crm-container.crm-public :is(.intro_text-section, .contribution_footer_text-section) :is(h2, h3, h4) {
	margin: 0 0 0.5em;
	font-family: var(--global-heading-font-family, inherit);
	line-height: 1.3;
	color: var(--aln-text);
}

#crm-container.crm-public :is(.intro_text-section, .contribution_footer_text-section) :is(ul, ol) {
	margin: 0 0 0.75em;
	padding-left: 1.4em;
}

#crm-container.crm-public :is(.intro_text-section, .contribution_footer_text-section) li {
	margin: 0 0 0.3em;
}

#crm-container.crm-public :is(.intro_text-section, .contribution_footer_text-section) a {
	color: var(--aln-accent);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

#crm-container.crm-public :is(.intro_text-section, .contribution_footer_text-section) img {
	max-width: 100%;
	height: auto;
	border-radius: var(--aln-radius);
}

/* Hide either section completely when it has no text */
#crm-container.crm-public :is(.intro_text-section, .contribution_footer_text-section):not(:has(:not(p:empty))) {
	display: none;
}

/* ---------- Logged-in visitors ---------- */

/* "Welcome Jane Smith. (Not Jane Smith, or want to do this for a different person?)" */
#crm-container.crm-public .messages.status.crm-not-you-message {
	margin: 0 0 1.5rem;
	padding: 0.75rem 1rem;
	background: #fff;
	border: 1px solid var(--aln-border);
	border-radius: var(--aln-radius);
	font-size: 0.95rem;
	color: var(--aln-muted);
}

#crm-container.crm-public .crm-not-you-message a {
	color: var(--aln-accent);
}

/* Admin-only "edit options" wrench links next to fields */
#crm-container.crm-public .crm-option-edit-link {
	display: inline-block;
	margin-top: 0.4rem;
	font-size: 0.85rem;
	color: var(--aln-muted);
}

#crm-container.crm-public .crm-option-edit-link::after {
	content: "Edit options";
}

/* Text for screen readers only (normally provided by CiviCRM's theme) */
#crm-container.crm-public .sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* =====================================================================
   CONFIRMATION (REVIEW) PAGE AND THANK-YOU PAGE
   Review: shown after "Review your contribution", before payment.
   Thank-you: shown after the sign-up is complete.
   Both pages share the summary cards below.
   ===================================================================== */

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

/* "Test-drive" and other status messages */
#crm-container.crm-public .messages.status {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	background: #fffbea;
	border: 2px solid #d69e2e;
	border-radius: var(--aln-radius);
	color: var(--aln-field-text);
	font-size: 0.95rem;
}

#crm-container.crm-public .messages.status p {
	margin: 0.4rem 0 0;
}

#crm-container.crm-public .messages .crm-i {
	display: none;
}

/* "Please verify the information below carefully..." */
#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) > .help {
	margin: 0 0 1.25rem;
	padding: 1rem 1.25rem;
	background: var(--aln-soft-bg);
	border-left: 4px solid var(--aln-accent);
	border-radius: 0 var(--aln-radius) var(--aln-radius) 0;
	color: var(--aln-field-text);
}

#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) > .help p {
	margin: 0;
}

/* Pay-later instructions (e.g. bank transfer details) */
#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) > .pay_later_receipt-section {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	background: #fff;
	border: 2px dashed var(--aln-field-border);
	border-radius: var(--aln-radius);
	font-weight: 600;
}

#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) > .pay_later_receipt-section p {
	margin: 0;
}

/* ---------- Section headings ---------- */

#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) .header-dark {
	margin: 0 0 0.75rem;
	padding: 0;
	background: none;
	border: 0; /* No underline from the dashboard styles */
	font-family: var(--global-heading-font-family, inherit);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--aln-text);
}

/* Headings that sit directly in the page (not inside a card) */
#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) > .header-dark {
	margin-top: 2rem;
}

/* Empty membership wrapper, and the membership type's internal name
   ("Member_Yearly_Waged"). The fee box below shows the proper name. */
#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) > #membership:not(:has(*)),
#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) > #membership-listings,
#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) > #membership + .header-dark {
	display: none;
}

/* ---------- Summary cards (fee, details, email) ---------- */

#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) > .crm-group,
#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) > .crm-profile-view {
	margin: 0 0 1.5rem;
	padding: 1.5rem 1.75rem;
	background: #fff;
	border: 1px solid var(--aln-border);
	border-radius: 12px;
}

/* The profile already sits in this card, so drop its own card styling */
#crm-container.crm-public .crm-profile-view fieldset.crm-profile {
	display: block;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
}

#crm-container.crm-public :is(.crm-contribution-confirm-form-block, .crm-contribution-thankyou-form-block) .crm-section.no-label {
	margin: 0;
}

/* Membership fee */
#crm-container.crm-public .crm-contribution-confirm-form-block .amount_display-section .content {
	font-size: 1.05rem;
	color: var(--aln-field-text);
}

#crm-container.crm-public .crm-contribution-confirm-form-block .amount_display-section strong {
	display: block;
	margin-top: 0.25rem;
	font-family: var(--global-heading-font-family, inherit);
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--aln-accent);
}

#crm-container.crm-public .crm-contribution-confirm-form-block .amount_display-section .crm-price-amount-label {
	display: block;
	font-family: var(--global-body-font-family, sans-serif);
	font-size: 1rem;
	font-weight: 600;
	color: var(--aln-field-text);
}

/* Email */
#crm-container.crm-public .contributor_email-section .content {
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--aln-field-text);
	word-break: break-word;
}

/* ---------- Your details: label on the left, answer on the right ---------- */

#crm-container.crm-public .crm-profile-view .form-item {
	display: grid;
	grid-template-columns: minmax(9rem, 38%) 1fr;
	gap: 1rem;
	margin: 0;
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--aln-border);
}

#crm-container.crm-public .crm-profile-view .form-item:last-of-type {
	border-bottom: 0;
}

#crm-container.crm-public .crm-profile-view .form-item > .label {
	margin: 0;
	font-weight: 400;
	color: var(--aln-muted);
}

#crm-container.crm-public .crm-profile-view .form-item > .label label {
	font-weight: 400;
}

#crm-container.crm-public .crm-profile-view .form-item > .content {
	font-weight: 600;
	color: var(--aln-field-text);
	word-break: break-word;
}

/* Rows the person left empty are hidden, to keep the summary short.
   Delete this rule if you'd rather show every field. */
#crm-container.crm-public .crm-profile-view .form-item:not(:has(.crm-form-toggle-text)):not(:has(input[type="hidden"]:not([value=""]))) {
	display: none;
}

/* Ticked options: show only those, each with a tick */
#crm-container.crm-public .crm-profile-view .crm-multiple-checkbox-radio-options {
	display: block;
}

#crm-container.crm-public .crm-profile-view .crm-frozen-field tt {
	display: none; /* CiviCRM's "[ ]" / "[x]" markers */
}

#crm-container.crm-public .crm-profile-view .crm-option-label-pair {
	display: block;
	white-space: normal;
}

#crm-container.crm-public .crm-profile-view .crm-option-label-pair:has(input[value=""]) {
	display: none;
}

#crm-container.crm-public .crm-profile-view .crm-option-label-pair::before {
	content: "✓";
	margin-right: 0.5em;
	color: var(--aln-accent);
}

/* Yes/No fields: show the matching word only */
#crm-container.crm-public .crm-profile-view .crm-frozen-field:has(input[value=""]) .crm-form-toggle-text-on,
#crm-container.crm-public .crm-profile-view .crm-frozen-field:has(input:not([value=""])) .crm-form-toggle-text-off {
	display: none;
}

/* ---------- Continue / Go Back buttons ---------- */

#crm-container.crm-public .crm-contribution-confirm-form-block .crm-submit-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin: 1.5rem 0;
}

/* Go Back on the left, Continue on the right */
#crm-container.crm-public .crm-submit-buttons .crm-button-type-back {
	order: -1;
	background: #fff;
	border: 2px solid var(--aln-field-border);
	color: var(--aln-field-text);
}

#crm-container.crm-public .crm-submit-buttons .crm-button-type-back:hover,
#crm-container.crm-public .crm-submit-buttons .crm-button-type-back:focus-visible {
	background: #fff;
	border-color: color-mix(in srgb, var(--aln-accent) 80%, #000);
	box-shadow: 8px 8px 0 0 var(--global-palette4, #2D3748);
	color: color-mix(in srgb, var(--aln-accent) 80%, #000);
}

/* The buttons appear twice on this page; hide the top pair */
#crm-container.crm-public .crm-contribution-confirm-form-block > .help + .crm-submit-buttons {
	display: none;
}

/* ---------- Thank-you page ---------- */

/* Thank-you message (set in the page's Thank-you and Receipting settings) */
#crm-container.crm-public .crm-contribution-thankyou-form-block > .help {
	position: relative;
	margin: 0 0 1.75rem;
	padding: 1.25rem 1.5rem 1.25rem 4rem;
	background: color-mix(in srgb, var(--aln-accent) 8%, #fff);
	border: 2px solid var(--aln-accent);
	border-left-width: 2px;
	border-radius: 12px;
	font-size: 1.1rem;
	color: var(--aln-field-text);
}

/* Large tick in a circle */
#crm-container.crm-public .crm-contribution-thankyou-form-block > .help::before {
	content: "✓";
	position: absolute;
	left: 1.25rem;
	top: 1.15rem;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 50%;
	background: var(--aln-accent);
	color: #fff;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.9rem;
	text-align: center;
}

#crm-container.crm-public .crm-contribution-thankyou-form-block > .help p {
	margin: 0 0 0.5rem;
}

#crm-container.crm-public .crm-contribution-thankyou-form-block > .help p:last-child {
	margin-bottom: 0;
}

#crm-container.crm-public .crm-contribution-thankyou-form-block .spacer {
	display: none;
}

/* Payment summary: Membership / Contribution Amount / Total */
#crm-container.crm-public .crm-contribution-thankyou-form-block .amount_display-section .content {
	line-height: 1.9;
	color: var(--aln-field-text);
}

#crm-container.crm-public .crm-contribution-thankyou-form-block .amount_display-section strong {
	font-weight: 700;
}

/* The "-------" divider line is replaced by a proper rule above the total */
#crm-container.crm-public .crm-contribution-thankyou-form-block .amount_display-section strong:nth-of-type(3) {
	display: block;
	height: 0;
	margin: 0.5rem 0 -1.4rem;
	overflow: hidden;
	border-top: 1px solid var(--aln-border);
	color: transparent;
}

/* Total amount */
#crm-container.crm-public .crm-contribution-thankyou-form-block .amount_display-section strong:last-of-type {
	font-family: var(--global-heading-font-family, inherit);
	font-size: 1.4rem;
	color: var(--aln-accent);
}

/* Footer text (optional, set in the page settings) */
#crm-container.crm-public .contribution_thankyou_footer-section {
	margin: 1.5rem 0 0;
}

#crm-container.crm-public .contribution_thankyou_footer-section p:empty {
	display: none;
}

/* ---------- Phones ---------- */

@media (max-width: 640px) {
	#crm-container.crm-public fieldset,
	#crm-container.crm-public .email-5-section {
		padding: 1.25rem 1rem;
	}

	#crm-container.crm-public fieldset.crm-profile,
	#crm-container.crm-public .membership_amount-content,
	#crm-container.crm-public .crm-multiple-checkbox-radio-options {
		grid-template-columns: 1fr;
	}

	#crm-container.crm-public fieldset.crm-profile > * {
		grid-column: 1 / -1 !important;
	}

	#crm-container.crm-public .crm-submit-buttons .crm-button {
		width: 100%;
		justify-content: center;
	}

	/* Review page: label above the answer, slimmer cards */
	#crm-container.crm-public .crm-contribution-thankyou-form-block > .crm-group,
	#crm-container.crm-public .crm-contribution-confirm-form-block > .crm-group,
	#crm-container.crm-public .crm-contribution-confirm-form-block > .crm-profile-view,
	#crm-container.crm-public .crm-contribution-thankyou-form-block > .crm-profile-view {
		padding: 1.25rem 1rem;
	}

	#crm-container.crm-public .crm-profile-view .form-item {
		grid-template-columns: 1fr;
		gap: 0.15rem;
	}

	/* Continue above Go Back on phones */
	#crm-container.crm-public .crm-submit-buttons .crm-button-type-back {
		order: 1;
	}
}