/**
 * fm-give.css — guided giving flow styling.
 *
 * Consumes faithmade-styles CSS custom properties (--fm-*) so the flow inherits
 * each church's palette automatically. Theme defaults are declared under
 * :where(.fm-give) so per-instance BB module CSS (higher specificity) always
 * wins without !important (platform convention). Mobile-first, large tap
 * targets, generous whitespace.
 */

.fm-give {
	--fm-give-accent: var(--fm-accent-color, #69af95);
	--fm-give-btn-bg: var(--fm-primary-button-color, #69af95);
	--fm-give-btn-bg-hover: var(--fm-primary-button-color-hover, #5a9a82);
	--fm-give-btn-text: var(--fm-primary-button-text-color, #ffffff);
	--fm-give-fg: var(--fm-dark-color, #1a202c);
	--fm-give-muted: var(--fm-muted-color, #6b7280);
	--fm-give-surface: var(--fm-light-color, #f7f7f7);
	--fm-give-border: rgba(0, 0, 0, 0.12);
	--fm-give-radius: 12px;
}

:where(.fm-give) {
	box-sizing: border-box;
	max-width: 30rem;
	margin: 0 auto;
	color: var(--fm-give-fg);
	font-size: 16px;
	line-height: 1.5;
}

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

/* Step indicator */
.fm-give__steps {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1.5rem;
}

.fm-give__step {
	flex: 1;
	text-align: center;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--fm-give-muted);
	padding-bottom: 0.5rem;
	border-bottom: 3px solid var(--fm-give-border);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.fm-give__step.is-active {
	color: var(--fm-give-accent);
	border-bottom-color: var(--fm-give-accent);
}

.fm-give__step.is-done {
	color: var(--fm-give-fg);
	border-bottom-color: var(--fm-give-accent);
}

/* Panels */
.fm-give__panel {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.fm-give__error {
	background: #fdecec;
	color: #a12622;
	border: 1px solid #f3c2c0;
	border-radius: 8px;
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
	font-size: 0.9375rem;
}

/* Amount chips */
.fm-give__chips {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
}

.fm-give__chip {
	appearance: none;
	border: 2px solid var(--fm-give-border);
	background: #fff;
	color: var(--fm-give-fg);
	border-radius: var(--fm-give-radius);
	padding: 1rem;
	font-size: 1.125rem;
	font-weight: 600;
	cursor: pointer;
	min-height: 56px;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.fm-give__chip:hover {
	border-color: var(--fm-give-accent);
}

.fm-give__chip.is-selected {
	border-color: var(--fm-give-accent);
	background: var(--fm-give-accent);
	color: #fff;
}

.fm-give__chip--custom {
	font-weight: 500;
}

/* Fields */
.fm-give__field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.fm-give__label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--fm-give-muted);
}

.fm-give__custom {
	position: relative;
	flex-direction: row;
	align-items: center;
	border: 2px solid var(--fm-give-border);
	border-radius: var(--fm-give-radius);
	padding: 0 1rem;
}

.fm-give__custom:focus-within {
	border-color: var(--fm-give-accent);
}

.fm-give__prefix {
	font-size: 1.375rem;
	font-weight: 600;
	color: var(--fm-give-muted);
}

.fm-give__custom-input {
	flex: 1;
	border: 0;
	outline: 0;
	background: transparent;
	font-size: 1.375rem;
	font-weight: 600;
	padding: 0.875rem 0.5rem;
	color: var(--fm-give-fg);
	width: 100%;
}

.fm-give__input {
	width: 100%;
	border: 2px solid var(--fm-give-border);
	border-radius: var(--fm-give-radius);
	padding: 0.875rem 1rem;
	font-size: 1rem;
	color: var(--fm-give-fg);
	background: #fff;
	min-height: 52px;
}

.fm-give__input:focus {
	outline: 0;
	border-color: var(--fm-give-accent);
}

.fm-give__note {
	min-height: 72px;
	resize: vertical;
	font-family: inherit;
}

.fm-give__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.fm-give__select {
	width: 100%;
	border: 2px solid var(--fm-give-border);
	border-radius: var(--fm-give-radius);
	padding: 0.875rem 1rem;
	font-size: 1rem;
	background: #fff;
	min-height: 52px;
	color: var(--fm-give-fg);
}

/* Cover the fees */
.fm-give__cover {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	background: var(--fm-give-surface);
	border-radius: var(--fm-give-radius);
	padding: 0.875rem 1rem;
	cursor: pointer;
}

.fm-give__cover input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin-top: 2px;
	accent-color: var(--fm-give-accent);
	flex-shrink: 0;
}

.fm-give__cover-line {
	font-size: 0.9375rem;
	color: var(--fm-give-fg);
}

/* Frequencies */
.fm-give__freqs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.fm-give__freq {
	position: relative;
	appearance: none;
	border: 2px solid var(--fm-give-border);
	background: #fff;
	color: var(--fm-give-fg);
	border-radius: 999px;
	padding: 0.625rem 1.25rem;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
	min-height: 44px;
}

.fm-give__freq.is-selected {
	border-color: var(--fm-give-accent);
	background: var(--fm-give-accent);
	color: #fff;
}

.fm-give__freq.is-coming-soon {
	opacity: 0.55;
	cursor: not-allowed;
}

.fm-give__soon {
	display: inline-block;
	margin-left: 0.4rem;
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: var(--fm-give-muted);
	color: #fff;
	border-radius: 4px;
	padding: 0.1rem 0.35rem;
	vertical-align: middle;
}

/* Summary */
.fm-give__summary {
	font-size: 1.25rem;
	color: var(--fm-give-fg);
}

/* Payment element mount */
.fm-give__payment-element {
	min-height: 40px;
}

.fm-give__dev-note,
.fm-give__notice {
	background: #fff8e1;
	border: 1px solid #f0d98a;
	border-radius: 8px;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	color: #6b5900;
}

.fm-give__notice {
	background: var(--fm-give-surface);
	border-color: var(--fm-give-border);
	color: var(--fm-give-muted);
}

/* Honeypot — visually hidden but present in DOM for bots. */
.fm-give__honeypot {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Navigation + submit */
.fm-give__nav {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.fm-give__back {
	appearance: none;
	background: transparent;
	border: 0;
	color: var(--fm-give-muted);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	padding: 0.75rem 0.5rem;
}

:where(.fm-give__submit) {
	flex: 1;
	appearance: none;
	border: 0;
	background: var(--fm-give-btn-bg);
	color: var(--fm-give-btn-text);
	border-radius: var(--fm-give-radius);
	padding: 1rem 1.5rem;
	font-size: 1.0625rem;
	font-weight: 700;
	cursor: pointer;
	min-height: 56px;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.fm-give__submit:hover {
	background: var(--fm-give-btn-bg-hover);
}

.fm-give__submit.is-disabled,
.fm-give__submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.fm-give__submit.is-busy {
	opacity: 0.7;
	cursor: wait;
}

/* Completion */
.fm-give__complete {
	text-align: center;
	align-items: center;
	padding: 1.5rem 0;
}

.fm-give__check {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--fm-give-accent);
	color: #fff;
	font-size: 2rem;
	line-height: 64px;
	text-align: center;
}

.fm-give__thanks {
	margin: 0;
	font-size: 1.5rem;
}

.fm-give__status {
	color: var(--fm-give-muted);
	margin: 0;
}

/* Recurring consent (spec §6.6) */
.fm-give__consent {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	margin: 0.75rem 0 0;
	font-size: 0.85rem;
	line-height: 1.4;
	color: var(--fm-give-muted, #667085);
}

.fm-give__consent-cb {
	margin-top: 0.15rem;
	flex: 0 0 auto;
}

.fm-give__consent-line {
	flex: 1 1 auto;
}

/* Turnstile */
.fm-give__turnstile {
	min-height: 65px;
}

@media (min-width: 480px) {
	.fm-give__chips {
		grid-template-columns: repeat(3, 1fr);
	}
}
