/* WML Donation — all colours come from CSS variables set on .wmld (see Donations → Settings → Style). */

.wmld {
	--wmld-bg: #f8f5ee;
	--wmld-border: #e6e1d6;
	--wmld-field-bg: #fff;
	--wmld-text: #1f1f1f;
	--wmld-muted: #7a7a7a;
	--wmld-accent: #dbb034;
	--wmld-button-text: #1f1f1f;
	--wmld-selected: #dbb034;
	--wmld-radius: 10px;
	--wmld-card-radius: 16px;
	--wmld-font: inherit;
	--wmld-gap: 24px;

	box-sizing: border-box;
	max-width: 580px;
	margin: 0 auto;
	padding: 28px;
	background: var(--wmld-bg);
	border: 1px solid var(--wmld-border);
	border-radius: var(--wmld-card-radius);
	color: var(--wmld-text);
	font-family: var(--wmld-font);
	font-size: 16px;
	line-height: 1.5;
}

.wmld *,
.wmld *::before,
.wmld *::after {
	box-sizing: border-box;
}

.wmld-form {
	display: flex;
	flex-direction: column;
	gap: var(--wmld-gap);
	margin: 0;
}

/* Option groups (frequency + amounts) */
.wmld-group {
	display: grid;
	grid-template-columns: repeat(var(--wmld-cols, 2), minmax(0, 1fr));
	gap: 10px;
}

.wmld-choice {
	position: relative;
	display: block;
	margin: 0;
	cursor: pointer;
}

.wmld-choice input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.wmld-choice span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 8px 12px;
	background: var(--wmld-field-bg);
	border: 1px solid var(--wmld-border);
	border-radius: var(--wmld-radius);
	color: var(--wmld-text);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.wmld-choice:hover span {
	border-color: var(--wmld-selected);
}

.wmld-choice input:checked + span {
	border-color: var(--wmld-selected);
	box-shadow: inset 0 0 0 1px var(--wmld-selected);
	background: color-mix(in srgb, var(--wmld-selected) 10%, var(--wmld-field-bg));
}

.wmld-choice input:focus-visible + span {
	outline: 2px solid var(--wmld-selected);
	outline-offset: 2px;
}

/* Inputs */
.wmld .wmld-input {
	display: block;
	width: 100%;
	min-height: 66px;
	margin: 0;
	padding: 16px 14px;
	background: var(--wmld-field-bg);
	border: 1px solid var(--wmld-border);
	border-radius: var(--wmld-radius);
	box-shadow: none;
	color: var(--wmld-text);
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
}

.wmld textarea.wmld-input {
	min-height: 100px;
	resize: vertical;
}

.wmld .wmld-input::placeholder {
	color: var(--wmld-muted);
	opacity: 1;
}

.wmld .wmld-input:focus {
	border-color: var(--wmld-selected);
	outline: none;
	box-shadow: inset 0 0 0 1px var(--wmld-selected);
}

.wmld .wmld-input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
}

.wmld .wmld-input[type="number"]::-webkit-inner-spin-button,
.wmld .wmld-input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.wmld .wmld-select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23777' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 18px center;
	cursor: pointer;
}

/* Checkbox rows (Gift Aid + custom checkbox fields) */
.wmld-check {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin: 0;
	cursor: pointer;
}

.wmld-check input {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 14px 0 0;
	accent-color: var(--wmld-selected);
	cursor: pointer;
}

.wmld-check__text {
	flex: 1;
	padding: 14px;
	background: var(--wmld-field-bg);
	border: 1px solid var(--wmld-border);
	border-radius: var(--wmld-radius);
	color: var(--wmld-text);
	opacity: .85;
	line-height: 1.6;
}

/* Gift Aid declaration */
.wmld-ga {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.wmld-ga-heading {
	display: block;
	margin-bottom: 4px;
	font-weight: 700;
}

.wmld-ga-amount {
	font-weight: 700;
}

.wmld [data-wmld-freq][hidden],
.wmld .wmld-ga-details[hidden] {
	display: none;
}

.wmld .wmld-ga-details {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
	margin: 0 0 0 36px;
	padding: 0;
	border: 0;
}

.wmld .wmld-ga-details .wmld-input {
	min-height: 54px;
	padding-top: 12px;
	padding-bottom: 12px;
}

.wmld-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.wmld-row--title {
	grid-template-columns: minmax(96px, 1fr) 2.5fr;
}

.wmld-ga-statement,
.wmld-ga-small {
	margin: 0;
	color: var(--wmld-text);
	font-size: 14px;
	line-height: 1.55;
}

.wmld-ga-small {
	color: var(--wmld-muted);
	font-size: 13px;
}

.wmld .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Button (extra specificity + explicit centring so theme button styles can't misalign it) */
.wmld .wmld-form .wmld-button {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	width: 100%;
	max-width: none;
	float: none;
	min-height: 56px;
	margin: 0;
	padding: 12px 20px;
	background: var(--wmld-accent);
	border: 0;
	border-radius: 6px;
	color: var(--wmld-button-text);
	font-family: inherit;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: .02em;
	line-height: 1.2;
	cursor: pointer;
	transition: filter .15s, transform .1s;
}

.wmld .wmld-button:hover {
	filter: brightness(.95);
}

.wmld .wmld-button:active {
	transform: translateY(1px);
}

.wmld .wmld-button[disabled] {
	opacity: .7;
	cursor: wait;
}

.wmld-note {
	margin: -8px 0 0;
	color: var(--wmld-muted);
	font-size: 14px;
}

.wmld-error {
	margin-top: -8px;
	padding: 10px 14px;
	background: #fdecec;
	border: 1px solid #f3c2c2;
	border-radius: var(--wmld-radius);
	color: #9b1c1c;
	font-size: 15px;
}

.wmld-error[hidden] {
	display: none;
}

.wmld-notice {
	margin-bottom: var(--wmld-gap);
	padding: 14px 16px;
	background: #eaf6ee;
	border: 1px solid #bfe3cb;
	border-radius: var(--wmld-radius);
	color: #1d5e33;
}

@media (max-width: 480px) {
	.wmld {
		--wmld-gap: 18px;
		padding: 18px;
	}

	.wmld-group--many {
		--wmld-cols: 2 !important;
	}

	.wmld-choice span {
		font-size: 16px;
	}

	.wmld .wmld-ga-details {
		margin-left: 0;
	}

	.wmld-row:not(.wmld-row--title) {
		grid-template-columns: 1fr;
	}
}
