/*
 * Structure only. Every colour, radius and font comes from a --fuel-* custom
 * property that first tries the theme's theme.json preset and then falls back to
 * a literal, so this file needs no knowledge of the active theme and the theme
 * needs no knowledge of this markup. A theme restyles by redefining --fuel-*,
 * never by copying a template.
 */

.fuel-progress,
.fuel-form,
.fuel-supporters,
.fuel-breakdown,
.fuel-notice,
.fuel-inline-stat {
	--fuel-ink: var(--wp--preset--color--ink, #1c1a17);
	--fuel-base: var(--wp--preset--color--base, #f6f3ec);
	--fuel-surface: var(--wp--preset--color--surface, #fffdf8);
	--fuel-accent: var(--wp--preset--color--accent, #b0543c);
	--fuel-accent-soft: var(--wp--preset--color--accent-soft, #d8895c);
	--fuel-muted: var(--wp--preset--color--muted, #6f685d);
	--fuel-subtle: var(--wp--preset--color--subtle, #756e62);
	--fuel-hairline: var(--wp--preset--color--hairline, #e6e0d3);
	--fuel-track: var(--wp--preset--color--track, #efe9dc);
	--fuel-positive: var(--wp--preset--color--positive-ink, #3f7a52);

	--fuel-display: var(--wp--preset--font-family--display, "Bricolage Grotesque", system-ui, sans-serif);
	--fuel-body: var(--wp--preset--font-family--body, "Hanken Grotesk", system-ui, sans-serif);

	--fuel-radius: 1.5rem;
	--fuel-radius-sm: 0.75rem;
	--fuel-gap: 1rem;

	font-family: var(--fuel-body);
	color: var(--fuel-ink);
	box-sizing: border-box;
}

.fuel-progress *,
.fuel-form *,
.fuel-supporters *,
.fuel-breakdown *,
.fuel-notice * {
	box-sizing: inherit;
}

/* ---------- Progress ---------- */

.fuel-progress {
	background: var(--fuel-surface);
	border: 1px solid var(--fuel-hairline);
	border-radius: var(--fuel-radius);
	padding: clamp(1.5rem, 4vw, 3rem);
	box-shadow: 0 30px 60px -50px rgb(28 26 23 / 50%);
}

.fuel-progress--compact {
	padding: clamp(1.25rem, 3vw, 2rem);
}

.fuel-progress__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
}

.fuel-progress__primary,
.fuel-progress__secondary {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.fuel-progress__secondary {
	text-align: right;
	align-items: flex-end;
}

.fuel-progress__label {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--fuel-subtle);
}

.fuel-progress__amount {
	font-family: var(--fuel-display);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1;
	font-size: clamp(2.75rem, 8vw, 4.75rem);
	font-variant-numeric: tabular-nums;
}

.fuel-progress__target {
	font-family: var(--fuel-display);
	font-weight: 600;
	letter-spacing: -0.02em;
	font-size: clamp(1.375rem, 3vw, 1.875rem);
	color: var(--fuel-muted);
	font-variant-numeric: tabular-nums;
}

/*
 * Two segments, not one. A single bar labelled "pledged" reads as money in the
 * bank; the outlined portion is what has been promised and the solid portion is
 * what has actually arrived.
 */
.fuel-progress__track {
	position: relative;
	margin-top: clamp(1.5rem, 3vw, 2rem);
	height: 1rem;
	border-radius: 999px;
	background: var(--fuel-track);
	overflow: hidden;
}

.fuel-progress__fill {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	display: block;
	border-radius: 999px;
	transition: width 0.6s ease;
}

.fuel-progress__fill--pledged {
	background: repeating-linear-gradient(
		135deg,
		color-mix(in srgb, var(--fuel-accent) 30%, transparent),
		color-mix(in srgb, var(--fuel-accent) 30%, transparent) 6px,
		color-mix(in srgb, var(--fuel-accent) 12%, transparent) 6px,
		color-mix(in srgb, var(--fuel-accent) 12%, transparent) 12px
	);
	border: 1px solid color-mix(in srgb, var(--fuel-accent) 55%, transparent);
}

.fuel-progress__fill--received {
	background: linear-gradient(90deg, var(--fuel-accent-soft), var(--fuel-accent));
}

.fuel-progress__note {
	margin: 1rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--fuel-subtle);
}

.fuel-progress__stats {
	list-style: none;
	margin: clamp(1.5rem, 3vw, 2rem) 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: clamp(1.25rem, 4vw, 3.5rem);
}

.fuel-stat {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.fuel-stat__value {
	font-family: var(--fuel-display);
	font-weight: 700;
	font-size: 1.75rem;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.fuel-stat__label {
	font-size: 0.875rem;
	color: var(--fuel-muted);
}

.fuel-inline-stat {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.fuel-badge {
	align-self: flex-end;
	border-radius: 999px;
	padding: 0.2rem 0.7rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: var(--fuel-track);
	color: var(--fuel-subtle);
}

/* ---------- Form ---------- */

.fuel-form {
	background: var(--fuel-surface);
	border-radius: var(--fuel-radius);
	padding: clamp(1.5rem, 3vw, 2.25rem);
	display: flex;
	flex-direction: column;
	gap: 1rem;
	box-shadow: 0 40px 80px -50px rgb(0 0 0 / 60%);
}

.fuel-form__summary {
	border: 1px solid var(--fuel-accent);
	border-left-width: 4px;
	border-radius: var(--fuel-radius-sm);
	padding: 0.9rem 1.1rem;
	background: color-mix(in srgb, var(--fuel-accent) 8%, transparent);
}

.fuel-form__summary-title {
	margin: 0;
	font-weight: 600;
}

.fuel-form__summary ul {
	margin: 0.5rem 0 0;
	padding-inline-start: 1.2rem;
	font-size: 0.9375rem;
}

.fuel-form__amounts {
	border: 0;
	margin: 0;
	padding: 0;
}

.fuel-form__legend {
	padding: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fuel-subtle);
}

.fuel-form__presets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr));
	gap: 0.625rem;
	margin-top: 0.875rem;
}

.fuel-preset__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.fuel-preset__label {
	display: block;
	text-align: center;
	cursor: pointer;
	font-family: var(--fuel-display);
	font-weight: 600;
	font-size: 1.125rem;
	padding: 0.9rem 0;
	border-radius: var(--fuel-radius-sm);
	border: 1px solid var(--fuel-hairline);
	background: var(--fuel-base);
	transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.fuel-preset__input:checked + .fuel-preset__label {
	border: 1.5px solid var(--fuel-accent);
	background: color-mix(in srgb, var(--fuel-accent) 10%, var(--fuel-surface));
	color: var(--fuel-accent);
}

.fuel-preset__input:focus-visible + .fuel-preset__label {
	outline: 2px solid var(--fuel-accent);
	outline-offset: 2px;
}

.fuel-field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.fuel-field--amount {
	margin-top: 0.75rem;
}

.fuel-field__label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--fuel-ink);
}

.fuel-field__required {
	color: var(--fuel-accent);
}

.fuel-field__prefixed {
	position: relative;
	display: flex;
	align-items: center;
}

.fuel-field__prefix {
	position: absolute;
	inset-inline-start: 1rem;
	font-weight: 600;
	color: var(--fuel-subtle);
	pointer-events: none;
}

.fuel-field__prefixed .fuel-field__input {
	padding-inline-start: 2rem;
}

.fuel-field__input {
	width: 100%;
	font: inherit;
	font-size: 1rem;
	color: var(--fuel-ink);
	background: var(--fuel-base);
	border: 1px solid var(--fuel-hairline);
	border-radius: var(--fuel-radius-sm);
	padding: 0.8rem 1rem;
}

.fuel-field__input--area {
	resize: vertical;
	min-height: 3.5rem;
}

.fuel-field__input:focus-visible {
	outline: 2px solid var(--fuel-accent);
	outline-offset: 2px;
	border-color: var(--fuel-accent);
}

.fuel-field__input[aria-invalid="true"] {
	border-color: var(--fuel-accent);
	border-width: 1.5px;
}

.fuel-field__hint,
.fuel-field__error {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.45;
}

.fuel-field__hint {
	color: var(--fuel-subtle);
}

.fuel-field__error {
	color: var(--fuel-accent);
	font-weight: 600;
}

.fuel-field--check {
	flex-direction: row;
	align-items: flex-start;
	gap: 0.7rem;
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--fuel-muted);
}

.fuel-field--check input {
	flex: none;
	inline-size: 1.0625rem;
	block-size: 1.0625rem;
	margin-top: 0.15rem;
	accent-color: var(--fuel-accent);
}

.fuel-field--check label {
	cursor: pointer;
}

.fuel-form__consent {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--fuel-subtle);
}

/*
 * Positioned off-screen rather than display:none, because a fair number of bots
 * skip fields that are display:none and would sail past the trap.
 */
.fuel-honeypot {
	position: absolute !important;
	inset-inline-start: -9999px;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
}

.fuel-form__submit {
	width: 100%;
	margin-top: 0.5rem;
	cursor: pointer;
	font: inherit;
	font-size: 1.0625rem;
	font-weight: 700;
	padding: 1.05rem;
	border: 0;
	border-radius: 0.875rem;
	background: var(--fuel-accent);
	color: #fff;
	box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--fuel-accent) 80%, transparent);
	transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.fuel-form__submit:hover {
	transform: translateY(-1px);
}

.fuel-form__submit:focus-visible {
	outline: 2px solid var(--fuel-ink);
	outline-offset: 3px;
}

.fuel-form__footnote,
.fuel-form__privacy {
	margin: 0;
	text-align: center;
	font-size: 0.78125rem;
	line-height: 1.5;
	color: var(--fuel-subtle);
}

.fuel-form__privacy {
	text-align: start;
}

.fuel-form--closed {
	text-align: center;
}

.fuel-form__closed-message {
	margin: 0;
	font-size: 1.0625rem;
	color: var(--fuel-muted);
}

/* ---------- Supporters ---------- */

.fuel-supporters__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 0.875rem;
}

.fuel-supporter {
	background: var(--fuel-surface);
	border: 1px solid var(--fuel-hairline);
	border-radius: 1rem;
	padding: 1.125rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.fuel-supporter__head {
	display: flex;
	align-items: center;
	gap: 0.625rem;
}

.fuel-supporter__avatar {
	inline-size: 2.125rem;
	block-size: 2.125rem;
	flex: none;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-family: var(--fuel-display);
	font-weight: 700;
	font-size: 0.875rem;
}

.fuel-supporter__name {
	font-weight: 600;
}

.fuel-supporter__amount {
	margin-inline-start: auto;
	font-family: var(--fuel-display);
	font-weight: 700;
	color: var(--fuel-accent);
}

.fuel-supporter__message {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--fuel-muted);
}

.fuel-supporters__others,
.fuel-supporters__empty {
	margin: 1.25rem 0 0;
	font-size: 0.875rem;
	color: var(--fuel-subtle);
}

/* ---------- Breakdown ---------- */

.fuel-breakdown {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1.125rem;
}

.fuel-breakdown__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.75rem;
}

.fuel-breakdown__label {
	font-weight: 600;
}

.fuel-breakdown__amount {
	font-family: var(--fuel-display);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.fuel-breakdown__track {
	margin-top: 0.5rem;
	block-size: 0.5rem;
	border-radius: 999px;
	background: var(--fuel-track);
	overflow: hidden;
}

.fuel-breakdown__fill {
	display: block;
	block-size: 100%;
	border-radius: 999px;
}

.fuel-breakdown__note {
	margin: 0.4375rem 0 0;
	font-size: 0.84375rem;
	line-height: 1.5;
	color: var(--fuel-subtle);
}

/* ---------- Notices and self-service ---------- */

.fuel-notice {
	background: var(--fuel-surface);
	border: 1px solid var(--fuel-hairline);
	border-radius: var(--fuel-radius);
	padding: clamp(1.5rem, 4vw, 2.5rem);
}

.fuel-notice__eyebrow {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--fuel-accent);
	margin-bottom: 0.5rem;
}

.fuel-notice__title {
	font-family: var(--fuel-display);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.05;
	font-size: clamp(1.6rem, 5vw, 2.5rem);
	margin: 0 0 0.75rem;
}

.fuel-notice__body {
	margin: 0 0 1.25rem;
	color: var(--fuel-muted);
	line-height: 1.6;
}

.fuel-notice__small {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--fuel-subtle);
}

.fuel-manage__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

.fuel-manage__actions form {
	margin: 0;
}

.fuel-button {
	display: inline-block;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	border: 0;
	border-radius: 999px;
	padding: 0.85rem 1.6rem;
	background: var(--fuel-accent);
	color: #fff;
}

.fuel-button--quiet {
	background: transparent;
	color: var(--fuel-ink);
	border: 1px solid var(--fuel-hairline);
}

.fuel-button:focus-visible {
	outline: 2px solid var(--fuel-accent);
	outline-offset: 2px;
}

/*
 * The final numbers are always in the markup, so the count-up is decoration and
 * nothing breaks when it is switched off.
 */
@media (prefers-reduced-motion: reduce) {
	.fuel-progress__fill,
	.fuel-preset__label,
	.fuel-form__submit {
		transition: none;
	}
}
