/**
 * HBWA Interactive Ratings for Contact Form 7 — frontend styles
 * Themes: gold, ember, ocean, forest, mono
 */

.hbwa-sr-wrap {
	--hbwa-sr-on: #e8a317;
	--hbwa-sr-on-glow: rgba(232, 163, 23, 0.35);
	--hbwa-sr-off: #c4c4c8;
	--hbwa-sr-label: #3f3f46;
	--hbwa-sr-size: 1.85rem;
	--hbwa-sr-gap: 0.28rem;

	display: inline-block;
	max-width: 100%;
	vertical-align: top;
	position: relative;
}

.hbwa-sr-theme-gold {
	--hbwa-sr-on: #e8a317;
	--hbwa-sr-on-glow: rgba(232, 163, 23, 0.4);
}

.hbwa-sr-theme-ember {
	--hbwa-sr-on: #e85d04;
	--hbwa-sr-on-glow: rgba(232, 93, 4, 0.4);
}

.hbwa-sr-theme-ocean {
	--hbwa-sr-on: #0d9488;
	--hbwa-sr-on-glow: rgba(13, 148, 136, 0.4);
}

.hbwa-sr-theme-forest {
	--hbwa-sr-on: #4d7c0f;
	--hbwa-sr-on-glow: rgba(77, 124, 15, 0.4);
}

.hbwa-sr-theme-mono {
	--hbwa-sr-on: #18181b;
	--hbwa-sr-on-glow: rgba(24, 24, 27, 0.22);
	--hbwa-sr-off: #a1a1aa;
}

.hbwa-sr-size-sm { --hbwa-sr-size: 1.35rem; --hbwa-sr-gap: 0.18rem; }
.hbwa-sr-size-md { --hbwa-sr-size: 1.85rem; --hbwa-sr-gap: 0.28rem; }
.hbwa-sr-size-lg { --hbwa-sr-size: 2.35rem; --hbwa-sr-gap: 0.34rem; }
.hbwa-sr-size-xl { --hbwa-sr-size: 2.9rem; --hbwa-sr-gap: 0.4rem; }

.hbwa-sr-widget {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.65rem;
}

.hbwa-sr-stars {
	display: inline-flex;
	align-items: center;
	gap: var(--hbwa-sr-gap);
	line-height: 0;
}

.hbwa-sr-star {
	position: relative;
	display: inline-block;
	width: var(--hbwa-sr-size);
	height: var(--hbwa-sr-size);
	color: var(--hbwa-sr-off);
	cursor: pointer;
	transition: transform 0.18s cubic-bezier(0.34, 1.45, 0.64, 1), color 0.15s ease, filter 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.hbwa-sr-star:hover,
.hbwa-sr-star.is-preview,
.hbwa-sr-star.is-full,
.hbwa-sr-star.is-half {
	color: var(--hbwa-sr-on);
}

.hbwa-sr-star.is-full,
.hbwa-sr-star.is-half,
.hbwa-sr-star.is-preview {
	filter: drop-shadow(0 2px 6px var(--hbwa-sr-on-glow));
}

.hbwa-sr-star.is-pop {
	animation: hbwa-sr-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hbwa-sr-pop {
	0% { transform: scale(1); }
	40% { transform: scale(1.28); }
	100% { transform: scale(1); }
}

.hbwa-sr-icon {
	--hbwa-sr-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.9 5.88 6.49.94-4.7 4.58 1.11 6.46L12 17.77l-5.8 3.05 1.11-6.46-4.7-4.58 6.49-.94L12 2.5z'/%3E%3C/svg%3E");
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	pointer-events: none;
}

.hbwa-sr-icon::before,
.hbwa-sr-icon::after {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	-webkit-mask: var(--hbwa-sr-mask) center / contain no-repeat;
	mask: var(--hbwa-sr-mask) center / contain no-repeat;
	transition: opacity 0.12s ease, clip-path 0.12s ease;
}

.hbwa-sr-icon::before {
	opacity: 0.28;
}

.hbwa-sr-icon::after {
	opacity: 0;
}

.hbwa-sr-star.is-full .hbwa-sr-icon::after,
.hbwa-sr-star.is-preview.is-preview-full .hbwa-sr-icon::after {
	opacity: 1;
	clip-path: inset(0 0 0 0);
}

.hbwa-sr-star.is-half .hbwa-sr-icon::after,
.hbwa-sr-star.is-preview.is-preview-half .hbwa-sr-icon::after {
	opacity: 1;
	clip-path: inset(0 50% 0 0);
}

.hbwa-sr-hit {
	position: absolute;
	top: 0;
	bottom: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	appearance: none;
}

.hbwa-sr-hit:focus {
	outline: none;
}

.hbwa-sr-hit--full {
	left: 0;
	right: 0;
	width: 100%;
}

.hbwa-sr-half .hbwa-sr-hit--full {
	left: 50%;
	width: 50%;
}

.hbwa-sr-hit--half {
	left: 0;
	width: 50%;
	display: none;
}

.hbwa-sr-half .hbwa-sr-hit--half {
	display: block;
}

.hbwa-sr-live-label {
	display: none;
	color: var(--hbwa-sr-label);
	font-size: 0.85rem;
	font-weight: 500;
	line-height: 1.3;
	white-space: nowrap;
	pointer-events: none;
}

.hbwa-sr-wrap.is-hovering .hbwa-sr-live-label,
.hbwa-sr-wrap:focus-within .hbwa-sr-live-label {
	display: inline-block;
}

.hbwa-sr-clear {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #71717a;
	font-size: 0.75rem;
	font-weight: 500;
	text-decoration: underline;
	cursor: pointer;
}

.hbwa-sr-clear:hover,
.hbwa-sr-clear:focus-visible {
	color: var(--hbwa-sr-on);
	outline: none;
}

.hbwa-sr-native,
.hbwa-sr-wrap .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.hbwa-sr-wrap:has(.hbwa-sr-hit:focus-visible) .hbwa-sr-stars {
	outline: 2px solid var(--hbwa-sr-on);
	outline-offset: 3px;
	border-radius: 2px;
}

.hbwa-sr-wrap.wpcf7-not-valid .hbwa-sr-stars {
	outline: 2px solid #dc2626;
	outline-offset: 3px;
	border-radius: 2px;
}

/* Sparkle burst on max rating */
.hbwa-sr-wrap.is-perfect .hbwa-sr-star.is-full {
	animation: hbwa-sr-shine 0.7s ease;
}

@keyframes hbwa-sr-shine {
	0%, 100% { filter: drop-shadow(0 2px 6px var(--hbwa-sr-on-glow)); }
	50% { filter: drop-shadow(0 0 12px var(--hbwa-sr-on)) drop-shadow(0 2px 4px var(--hbwa-sr-on-glow)); }
}

@media (prefers-reduced-motion: reduce) {
	.hbwa-sr-star,
	.hbwa-sr-star.is-pop,
	.hbwa-sr-wrap.is-perfect .hbwa-sr-star.is-full,
	.hbwa-sr-live-label {
		animation: none !important;
		transition: none !important;
	}
}

@media (max-width: 480px) {
	.hbwa-sr-size-xl { --hbwa-sr-size: 2.4rem; }
}
