:root {
	--stw-donate-purple: #4e2751;
	--stw-donate-lavender: #d8d9e6;
	--stw-donate-ink: #1c1d1e;
	--stw-donate-muted: #7d869c;
	--stw-donate-white: #ffffff;
}

.stw-donate {
	max-width: 520px;
	margin: 0 auto;
	font-family: Quicksand, sans-serif;
	color: var(--stw-donate-ink);
	text-align: left;
}

.stw-donate__form {
	display: grid;
	gap: 1.15rem;
	text-align: left;
}

.stw-donate__fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	text-align: left;
}

.stw-donate__fieldset legend {
	display: block;
	width: 100%;
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--stw-donate-purple);
	margin: 0.75rem 0 0.45rem;
	padding: 0;
	text-align: left;
}

.stw-donate__fieldset:first-child legend {
	margin-top: 0;
}

.stw-donate__segment,
.stw-donate__amounts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.stw-donate__segment label,
.stw-donate__amounts label {
	position: relative;
	flex: 1 1 auto;
	min-width: 5.5rem;
	cursor: pointer;
	margin: 0;
}

.stw-donate__segment label input,
.stw-donate__amounts label input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.stw-donate__segment label .stw-donate__choice,
.stw-donate__amounts label .stw-donate__choice {
	display: block !important;
	text-align: center;
	padding: 0.85rem 1rem;
	border: 2px solid var(--stw-donate-purple);
	background: transparent;
	color: var(--stw-donate-purple) !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	visibility: visible !important;
	opacity: 1 !important;
	text-indent: 0 !important;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Kill theme/Elementor ::before/::after that replace choice text with "-" */
.stw-donate__segment label .stw-donate__choice::before,
.stw-donate__segment label .stw-donate__choice::after,
.stw-donate__amounts label .stw-donate__choice::before,
.stw-donate__amounts label .stw-donate__choice::after {
	content: none !important;
	display: none !important;
}

/* Active state follows the real radio value only */
.stw-donate__segment label input:checked + .stw-donate__choice,
.stw-donate__amounts label input:checked + .stw-donate__choice {
	background: var(--stw-donate-purple);
	color: var(--stw-donate-white) !important;
}

.stw-donate__segment label:hover input:not(:checked) + .stw-donate__choice,
.stw-donate__amounts label:hover input:not(:checked) + .stw-donate__choice {
	background: var(--stw-donate-lavender);
	color: var(--stw-donate-purple) !important;
}

.stw-donate__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.stw-donate__field {
	text-align: left;
}

.stw-donate__field label,
.stw-donate__custom > label {
	display: block;
	width: 100%;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--stw-donate-purple);
	margin: 0.65rem 0 0.2rem;
	padding: 0;
	text-align: left;
	line-height: 1.2;
}

.stw-donate__row .stw-donate__field:first-child label,
.stw-donate__field:first-child label {
	margin-top: 0.65rem;
}

.stw-donate__field input,
.stw-donate__input-prefix input {
	width: 100%;
	box-sizing: border-box;
	border: 0;
	border-bottom: 2px solid var(--stw-donate-purple);
	border-radius: 0;
	background: transparent;
	padding: 0.35rem 0.1rem 0.45rem;
	font: inherit;
	color: var(--stw-donate-ink);
	outline: none;
	text-align: left;
}

.stw-donate__field input:focus,
.stw-donate__input-prefix input:focus {
	border-bottom-color: var(--stw-donate-muted);
}

.stw-donate__custom {
	display: none !important;
	margin-top: 1rem;
	padding: 0.85rem 1rem;
	background: var(--stw-donate-lavender);
	text-align: left;
}

/* Show without JS — works even if Elementor rebinds the DOM */
.stw-donate__amounts:has(input[value="custom"]:checked) ~ .stw-donate__custom,
.stw-donate__fieldset:has(input[value="custom"]:checked) .stw-donate__custom,
.stw-donate__form:has(input[name="amount_choice"][value="custom"]:checked) .stw-donate__custom,
.stw-donate__custom.is-open {
	display: block !important;
}

.stw-donate__custom > label {
	margin-top: 0;
}

.stw-donate__input-prefix {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	border-bottom: 2px solid var(--stw-donate-purple);
}

.stw-donate__input-prefix span {
	font-weight: 600;
	color: var(--stw-donate-purple);
	padding-left: 0.1rem;
}

.stw-donate__input-prefix input {
	border: 0;
	padding-left: 0;
}

.stw-donate__paypal {
	min-height: 45px;
	margin-top: 1.25rem;
}

.stw-donate__paypal.is-hidden {
	display: none;
}

.stw-donate__status {
	min-height: 1.2em;
	margin: 0;
	font-size: 0.95rem;
	color: var(--stw-donate-purple);
	text-align: left;
}

.stw-donate__status.is-error {
	color: #8b1e3f;
}

.stw-donate__status.is-success {
	color: #2f6b4f;
}

/* Only hide broken legacy hosted PayPal image buttons — never hide our form */
form[action*="paypal.com/cgi-bin/webscr"]:has(input[name="hosted_button_id"]) {
	display: none !important;
}

@media (max-width: 600px) {
	.stw-donate__row {
		grid-template-columns: 1fr;
	}
}
