/*
 * Donation form. Colours and font follow the site's Elementor global styles
 * when they exist, and fall back to the same values otherwise.
 */
.kd-form {
	--kd-primary: var(--e-global-color-primary, #295ba8);
	--kd-accent: var(--e-global-color-secondary, #f89f55);
	--kd-text: var(--e-global-color-text, #303030);
	--kd-font: var(--e-global-typography-primary-font-family, inherit);
	--kd-muted: #667085;
	--kd-surface: #eef1f7;
	--kd-border: #cfd5e2;
	--kd-danger: #b42318;
	--kd-success: #1a7f4b;
	--kd-radius: 10px;

	box-sizing: border-box;
	max-width: 560px;
	margin: 0 auto;
	padding: 28px;
	border: 1px solid var(--kd-border);
	border-radius: 16px;
	background: #fff;
	color: var(--kd-text);
	/* Like Elementor: letters the theme font lacks (Cyrillic, Armenian) fall back to a sans-serif, not the browser's serif. */
	font-family: var(--kd-font), sans-serif;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}

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

.kd-form [hidden] {
	display: none !important;
}

.kd-form form,
.kd-form p {
	margin: 0;
}

.kd-form .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Progress */
.kd-form .kd-progress {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.kd-form .kd-progress__label {
	color: var(--kd-muted);
	font-size: 13px;
	font-weight: 500;
}

.kd-form .kd-progress__bar {
	display: flex;
	flex: 0 0 88px;
	gap: 6px;
}

.kd-form .kd-progress__bar span {
	flex: 1;
	height: 6px;
	border-radius: 3px;
	background: var(--kd-surface);
}

.kd-form .kd-progress__bar span.is-on {
	background: var(--kd-accent);
}

/* Groups */
.kd-form fieldset {
	min-width: 0;
	margin: 0 0 20px;
	padding: 0;
	border: 0;
}

.kd-form legend,
.kd-form .kd-field label {
	display: block;
	width: 100%;
	margin: 0 0 8px;
	padding: 0;
	color: var(--kd-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

/* Choices: real radio buttons drawn as large buttons */
.kd-form .kd-choices {
	display: grid;
	gap: 8px;
}

.kd-form .kd-choices--2,
.kd-form .kd-choices--amounts {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kd-form .kd-choices--currency {
	grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
}

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

.kd-form .kd-choice input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.kd-form .kd-choice span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 8px 10px;
	border: 2px solid transparent;
	border-radius: var(--kd-radius);
	background: var(--kd-surface);
	color: var(--kd-text);
	font-size: 16px;
	font-weight: 500;
	text-align: center;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.kd-form .kd-choice--small span {
	min-height: 42px;
	font-size: 14px;
	font-weight: 600;
}

.kd-form .kd-choice:hover span {
	border-color: var(--kd-primary);
}

.kd-form .kd-choice input:checked + span {
	border-color: var(--kd-primary);
	background: var(--kd-primary);
	color: #fff;
	font-weight: 600;
}

.kd-form .kd-choice input:focus-visible + span {
	outline: 3px solid var(--kd-accent);
	outline-offset: 2px;
}

/* Text inputs */
.kd-form .kd-input {
	display: block;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 10px 14px;
	border: 2px solid var(--kd-border);
	border-radius: var(--kd-radius);
	background: #fff;
	box-shadow: none;
	color: var(--kd-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
	transition: border-color 0.15s;
}

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

.kd-form .kd-input:focus {
	border-color: var(--kd-primary);
	outline: 3px solid rgba(41, 91, 168, 0.2);
	outline-offset: 0;
}

.kd-form .kd-input.is-active {
	border-color: var(--kd-primary);
}

.kd-form .kd-input[aria-invalid="true"] {
	border-color: var(--kd-danger);
}

.kd-form .kd-affix {
	position: relative;
	margin-top: 8px;
}

.kd-form .kd-affix .kd-input {
	padding-right: 64px;
}

.kd-form .kd-affix__label {
	position: absolute;
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
	color: var(--kd-muted);
	font-size: 14px;
	font-weight: 600;
	pointer-events: none;
}

.kd-form .kd-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 14px;
	margin-bottom: 14px;
}

.kd-form .kd-optional {
	color: var(--kd-muted);
	font-weight: 400;
}

.kd-form .kd-error {
	margin-top: 6px;
	color: var(--kd-danger);
	font-size: 14px;
}

/* Buttons. The theme styles every <button>, so each state is set here. */
.kd-form .kd-btn,
.kd-form .kd-btn:hover,
.kd-form .kd-btn:focus {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 54px;
	margin: 0;
	padding: 12px 20px;
	border: 0;
	border-radius: var(--kd-radius);
	background: var(--kd-primary);
	box-shadow: none;
	color: #fff;
	font-family: inherit;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.3;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	transition: filter 0.15s;
}

.kd-form .kd-btn:hover {
	filter: brightness(1.1);
}

.kd-form .kd-btn:focus-visible {
	outline: 3px solid var(--kd-accent);
	outline-offset: 2px;
}

.kd-form .kd-btn[disabled] {
	filter: none;
	opacity: 0.65;
	cursor: progress;
}

.kd-form .kd-link,
.kd-form .kd-link:hover,
.kd-form .kd-link:focus {
	flex: 0 0 auto;
	margin: 0;
	padding: 4px 0;
	border: 0;
	border-radius: 4px;
	background: none;
	box-shadow: none;
	color: var(--kd-primary);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	text-decoration: underline;
	text-transform: none;
	cursor: pointer;
}

.kd-form .kd-link:focus-visible {
	outline: 3px solid var(--kd-accent);
	outline-offset: 2px;
}

/* Step 2 */
.kd-form .kd-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
	padding: 14px 16px;
	border-radius: var(--kd-radius);
	background: var(--kd-surface);
}

.kd-form .kd-summary__text {
	font-size: 17px;
	font-weight: 600;
}

.kd-form .kd-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 4px 0 0;
	color: var(--kd-text);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.45;
	cursor: pointer;
}

.kd-form .kd-consent input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	accent-color: var(--kd-primary);
}

.kd-form .kd-consent a {
	color: var(--kd-primary);
	text-decoration: underline;
}

.kd-form [data-kd-consent-wrap] {
	margin-bottom: 18px;
}

.kd-form [data-kd-error="form"] {
	margin: 0 0 12px;
}

.kd-form .kd-note {
	margin-top: 12px;
	color: var(--kd-muted);
	font-size: 13px;
	text-align: center;
}

.kd-form .kd-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Result */
.kd-form .kd-done {
	padding: 12px 0;
	text-align: center;
}

.kd-form .kd-done__mark {
	position: relative;
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: var(--kd-success);
}

.kd-form .kd-done__mark::after {
	content: "";
	position: absolute;
	top: 14px;
	left: 21px;
	width: 14px;
	height: 24px;
	border: solid #fff;
	border-width: 0 4px 4px 0;
	transform: rotate(45deg);
}

.kd-form .kd-done[data-kd-state="failed"] .kd-done__mark {
	background: var(--kd-danger);
}

.kd-form .kd-done[data-kd-state="failed"] .kd-done__mark::after {
	content: "\00d7";
	top: 0;
	left: 0;
	width: 56px;
	height: 56px;
	border: 0;
	color: #fff;
	font-size: 40px;
	line-height: 54px;
	transform: none;
}

.kd-form .kd-done[data-kd-state="review"] .kd-done__mark {
	background: var(--kd-accent);
}

.kd-form .kd-done[data-kd-state="review"] .kd-done__mark::after {
	content: "!";
	top: 0;
	left: 0;
	width: 56px;
	height: 56px;
	border: 0;
	color: #fff;
	font-size: 34px;
	font-weight: 600;
	line-height: 56px;
	transform: none;
}

.kd-form .kd-done[data-kd-state="wait"] .kd-done__mark {
	border: 5px solid var(--kd-surface);
	border-top-color: var(--kd-primary);
	background: none;
	animation: kd-spin 0.9s linear infinite;
}

.kd-form .kd-done[data-kd-state="wait"] .kd-done__mark::after {
	content: none;
}

.kd-form .kd-done__again,
.kd-form .kd-done__again:hover,
.kd-form .kd-done__again:focus {
	margin-top: 20px;
}

@keyframes kd-spin {
	to {
		transform: rotate(360deg);
	}
}

.kd-form .kd-done__title {
	margin: 0 0 8px;
	color: var(--kd-text);
	font-family: inherit;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.3;
}

.kd-form .kd-done__title:focus {
	outline: none;
}

.kd-form .kd-done__ref {
	margin-top: 8px;
	color: var(--kd-muted);
	font-size: 14px;
}

@media (min-width: 480px) {
	.kd-form .kd-choices--amounts {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.kd-form .kd-row--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 479px) {
	.kd-form {
		padding: 20px 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kd-form * {
		transition: none !important;
	}
}

/* Donor dashboard: [kd_donor_dashboard] */
.kd-form.kd-dash {
	max-width: 760px;
}

.kd-form .kd-dash__title {
	margin: 0 0 12px;
	color: var(--kd-text);
	font-family: inherit;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
}

.kd-form .kd-dash__card + .kd-dash__title,
.kd-form .kd-dash__notice + .kd-dash__title,
.kd-form .kd-dash__table + .kd-dash__title {
	margin-top: 28px;
}

.kd-form .kd-dash__card {
	margin-bottom: 12px;
	padding: 16px 18px;
	border: 2px solid var(--kd-primary);
	border-radius: var(--kd-radius);
}

.kd-form .kd-dash__card--off {
	border-color: var(--kd-border);
	background: var(--kd-surface);
}

.kd-form .kd-dash__amount {
	font-size: 18px;
	font-weight: 600;
}

.kd-form .kd-dash__line {
	margin-top: 4px;
	font-size: 15px;
}

.kd-form .kd-dash__line--muted {
	color: var(--kd-muted);
	font-size: 14px;
}

.kd-form .kd-dash__card form {
	margin-top: 10px;
}

.kd-form .kd-link.kd-dash__cancel,
.kd-form .kd-link.kd-dash__cancel:hover,
.kd-form .kd-link.kd-dash__cancel:focus {
	color: var(--kd-danger);
}

.kd-form .kd-dash__notice {
	margin-bottom: 20px;
	padding: 12px 14px;
	border-radius: var(--kd-radius);
	background: #e6f4ea;
	color: #14532d;
	font-weight: 500;
}

.kd-form .kd-dash__notice--bad {
	background: #fde8e8;
	color: #8a1c1c;
}

.kd-form .kd-dash__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-size: 15px;
}

.kd-form .kd-dash__table th,
.kd-form .kd-dash__table td {
	padding: 10px 8px;
	border: 0;
	border-bottom: 1px solid var(--kd-border);
	background: none;
	text-align: left;
	vertical-align: top;
}

.kd-form .kd-dash__table th {
	color: var(--kd-muted);
	font-size: 13px;
	font-weight: 600;
}

.kd-form .kd-dash__tag {
	display: inline-block;
	margin-left: 4px;
	padding: 1px 7px;
	border-radius: 9px;
	background: var(--kd-surface);
	color: var(--kd-muted);
	font-size: 12px;
	font-weight: 600;
}

@media (max-width: 479px) {
	.kd-form .kd-dash__table th:nth-child(4),
	.kd-form .kd-dash__table td:nth-child(4) {
		display: none;
	}
}

/* Shown to administrators only, while payments are in Test mode. */
.kd-form .kd-testnote {
	margin: 0 0 16px;
	padding: 8px 12px;
	border-radius: var(--kd-radius);
	background: #fff3d6;
	color: #7a4a00;
	font-size: 13px;
	font-weight: 500;
}

.kd-form.kd-dash > p + p {
	margin-top: 14px;
}
