/* Modern PayPal Donate — front-end styles
   Radius hierarchy: card 20 · CTA 14 · chips 12 · bar 99 */

.mpd,
.mpd-fab,
.mpd-dialog {
	--mpd-accent: #1E5B4F;
	--mpd-on-accent: #ffffff;
	--mpd-bg: #ffffff;
	--mpd-ink: #14201C;
	--mpd-muted: #5D6B66;
	--mpd-line: #DCE3E0;
	--mpd-chip: #F3F6F5;
	--mpd-error: #B42318;
	--mpd-accent-soft: color-mix(in srgb, var(--mpd-accent) 12%, var(--mpd-bg));
}

.mpd.mpd--dark,
.mpd-dialog:has(.mpd--dark) {
	--mpd-bg: #15201D;
	--mpd-ink: #EDF3F1;
	--mpd-muted: #A2B0AB;
	--mpd-line: #2A3833;
	--mpd-chip: #1C2A26;
	--mpd-error: #FDA29B;
}

.mpd {
	box-sizing: border-box;
	max-width: 420px;
	margin: 1.5em 0;
	padding: 28px 26px 22px;
	background: var(--mpd-bg);
	color: var(--mpd-ink);
	border: 1px solid var(--mpd-line);
	border-radius: 20px;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}

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

.mpd--notice {
	padding: 16px 18px;
	font-size: 14px;
	color: #5D6B66;
	border-style: dashed;
}

/* Heading + copy */
.mpd .mpd__title {
	margin: 0 0 6px;
	padding: 0;
	font-family: inherit;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--mpd-ink);
	border: 0;
}

.mpd .mpd__desc {
	margin: 0 0 20px;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--mpd-muted);
	max-width: 36em;
}

/* Goal */
.mpd__goal {
	margin: 0 0 20px;
}

.mpd__goal-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 8px;
	font-size: 0.875rem;
	color: var(--mpd-muted);
}

.mpd__goal-nums {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.mpd__goal-nums strong {
	color: var(--mpd-ink);
	font-weight: 700;
}

.mpd__bar {
	height: 8px;
	border-radius: 99px;
	background: var(--mpd-chip);
	overflow: hidden;
}

.mpd__bar span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--mpd-accent);
	min-width: 8px;
}

/* Amount chips */
.mpd .mpd__amounts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
	gap: 8px;
	margin: 0 0 10px;
}

.mpd .mpd__amt {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 56px;
	margin: 0;
	padding: 0 8px;
	background: var(--mpd-chip);
	color: var(--mpd-ink);
	border: 1.5px solid transparent;
	border-radius: 12px;
	box-shadow: none;
	font-family: inherit;
	font-size: 1.125rem;
	font-weight: 650;
	line-height: 1;
	letter-spacing: -0.01em;
	font-variant-numeric: tabular-nums;
	text-transform: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}

.mpd .mpd__amt:hover {
	border-color: color-mix(in srgb, var(--mpd-accent) 45%, transparent);
	background: var(--mpd-accent-soft);
	color: var(--mpd-ink);
}

.mpd .mpd__amt:active {
	transform: scale(.97);
}

.mpd .mpd__amt.is-on {
	background: var(--mpd-accent);
	border-color: var(--mpd-accent);
	color: var(--mpd-on-accent);
}

/* Custom amount */
.mpd .mpd__custom {
	display: flex;
	align-items: center;
	height: 52px;
	margin: 0 0 16px;
	padding: 0 14px;
	background: var(--mpd-bg);
	border: 1.5px solid var(--mpd-line);
	border-radius: 12px;
	cursor: text;
	transition: border-color .15s ease;
}

.mpd .mpd__custom:focus-within {
	border-color: var(--mpd-accent);
}

.mpd .mpd__custom.is-on {
	border-color: var(--mpd-accent);
	background: var(--mpd-accent-soft);
}

.mpd .mpd__sym {
	margin-right: 8px;
	font-weight: 650;
	color: var(--mpd-muted);
}

.mpd .mpd__input {
	flex: 1;
	width: 100%;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	outline: 0;
	box-shadow: none;
	color: var(--mpd-ink);
	font-family: inherit;
	font-size: 1.0625rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
}

.mpd .mpd__input::placeholder {
	color: var(--mpd-muted);
	font-weight: 400;
	opacity: 1;
}

.mpd .mpd__input::-webkit-outer-spin-button,
.mpd .mpd__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.mpd .mpd__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Error / thanks */
.mpd .mpd__error {
	margin: -6px 0 12px;
	font-size: 0.875rem;
	color: var(--mpd-error);
}

.mpd .mpd__thanks {
	margin: 12px 0 0;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--mpd-accent-soft);
	color: var(--mpd-ink);
	font-size: 0.9375rem;
}

.mpd [hidden] {
	display: none !important;
}

/* Main button */
.mpd .mpd__cta {
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 56px;
	margin: 0;
	padding: 0 20px;
	background: var(--mpd-accent);
	color: var(--mpd-on-accent);
	border: 0;
	border-radius: 14px;
	box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--mpd-accent) 70%, transparent);
	font-family: inherit;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: filter .15s ease, transform .1s ease;
}

.mpd .mpd__cta:hover {
	filter: brightness(1.08);
	color: var(--mpd-on-accent);
	background: var(--mpd-accent);
}

.mpd .mpd__cta:active {
	transform: translateY(1px);
}

.mpd .mpd__cta-text {
	font-variant-numeric: tabular-nums;
}

.mpd .mpd__heart {
	width: 20px;
	height: 20px;
	fill: currentColor;
	flex: none;
}

.mpd .mpd__cta.is-sent .mpd__heart {
	animation: mpd-beat .6s ease;
}

@keyframes mpd-beat {
	0%   { transform: scale(1); }
	30%  { transform: scale(1.35); }
	55%  { transform: scale(.9); }
	100% { transform: scale(1); }
}

/* Trust note */
.mpd .mpd__note {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 14px 0 0;
	font-size: 0.8125rem;
	color: var(--mpd-muted);
}

.mpd .mpd__note svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linejoin: round;
}

/* Extra text at the bottom */
.mpd .mpd__footer {
	margin: 14px 0 0;
	padding-top: 14px;
	border-top: 1px solid var(--mpd-line);
	font-size: 0.875rem;
	line-height: 1.55;
	text-align: center;
	color: var(--mpd-muted);
}

.mpd .mpd__footer a {
	color: var(--mpd-accent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Focus */
.mpd .mpd__amt:focus-visible,
.mpd .mpd__cta:focus-visible,
.mpd-fab:focus-visible,
.mpd-dialog__close:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--mpd-accent) 55%, transparent);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Floating button + dialog                                            */
/* ------------------------------------------------------------------ */

.mpd-fab {
	appearance: none;
	-webkit-appearance: none;
	position: fixed;
	right: max(20px, env(safe-area-inset-right));
	bottom: max(20px, env(safe-area-inset-bottom));
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 52px;
	margin: 0;
	padding: 0 22px 0 18px;
	background: var(--mpd-accent);
	color: #fff;
	border: 0;
	border-radius: 99px;
	box-shadow: 0 10px 28px -10px color-mix(in srgb, var(--mpd-accent) 80%, #000);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
	transition: transform .15s ease, filter .15s ease;
}

.mpd-fab:hover {
	transform: translateY(-2px);
	filter: brightness(1.08);
	color: #fff;
}

.mpd-fab svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.mpd-dialog {
	width: min(420px, calc(100vw - 24px));
	max-height: calc(100dvh - 24px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 20px;
	background: transparent;
	overflow: visible;
	color: inherit;
}

.mpd-dialog::backdrop {
	background: rgba(10, 18, 16, .45);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.mpd-dialog[open] {
	animation: mpd-pop .22s cubic-bezier(.2, .9, .3, 1.2);
}

@keyframes mpd-pop {
	from { opacity: 0; transform: translateY(12px) scale(.98); }
	to   { opacity: 1; transform: none; }
}

.mpd-dialog .mpd {
	margin: 0;
	max-width: none;
	max-height: calc(100dvh - 24px);
	overflow-y: auto;
	padding-top: 32px;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .35);
}

.mpd-dialog .mpd .mpd__title {
	padding-right: 36px;
}

.mpd-dialog__close {
	appearance: none;
	-webkit-appearance: none;
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	background: var(--mpd-chip);
	color: var(--mpd-ink);
	border: 0;
	border-radius: 99px;
	cursor: pointer;
}

.mpd-dialog:has(.mpd--dark) .mpd-dialog__close {
	background: #1C2A26;
	color: #EDF3F1;
}

.mpd-dialog__close svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
}

/* Small screens */
@media (max-width: 480px) {
	.mpd {
		padding: 24px 18px 18px;
	}
	.mpd-fab {
		padding: 0 18px 0 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mpd *,
	.mpd-fab,
	.mpd-dialog[open] {
		animation: none !important;
		transition: none !important;
	}
}
