/**
 * Refinery Donate — front-end styles.
 *
 * Everything inherits the theme's font stack on purpose (font: inherit), so the
 * form picks up Salient's typography and reads as page content rather than as a
 * third-party widget. Only colour and rhythm are set here.
 */

.refdon {
	--refdon-accent: #ff4612;
	--refdon-accent-dark: #d93a0f;
	--refdon-ink: #0a0a0a;
	--refdon-muted: #55565a;
	--refdon-line: #e2e2e4;
	--refdon-bg-soft: #f7f7f8;
	--refdon-radius: 4px;

	max-width: 620px;
	margin: 0 auto;
	color: var(--refdon-ink);
	font: inherit;
	text-align: left;
}

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

.refdon-heading {
	font-size: clamp(1.6rem, 3.4vw, 2.15rem);
	line-height: 1.2;
	margin: 0 0 .5rem;
	color: var(--refdon-ink);
}

.refdon-blurb {
	margin: 0 0 2rem;
	color: var(--refdon-muted);
	line-height: 1.6;
}

.refdon-testbadge {
	margin: 0 0 1.25rem;
	padding: .55rem .8rem;
	background: #fff8e6;
	border: 1px solid #f0d493;
	border-radius: var(--refdon-radius);
	font-size: .82rem;
	color: #7a5c12;
}

.refdon-notice {
	padding: 1rem;
	background: #fff8e6;
	border: 1px solid #f0d493;
	border-radius: var(--refdon-radius);
	color: #7a5c12;
}

/* ---------- fieldsets ---------- */

.refdon fieldset {
	border: 0;
	padding: 0;
	margin: 0 0 1.75rem;
	min-width: 0;
}

.refdon-legend {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0 0 .75rem;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--refdon-muted);
}

/* ---------- frequency toggle ---------- */

.refdon-freq {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	margin: 0 0 1.75rem;
	border: 1px solid var(--refdon-line);
	border-radius: var(--refdon-radius);
	overflow: hidden;
}

.refdon-freq-btn {
	appearance: none;
	border: 0;
	background: #fff;
	padding: .85rem 1rem;
	font: inherit;
	font-weight: 600;
	font-size: .95rem;
	color: var(--refdon-muted);
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.refdon .refdon-freq-btn + .refdon-freq-btn { border-left: 1px solid var(--refdon-line); }
.refdon .refdon-freq-btn:hover { background: var(--refdon-bg-soft); color: var(--refdon-ink); }

.refdon .refdon-freq-btn.is-active {
	background: var(--refdon-accent);
	color: #fff;
}

/* ---------- amount grid ---------- */

.refdon-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: .6rem;
}

@media (max-width: 560px) {
	.refdon-grid { grid-template-columns: repeat(2, 1fr); }
}

.refdon-amt {
	appearance: none;
	background: #fff;
	border: 1.5px solid var(--refdon-line);
	border-radius: var(--refdon-radius);
	padding: .9rem .4rem;
	font: inherit;
	font-weight: 700;
	font-size: 1.02rem;
	color: var(--refdon-ink);
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease, background .15s ease, transform .08s ease;
}

.refdon .refdon-amt:hover {
	border-color: var(--refdon-accent);
	color: var(--refdon-accent);
}

.refdon .refdon-amt:active { transform: translateY(1px); }

.refdon .refdon-amt.is-active {
	background: var(--refdon-accent);
	border-color: var(--refdon-accent);
	color: #fff;
}

.refdon-amt-other { font-size: .95rem; }

.refdon-custom { margin-top: .85rem; }

.refdon-inputwrap { position: relative; }

.refdon-currency {
	position: absolute;
	left: .9rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--refdon-muted);
	font-weight: 700;
	pointer-events: none;
}

.refdon-input-amount { padding-left: 2rem; font-weight: 700; font-size: 1.1rem; }

/* ---------- inputs ---------- */

.refdon-label {
	display: block;
	margin: 0 0 .35rem;
	font-size: .86rem;
	font-weight: 600;
	color: var(--refdon-muted);
}

.refdon-input {
	display: block;
	width: 100%;
	padding: .78rem .9rem;
	font: inherit;
	font-size: 1rem;
	color: var(--refdon-ink);
	background: #fff;
	border: 1.5px solid var(--refdon-line);
	border-radius: var(--refdon-radius);
	transition: border-color .15s ease, box-shadow .15s ease;
	margin: 0 0 1rem;
}

.refdon .refdon-input:focus {
	outline: none;
	border-color: var(--refdon-accent);
	box-shadow: 0 0 0 3px rgba(255, 70, 18, .13);
}

.refdon .refdon-input.has-error { border-color: #d33; }

.refdon-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }

@media (max-width: 460px) {
	.refdon-row { grid-template-columns: 1fr; }
}

/* ---------- checkboxes ---------- */

.refdon-check {
	display: flex;
	gap: .7rem;
	align-items: flex-start;
	padding: .9rem 1rem;
	margin: 0 0 1.75rem;
	background: var(--refdon-bg-soft);
	border: 1px solid var(--refdon-line);
	border-radius: var(--refdon-radius);
	cursor: pointer;
	transition: border-color .15s ease;
}

.refdon .refdon-check:hover { border-color: #cfcfd2; }

.refdon .refdon-check input[type="checkbox"] {
	flex: 0 0 auto;
	width: 1.05rem;
	height: 1.05rem;
	margin: .12rem 0 0;
	accent-color: var(--refdon-accent);
	cursor: pointer;
}

.refdon-check-body { display: block; line-height: 1.45; }

.refdon-check-title {
	display: block;
	font-weight: 600;
	font-size: .95rem;
	color: var(--refdon-ink);
}

.refdon-check-sub {
	display: block;
	font-size: .86rem;
	color: var(--refdon-muted);
	margin-top: .1rem;
}

.refdon-anon { margin-bottom: 0; }

/* ---------- payment element ---------- */

#refdon-payment-element { margin-bottom: .75rem; min-height: 42px; }

.refdon-paynote {
	margin: 0;
	font-size: .84rem;
	color: var(--refdon-muted);
}

/* ---------- submit ---------- */

.refdon-submit {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	width: 100%;
	padding: 1.05rem 1.25rem;
	font: inherit;
	font-weight: 700;
	font-size: 1.06rem;
	letter-spacing: .02em;
	color: #fff;
	background: var(--refdon-accent);
	border: 0;
	border-radius: var(--refdon-radius);
	cursor: pointer;
	transition: background .15s ease, transform .08s ease;
}

.refdon .refdon-submit:hover:not(:disabled) { background: var(--refdon-accent-dark); }
.refdon .refdon-submit:active:not(:disabled) { transform: translateY(1px); }

.refdon .refdon-submit:disabled { opacity: .6; cursor: not-allowed; }

.refdon-spinner {
	width: 1.05rem;
	height: 1.05rem;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: refdon-spin .7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.refdon-spinner { animation-duration: 2s; }
	.refdon-amt, .refdon-submit, .refdon-freq-btn { transition: none; }
}

.refdon-error {
	margin: 0 0 1rem;
	padding: .8rem 1rem;
	background: #fdf1f1;
	border: 1px solid #f0c4c4;
	border-radius: var(--refdon-radius);
	color: #a32020;
	font-size: .9rem;
}

.refdon-secure {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .45rem;
	margin: .9rem 0 0;
	font-size: .82rem;
	color: var(--refdon-muted);
}

/* ---------- success ---------- */

.refdon-success { text-align: center; padding: 2.5rem 1rem; }
.refdon-success-mark { color: var(--refdon-accent); margin-bottom: 1rem; }

.refdon-success-title {
	margin: 0 0 .6rem;
	font-size: clamp(1.5rem, 3vw, 2rem);
	color: var(--refdon-ink);
}

.refdon-success-body {
	margin: 0;
	color: var(--refdon-muted);
	line-height: 1.65;
}

/* ---------- design preview (admins only, before Stripe keys exist) ---------- */

.refdon-payment-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .3rem;
	padding: 2.1rem 1rem;
	text-align: center;
	background: repeating-linear-gradient(
		45deg,
		var(--refdon-bg-soft),
		var(--refdon-bg-soft) 10px,
		#fff 10px,
		#fff 20px
	);
	border: 1.5px dashed var(--refdon-line);
	border-radius: var(--refdon-radius);
	color: var(--refdon-muted);
}

.refdon-payment-placeholder span { font-weight: 600; font-size: .95rem; }
.refdon-payment-placeholder small { font-size: .82rem; opacity: .8; }

/* ---------- theme overrides ----------
 * Salient styles bare element selectors like `button[type="submit"]`
 * (specificity 0,1,1) which outrank a single class. These rules restate the
 * intent at higher specificity rather than resorting to !important, so the
 * form renders predictably inside the theme.
 */

.refdon button.refdon-submit {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	height: auto;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: .02em;
	border-radius: var(--refdon-radius);
	background: var(--refdon-accent);
	color: #fff;
}

.refdon button.refdon-submit:hover:not(:disabled) { background: var(--refdon-accent-dark); color: #fff; }

.refdon button.refdon-amt,
.refdon button.refdon-freq-btn {
	width: 100%;
	min-width: 0;
	height: auto;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
}

.refdon input.refdon-input,
.refdon input[type="text"].refdon-input,
.refdon input[type="email"].refdon-input,
.refdon input[type="number"].refdon-input {
	width: 100%;
	background: #fff;
	border: 1.5px solid var(--refdon-line);
	border-radius: var(--refdon-radius);
	height: auto;
	margin: 0 0 1rem;
	padding: .78rem .9rem;
	color: var(--refdon-ink);
}

.refdon input.refdon-input:focus {
	border-color: var(--refdon-accent);
	box-shadow: 0 0 0 3px rgba(255, 70, 18, .13);
	background: #fff;
}

.refdon .refdon-input-amount { padding-left: 2rem; }

/* ---------- donor portal ---------- */

.refdon-portal-sent {
	margin: 0 0 1rem;
	padding: .85rem 1rem;
	background: #eefaf0;
	border: 1px solid #b8e3c2;
	border-radius: var(--refdon-radius);
	color: #1a6b32;
	font-size: .92rem;
	line-height: 1.5;
}

.refdon-portal .refdon-input { margin-bottom: 1.25rem; }

.refdon .refdon-success-link {
	display: inline-block;
	margin-top: .2rem;
	color: var(--refdon-accent);
	font-weight: 600;
	text-decoration: underline;
}

/* ---------- self-contained surface ----------
 * The form must not assume the page behind it is light. On /giving/ it sits on
 * a dark WPBakery overlay, where muted grey labels became unreadable — the old
 * GiveWP template supplied its own white card and we have to do the same.
 * Carrying our own surface makes the form legible on any background.
 */

.refdon {
	background: #ffffff;
	padding: 2.25rem 2rem;
	border-radius: 6px;
	box-shadow: 0 2px 18px rgba(0, 0, 0, .10);
}

@media (max-width: 560px) {
	.refdon { padding: 1.5rem 1.15rem; }
}

/* The success panel shares the surface, so no double card. */
.refdon .refdon-success { padding: 1.5rem .5rem; }
