/* =========================================================================
   SAFE donation form — "Donate box" (Figma node 7:40)
   Falls back to literal Figma hexes so the widget still looks right if it is
   dropped onto a site that does not load the SAFE Donate theme tokens.
   ========================================================================= */

.safe-donate {
	--sd-green:       var(--safe-green, #14b8a6);
	--sd-ink:         var(--safe-ink, #111827);
	--sd-body:        var(--safe-body, #374151);
	--sd-muted:       var(--safe-muted, #4b5563);
	--sd-border:      var(--safe-border, #e5e7eb);
	--sd-surface:     var(--safe-surface, #f9fafb);
	--sd-white:       #fff;
	--sd-placeholder: var(--safe-placeholder, #999);
	--sd-font:        var(--safe-font, 'Montserrat', sans-serif);

	box-sizing: border-box;
	width: 100%;
	max-width: 536px;
	padding: 32px;
	background: var(--sd-surface);
	border-radius: var(--safe-radius, 8px);
	font-family: var(--sd-font);
}

.safe-donate *,
.safe-donate *::before,
.safe-donate *::after { box-sizing: border-box; }

/* --- "Choose amount" ---------------------------------------------------- */

.safe-donate__title {
	margin: 0 0 12px;
	font-size: 17px;
	line-height: 32px;
	font-weight: 700;
	color: var(--sd-ink);
}

/* --- Preset amounts ----------------------------------------------------- */

.safe-donate__presets {
	display: grid;
	/* Set per-instance from PHP to match the number of buttons configured in
	   Donations → Settings. Falls back to the Figma's three. */
	grid-template-columns: repeat(var(--sd-preset-columns, 3), 1fr);
	gap: 16px;
}

.safe-donate__preset {
	height: 52px;
	padding: 0 8px;
	background: var(--sd-white);
	border: 2px solid var(--sd-border);
	border-radius: var(--safe-radius, 8px);
	font: 700 16px/24px var(--sd-font);
	color: var(--sd-ink);
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.safe-donate__preset:hover { border-color: var(--sd-green); }

.safe-donate__preset.is-selected {
	background: var(--sd-green);
	border-color: var(--sd-green);
	color: var(--sd-white);
}

/* --- Other amount ------------------------------------------------------- */

.safe-donate__custom {
	display: block;
	width: 100%;
	height: 52px;
	margin-top: 19px;
	padding: 0 16px;
	background: transparent;
	border: 2px solid var(--sd-border);
	border-radius: var(--safe-radius, 8px);
	font: 700 16px/24px var(--sd-font);
	color: var(--sd-ink);
}

.safe-donate__custom::placeholder { color: var(--sd-placeholder); opacity: 1; }
.safe-donate__custom:focus { outline: none; border-color: var(--sd-green); }

/* --- Frequency ---------------------------------------------------------- */

.safe-donate__frequency {
	margin: 31px 0 0;
	padding: 0;
	border: 0;
}

.safe-donate__legend {
	padding: 0;
	margin-bottom: 10px;
	font: 700 16px/24px var(--sd-font);
	color: var(--sd-ink);
}

.safe-donate__options { display: flex; flex-wrap: wrap; gap: 12px; }

.safe-donate__option {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	height: 52px;
	padding: 0 18px;
	background: var(--sd-white);
	border: 2px solid var(--sd-border);
	border-radius: var(--safe-radius, 8px);
	font: 700 16px/24px var(--sd-font);
	color: var(--sd-body);
	cursor: pointer;
	transition: border-color .15s ease;
}

.safe-donate__option:hover { border-color: var(--sd-green); }

/* The native input stays in the accessibility tree and keeps keyboard
   behaviour; the visible circle is drawn by .safe-donate__radio. */
.safe-donate__option input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.safe-donate__radio {
	position: relative;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	border: 2px solid var(--sd-green);
	border-radius: 50%;
}

.safe-donate__radio::after {
	content: '';
	position: absolute;
	inset: 0;
	margin: auto;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--sd-green);
	transform: scale(0);
	transition: transform .12s ease;
}

.safe-donate__option input:checked ~ .safe-donate__radio::after { transform: scale(1); }

.safe-donate__option:has(input:checked) { border-color: var(--sd-green); }

.safe-donate__option input:focus-visible ~ .safe-donate__radio {
	outline: 2px solid var(--sd-green);
	outline-offset: 3px;
}

/* --- Submit ------------------------------------------------------------- */

.safe-donate__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 48px;
	margin-top: 16px;
	background: var(--sd-green);
	border: 0;
	border-radius: 9999px;
	font: 700 16px/24px var(--sd-font);
	color: var(--sd-ink);
	cursor: pointer;
	transition: filter .15s ease;
}

.safe-donate__submit:hover { filter: brightness(.94); }

.safe-donate__submit[disabled] { opacity: .65; cursor: progress; }

.safe-donate__arrow { flex: 0 0 20px; width: 20px; height: 20px; }

/* --- Messages ----------------------------------------------------------- */

.safe-donate__message {
	margin: 12px 0 0;
	font: 400 14px/20px var(--sd-font);
	color: #b91c1c;
}

.safe-donate__message.is-info { color: var(--sd-muted); }

/* --- Trust notes -------------------------------------------------------- */

.safe-donate__trust {
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}

.safe-donate__trust li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font: 400 14px/20px var(--sd-font);
	color: var(--sd-muted);
}

.safe-donate__trust li + li { margin-top: 8px; }

.safe-donate__trust-icon { flex: 0 0 20px; width: 20px; height: 20px; }

/* --- Utility ------------------------------------------------------------ */

.safe-donate .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;
}

@media (max-width: 480px) {
	.safe-donate { padding: 24px; }
	.safe-donate__presets { grid-template-columns: repeat(2, 1fr); }
	.safe-donate__options { flex-direction: column; }
	.safe-donate__option { width: 100%; }
}

/* =========================================================================
   Donation confirmation (thank-you page)
   ========================================================================= */

.safe-confirm {
	--sc-green:  var(--safe-green, #14b8a6);
	--sc-ink:    var(--safe-ink, #111827);
	--sc-body:   var(--safe-body, #374151);
	--sc-muted:  var(--safe-muted, #4b5563);
	--sc-border: var(--safe-border, #e5e7eb);
	--sc-card:   var(--safe-surface, #f9fafb);
	--sc-font:   var(--safe-font, 'Montserrat', sans-serif);

	font-family: var(--sc-font);
	color: var(--sc-ink);
}

.safe-confirm__heading {
	margin: 0 0 12px;
	font-size: 40px;
	line-height: 46px;
	font-weight: 500;
	color: var(--sc-green);
}

.safe-confirm__intro,
.safe-confirm__note {
	margin: 0 0 28px;
	font-size: 16px;
	line-height: 24px;
	color: var(--sc-body);
}

/* --- What was given ----------------------------------------------------- */

.safe-confirm__table {
	margin: 0 0 28px;
	padding: 8px 24px;
	background: var(--sc-card);
	border-radius: var(--safe-radius, 8px);
}

.safe-confirm__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	justify-content: space-between;
	padding: 14px 0;
	border-bottom: 1px solid var(--sc-border);
}

.safe-confirm__row:last-child { border-bottom: 0; }

.safe-confirm__row dt {
	margin: 0;
	font-size: 14px;
	line-height: 24px;
	font-weight: 400;
	color: var(--sc-muted);
}

.safe-confirm__row dd {
	margin: 0;
	font-size: 16px;
	line-height: 24px;
	font-weight: 700;
	color: var(--sc-ink);
	text-align: right;
}

/* --- The recurring warning ---------------------------------------------- */

.safe-confirm__callout {
	margin: 0 0 28px;
	padding: 20px 24px;
	background: #fff;
	border: 2px solid var(--sc-green);
	border-radius: var(--safe-radius, 8px);
}

.safe-confirm__callout p {
	margin: 0 0 10px;
	font-size: 16px;
	line-height: 24px;
	color: var(--sc-body);
}

.safe-confirm__callout p:last-child { margin-bottom: 0; }

.safe-confirm__callout-title {
	font-weight: 700;
	color: var(--sc-ink) !important;
}

/* --- Small print --------------------------------------------------------- */

.safe-confirm__org,
.safe-confirm__ref {
	margin: 0 0 8px;
	font-size: 14px;
	line-height: 20px;
	color: var(--sc-muted);
}

.safe-confirm__ref code {
	font-size: 12px;
	word-break: break-all;
	background: var(--sc-card);
	padding: 2px 6px;
	border-radius: 4px;
}

@media (max-width: 640px) {
	.safe-confirm__heading { font-size: 30px; line-height: 36px; }
	.safe-confirm__row dd { text-align: left; }
}
