/**
 * HF Rewards — dashboard styles.
 *
 * Amber field, gold Larken display headings, Mode Sans body, taupe buttons that
 * go coral on hover and when selected. Mobile-first.
 *
 * Font files load from Showit's CDN unless local copies exist in public/fonts/,
 * in which case the plugin prints an override at render time.
 */

@font-face {
	font-family: "Larken";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("https://static.showit.com/file/tGpIU8o6AOscTczw6Rhrgg/291918/larken_bold.woff") format("woff");
}

@font-face {
	font-family: "Larken";
	font-style: italic;
	font-weight: 700;
	font-display: swap;
	src: url("https://static.showit.com/file/r-qR_uPj-g7yVO5zUfhdEA/291918/larken-bold-italic.woff") format("woff");
}

@font-face {
	font-family: "Mode Sans";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("https://static.showit.com/file/dG2twEoS3-fNNbzvbFAvVg/291918/modesansbook-regular.woff") format("woff");
}

.hfr {
	--hfr-amber: #fde6b8;
	--hfr-gold: #f8bd5d;
	--hfr-coral: #ff6c58;
	--hfr-coral-deep: #f0563f;
	--hfr-green: #073b2e;
	--hfr-taupe: #e3d5ba;
	--hfr-taupe-text: #7d6d57;
	--hfr-rule: rgba(7, 59, 46, 0.14);
	--hfr-display: "Larken", Georgia, "Times New Roman", serif;
	--hfr-body: "Mode Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

	box-sizing: border-box;
	max-width: 34rem;
	margin: 0 auto;
	padding: 2rem 1.25rem 2.5rem;
	background: var(--hfr-amber);
	border-radius: 1.5rem;
	color: var(--hfr-green);
	font-family: var(--hfr-body);
	font-size: 1rem;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

.hfr *,
.hfr *::before,
.hfr *::after {
	box-sizing: inherit;
}

/**
 * Themes style embedded content with broad selectors and heavy specificity.
 * Everything inside the widget starts from a known baseline so nothing inherits
 * theme typography, spacing, or button styling.
 *
 * :where() is deliberate. A plain `.hfr span` selector outranks `.hfr__count-of`,
 * so the reset would silently beat the widget's own styling — which is exactly
 * what happened: the progress track lost its background and the /100 lost its
 * font. :where() carries no specificity, so the classes below always win.
 */
.hfr :where(div, p, span, ul, li, code, label, a, button, input, textarea) {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	font-style: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
	color: inherit;
	box-shadow: none;
	text-decoration: none;
	list-style: none;
}

.hfr :where(p) {
	margin: 0;
}

/**
 * The [hidden] attribute loses to any class that sets display, which is most of
 * them here. This puts it back in charge.
 */
.hfr [hidden] {
	display: none !important;
}

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

.hfr .hfr__display {
	margin: 0 0 0.5rem;
	font-family: var(--hfr-display);
	font-weight: 700;
	font-size: 1.6rem;
	line-height: 1.15;
	color: var(--hfr-coral);
}

.hfr .hfr__muted {
	color: var(--hfr-taupe-text);
	font-size: 0.95rem;
}

/* --- Gate --------------------------------------------------------------- */

.hfr__row {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin-top: 1rem;
}

.hfr__row--split {
	flex-direction: row;
	gap: 0.6rem;
}

.hfr__row--split .hfr__btn {
	flex: 1 1 0;
}

.hfr .hfr__input {
	width: 100%;
	padding: 0.85rem 1rem;
	border: 1.5px solid var(--hfr-rule);
	border-radius: 0.75rem;
	background: #fff;
	color: var(--hfr-green);
	font: inherit;
}

.hfr__input:focus-visible {
	outline: 2.5px solid var(--hfr-coral);
	outline-offset: 1px;
	border-color: transparent;
}

.hfr__error {
	margin-top: 0.6rem;
	color: #a52d1c;
	font-size: 0.9rem;
}

.hfr__consent {
	margin-top: 0.85rem;
	font-size: 0.85rem;
	line-height: 1.45;
	text-align: center;
	color: var(--hfr-taupe-text);
}

/* --- Loading ------------------------------------------------------------ */

.hfr__loading {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 1.5rem 0;
	color: var(--hfr-taupe-text);
	font-size: 0.95rem;
}

.hfr__pulse {
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 50%;
	background: var(--hfr-coral);
	animation: hfr-pulse 1.1s ease-in-out infinite;
}

@keyframes hfr-pulse {
	0%, 100% { opacity: 0.25; transform: scale(0.8); }
	50%      { opacity: 1;    transform: scale(1); }
}

/* --- Hero --------------------------------------------------------------- */

.hfr__hero {
	padding-bottom: 1.75rem;
	border-bottom: 1.5px solid var(--hfr-rule);
}

.hfr .hfr__greeting {
	margin-bottom: 0.35rem;
	font-family: var(--hfr-display);
	font-weight: 700;
	font-size: 1.4rem;
	color: var(--hfr-coral);
}

.hfr__count {
	display: flex;
	align-items: baseline;
	gap: 0.1rem;
	margin-bottom: 0.9rem;
	line-height: 1;
	font-family: var(--hfr-display);
	font-weight: 700;
}

.hfr .hfr__count-now {
	font-size: 4.25rem;
	letter-spacing: -0.02em;
	color: var(--hfr-coral);
}

.hfr__count-of {
	font-size: 1.5rem;
	color: var(--hfr-taupe-text);
}

.hfr__track {
	position: relative;
	height: 1.15rem;
	border-radius: 999px;
	background: rgba(7, 59, 46, 0.12);
	overflow: hidden;
}

.hfr__fill {
	display: block;
	width: 0;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--hfr-gold), var(--hfr-coral));
	transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hfr__remaining {
	margin-top: 0.75rem;
	font-size: 0.95rem;
	color: var(--hfr-taupe-text);
}

.hfr--complete .hfr__count-now {
	color: var(--hfr-gold);
}

/* --- Credit ------------------------------------------------------------- */

.hfr__credit {
	margin-top: 1.75rem;
	padding: 1.5rem 1.25rem;
	border: 2px dashed var(--hfr-coral);
	border-radius: 1rem;
	background: #fff;
	text-align: center;
}

.hfr__credit-label {
	font-size: 0.9rem;
	color: var(--hfr-taupe-text);
}

.hfr .hfr__credit-code {
	margin: 0.4rem 0 0.5rem;
	font-family: var(--hfr-display);
	font-weight: 700;
	font-size: 1.9rem;
	letter-spacing: 0.04em;
	color: var(--hfr-coral);
}

.hfr__credit-note,
.hfr__credit-again {
	font-size: 0.9rem;
	color: var(--hfr-taupe-text);
}

.hfr__credit-note {
	margin-bottom: 1rem;
}

.hfr__credit-actions {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.hfr__credit-again {
	margin-top: 0.9rem;
	font-family: var(--hfr-display);
	font-style: italic;
	font-weight: 700;
	color: var(--hfr-gold);
}

/* --- Sections and rows -------------------------------------------------- */

.hfr__section {
	padding: 1.75rem 0;
	border-bottom: 1.5px solid var(--hfr-rule);
}

.hfr__section:last-of-type {
	border-bottom: 0;
	padding-bottom: 0.5rem;
}

.hfr__list {
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.hfr__item {
	display: grid;
	grid-template-columns: 3rem 1fr;
	gap: 0 0.9rem;
	padding: 1.1rem 0;
	border-top: 1px solid var(--hfr-rule);
}

.hfr__item:first-child {
	border-top: 0;
	padding-top: 0;
}

.hfr .hfr__tile {
	grid-row: 1 / span 4;
	align-self: start;
	width: 3rem;
	height: 3rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.85rem;
	background: var(--hfr-taupe);
	color: var(--hfr-green);
	font-family: var(--hfr-display);
	font-weight: 700;
	font-size: 0.95rem;
}

.hfr__item--done .hfr__tile {
	background: var(--hfr-gold);
	color: #fff;
	font-size: 1.35rem;
}

.hfr .hfr__item-label {
	font-family: var(--hfr-display);
	font-weight: 700;
	font-size: 1.2rem;
	line-height: 1.2;
	color: var(--hfr-green);
}

.hfr__item--done .hfr__item-label {
	color: var(--hfr-taupe-text);
}

.hfr__item-desc {
	margin-top: 0.25rem;
	font-size: 0.92rem;
	color: var(--hfr-taupe-text);
}

.hfr__item-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin-top: 0.85rem;
}

.hfr__earned {
	margin-top: 0.5rem;
	font-size: 0.9rem;
	color: var(--hfr-coral);
}

/* --- The question ------------------------------------------------------- */

.hfr__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.85rem;
}

.hfr .hfr__choice {
	appearance: none;
	padding: 0.55rem 1rem;
	border: 1.5px solid transparent;
	border-radius: 999px;
	background: var(--hfr-taupe);
	color: var(--hfr-green);
	font: inherit;
	font-size: 0.92rem;
	cursor: pointer;
	transition: background-color 140ms ease, color 140ms ease;
}

.hfr__choice:hover,
.hfr__choice[aria-pressed="true"] {
	background: var(--hfr-coral);
	color: #fff;
}

.hfr__choice:focus-visible {
	outline: 2.5px solid var(--hfr-green);
	outline-offset: 2px;
}

.hfr .hfr__note {
	width: 100%;
	margin-top: 0.75rem;
	padding: 0.7rem 0.85rem;
	border: 1.5px solid var(--hfr-rule);
	border-radius: 0.75rem;
	background: #fff;
	color: var(--hfr-green);
	font: inherit;
	font-size: 0.92rem;
	resize: vertical;
}

/* --- Buttons ------------------------------------------------------------ */

.hfr .hfr__btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.85rem;
	padding: 0.65rem 1.25rem;
	border: 1.5px solid transparent;
	border-radius: 999px;
	background: var(--hfr-coral);
	color: #fff;
	font: inherit;
	font-size: 0.95rem;
	text-align: center;
	cursor: pointer;
	transition: background-color 140ms ease;
}

.hfr__btn:hover,
.hfr__btn--active {
	background: var(--hfr-coral-deep);
}

.hfr__btn:focus-visible {
	outline: 2.5px solid var(--hfr-green);
	outline-offset: 2px;
}

.hfr__btn[disabled] {
	opacity: 0.5;
	cursor: default;
}

.hfr__btn[disabled]:hover {
	background: var(--hfr-coral);
}

.hfr__btn--wide {
	width: 100%;
}

/* --- Referral ----------------------------------------------------------- */

.hfr .hfr__link {
	display: block;
	margin-top: 1rem;
	padding: 0.85rem 0.95rem;
	border: 1.5px solid var(--hfr-rule);
	border-radius: 0.75rem;
	background: #fff;
	font-family: var(--hfr-body);
	font-size: 0.9rem;
	word-break: break-all;
}

.hfr__referrals {
	margin-top: 1.1rem;
	font-size: 0.95rem;
	color: var(--hfr-coral);
}

/* --- Closing ------------------------------------------------------------ */

.hfr .hfr__closing {
	padding-top: 1.75rem;
	font-family: var(--hfr-display);
	font-style: italic;
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--hfr-gold);
}

/* --- Toast -------------------------------------------------------------- */

.hfr__toast {
	position: fixed;
	left: 50%;
	bottom: 1.25rem;
	transform: translateX(-50%);
	z-index: 9999;
	max-width: calc(100vw - 2rem);
	padding: 0.75rem 1.2rem;
	border-radius: 999px;
	background: var(--hfr-green);
	color: #fff;
	font-size: 0.9rem;
	text-align: center;
}

/* --- The store banner --------------------------------------------------- */

.hfr-banner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.4rem 0.75rem;
	margin: 0 0 1.25rem;
	padding: 0.85rem 1.25rem;
	border-radius: 999px;
	background: #fde6b8;
	color: #073b2e;
	font-family: "Mode Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	font-size: 0.95rem;
	text-align: center;
}

.hfr-banner__code {
	font-family: "Larken", Georgia, serif;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: #ff6c58;
}

.hfr-banner--applied {
	background: #f8bd5d;
	color: #fff;
}

.hfr-banner--applied .hfr-banner__code {
	color: #fff;
}

/* --- Wider screens ------------------------------------------------------ */

@media (min-width: 30rem) {
	.hfr {
		padding: 2.5rem 2rem 2.75rem;
	}

	.hfr__row {
		flex-direction: row;
		align-items: center;
	}

	.hfr__row .hfr__input {
		flex: 1 1 auto;
	}

	.hfr__row .hfr__input--name {
		flex: 0 0 10rem;
	}

	.hfr__credit-actions {
		flex-direction: row;
		justify-content: center;
	}

	.hfr__count-now {
		font-size: 5rem;
	}

	.hfr__display {
		font-size: 1.8rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hfr__fill { transition: none; }
	.hfr__pulse { animation: none; opacity: 0.6; }
}
