/* Product reviews.
 *
 * Loaded on the flat product pages only. The section sits inside the product
 * shell, so it inherits the page tokens: --tp-* while it is inside
 * .hbg-tool-page, --hbg-* everywhere else.
 */

.hbg-reviews {
	--rv-ink: var(--tp-ink, var(--hbg-ink, #16181d));
	--rv-muted: var(--tp-muted, var(--hbg-muted, #5f646d));
	--rv-faint: var(--tp-faint, var(--hbg-faint, #8b8f96));
	--rv-line: var(--tp-line, var(--hbg-line, #e6e8ec));
	--rv-line-strong: var(--hbg-line-strong, #d6d9df);
	--rv-card: var(--tp-card, var(--hbg-surface, #ffffff));
	--rv-soft: var(--tp-soft, var(--hbg-surface-2, #f6f7f9));
	--rv-accent: var(--hbg-accent, #6571ff);
	--rv-accent-hi: var(--hbg-accent-hi, #7a85ff);
	--rv-accent-ink: var(--hbg-accent-ink, #4a55e0);
	--rv-accent-soft: var(--hbg-accent-soft, rgba(101, 113, 255, 0.12));
	--rv-accent-line: var(--hbg-accent-line, rgba(101, 113, 255, 0.42));

	margin: 8px 0 0;
	padding: 56px 0 8px;
	border-top: 1px solid var(--rv-line);
	color: var(--rv-ink);
	font-size: 15px;
	line-height: 1.6;
}

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

/* --------------------------------------------------------------- heading */

.hbg-rv-head {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin: 0 0 22px;
}

.hbg-rv-rule {
	height: 1px;
	flex: 1;
	max-width: 200px;
	background: linear-gradient(90deg, transparent, var(--rv-line-strong));
}

.hbg-rv-rule:last-child {
	background: linear-gradient(270deg, transparent, var(--rv-line-strong));
}

.hbg-rv-head h2 {
	margin: 0;
	color: var(--rv-ink);
	font-size: clamp(26px, 3.2vw, 38px);
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.15;
	text-align: center;
	text-wrap: balance;
}

.hbg-rv-head h2 span {
	background: linear-gradient(180deg, var(--rv-accent-hi), var(--rv-accent));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* ------------------------------------------------------------ rating pill */

.hbg-rv-meter {
	display: flex;
	justify-content: center;
	margin: 0 0 14px;
}

.hbg-rv-pill {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 12px 24px;
	border: 1px solid var(--rv-line);
	border-radius: 999px;
	background: var(--rv-card);
	color: var(--rv-muted);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	box-shadow: 0 1px 2px rgba(16, 18, 24, 0.04);
}

.hbg-rv-pill b {
	color: var(--rv-ink);
	font-weight: 700;
}

.hbg-rv-lede {
	margin: 0 0 30px;
	color: var(--rv-muted);
	font-size: 15px;
	text-align: center;
}

/* ----------------------------------------------------------------- stars */

.hbg-rv-stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	line-height: 0;
}

.hbg-rv-stars span {
	display: inline-flex;
}

.hbg-rv-stars svg {
	width: 18px;
	height: 18px;
	fill: var(--rv-line-strong);
	transition: fill 0.15s ease;
}

.hbg-rv-stars span.is-on svg {
	fill: var(--rv-accent);
	filter: drop-shadow(0 0 6px rgba(101, 113, 255, 0.35));
}

.hbg-rv-pill .hbg-rv-stars svg {
	width: 17px;
	height: 17px;
}

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

.hbg-rv-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.hbg-rv-card {
	display: flex;
	flex-direction: column;
	padding: 20px;
	border: 1px solid var(--rv-line);
	border-radius: 16px;
	background: var(--rv-card);
	transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.hbg-rv-card:hover {
	border-color: var(--rv-accent-line);
	background: var(--rv-card);
	transform: translateY(-2px);
}

.hbg-rv-who {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	min-width: 0;
}

.hbg-rv-avatar {
	position: relative;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	flex: none;
	overflow: hidden;
	border-radius: 999px;
	background:
		radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.24), transparent 46%),
		hsl(var(--av-h, 232) 42% 32%);
	box-shadow: 0 0 0 2px var(--rv-accent-soft);
	color: #ffffff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.hbg-rv-avatar::after {
	content: '';
	position: absolute;
	inset: auto 0 0;
	height: 34%;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.34), transparent);
}

.hbg-rv-who-text {
	min-width: 0;
}

.hbg-rv-name {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	overflow: hidden;
	color: var(--rv-ink);
	font-size: 14.5px;
	font-weight: 650;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.hbg-rv-verified {
	display: inline-grid;
	place-items: center;
	width: 15px;
	height: 15px;
	flex: none;
	border-radius: 999px;
	background: var(--rv-accent);
	color: #ffffff;
}

.hbg-rv-verified svg {
	width: 9px;
	height: 9px;
}

.hbg-rv-date {
	margin: 1px 0 0;
	color: var(--rv-faint);
	font-size: 12.5px;
}

.hbg-rv-card > .hbg-rv-stars {
	margin-bottom: 12px;
}

.hbg-rv-body {
	flex: 1;
	margin: 0;
	color: var(--rv-muted);
	font-size: 14.5px;
	line-height: 1.68;
	white-space: pre-line;
	overflow-wrap: anywhere;
}

.hbg-rv-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 100%;
	margin-top: 20px;
	padding: 6px 12px;
	border-radius: 8px;
	background: var(--rv-soft);
	color: var(--rv-muted);
	font-size: 12.5px;
	align-self: flex-start;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

a.hbg-rv-chip:hover {
	background: var(--rv-accent-soft);
	color: var(--rv-accent);
}

.hbg-rv-chip svg {
	width: 14px;
	height: 14px;
	flex: none;
	opacity: 0.7;
}

.hbg-rv-chip span {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* ----------------------------------------------------------- empty state */

.hbg-rv-empty {
	grid-column: 1 / -1;
	display: grid;
	gap: 4px;
	padding: 34px 24px;
	border: 1px dashed var(--rv-line-strong);
	border-radius: 16px;
	color: var(--rv-muted);
	text-align: center;
}

.hbg-rv-empty strong {
	color: var(--rv-ink);
	font-size: 15px;
	font-weight: 650;
}

/* The front door mounts the block inside the page shell, so it carries its own
   rhythm instead of the product page's top rule. */
.hbg-reviews--home {
	margin: 0;
	padding: 0;
	border-top: 0;
}

.hbg-reviews--home .hbg-rv-actions {
	display: none;
}

/* ----------------------------------------------------------------- panel */

.hbg-rv-actions {
	margin-top: 30px;
}

.hbg-rv-panel {
	padding: 22px;
	border: 1px solid var(--rv-line);
	border-radius: 16px;
	background: var(--rv-card);
}

.hbg-rv-panel h3 {
	margin: 0;
	color: var(--rv-ink);
	font-size: 16px;
	font-weight: 650;
	letter-spacing: -0.01em;
}

.hbg-rv-note {
	margin: 6px 0 0;
	color: var(--rv-muted);
	font-size: 13px;
}

/* Accent text on a white card: #6571ff is 3.9:1 at this size. The ink step of
   the same accent clears 4.5 on light; dark swaps to the lighter step below. */
.hbg-rv-note a {
	color: var(--rv-accent-ink);
	font-weight: 600;
	text-decoration: none;
}

.hbg-rv-note a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ form */

.hbg-rv-form {
	display: grid;
	gap: 18px;
}

.hbg-rv-form-head {
	display: grid;
	gap: 2px;
}

.hbg-rv-rate {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.hbg-rv-rate-label {
	color: var(--rv-muted);
	font-size: 12.5px;
	font-weight: 600;
}

.hbg-rv-rate-input {
	display: inline-flex;
	gap: 4px;
}

.hbg-rv-rate-input button {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--rv-line-strong);
	cursor: pointer;
	transition: transform 0.12s ease, color 0.12s ease;
}

.hbg-rv-rate-input button svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}

.hbg-rv-rate-input button:hover,
.hbg-rv-rate-input button.is-on {
	color: var(--rv-accent);
}

.hbg-rv-rate-input button.is-on svg {
	filter: drop-shadow(0 0 6px rgba(101, 113, 255, 0.35));
}

.hbg-rv-rate-input button:hover {
	transform: translateY(-1px);
}

.hbg-rv-fields {
	display: grid;
	gap: 14px;
}

.hbg-rv-field {
	display: grid;
	gap: 6px;
}

.hbg-rv-field > span {
	color: var(--rv-muted);
	font-size: 12px;
	font-weight: 600;
}

.hbg-rv-field > span em {
	color: var(--rv-faint);
	font-style: normal;
	font-weight: 500;
}

.hbg-rv-field input,
.hbg-rv-field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--rv-line-strong);
	border-radius: 11px;
	background: var(--rv-card);
	color: var(--rv-ink);
	font: inherit;
	font-size: 14px;
	line-height: 1.55;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hbg-rv-field textarea {
	min-height: 116px;
	resize: vertical;
}

.hbg-rv-field input::placeholder,
.hbg-rv-field textarea::placeholder {
	color: var(--rv-faint);
}

.hbg-rv-field input:focus,
.hbg-rv-field textarea:focus {
	outline: none;
	border-color: var(--rv-accent-line);
	box-shadow: 0 0 0 3px var(--rv-accent-soft);
}

.hbg-rv-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	justify-self: start;
	height: 42px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background-color: var(--rv-accent);
	background-image: linear-gradient(180deg, #7a85ff, #6571ff);
	color: #ffffff;
	font: inherit;
	font-size: 13px;
	font-weight: 650;
	cursor: pointer;
	box-shadow:
		inset 0 2px 0 rgba(255, 255, 255, 0.3),
		0 2px 10px rgba(101, 113, 255, 0.32);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hbg-rv-submit:hover {
	transform: translateY(-1px);
	box-shadow:
		inset 0 2px 0 rgba(255, 255, 255, 0.34),
		0 6px 20px rgba(101, 113, 255, 0.42);
}

.hbg-rv-submit:disabled {
	opacity: 0.6;
	cursor: default;
	transform: none;
}

/* --------------------------------------------------------------- message */

.hbg-rv-message {
	display: none;
	margin: 16px 0 0;
	padding: 12px 16px;
	border: 1px solid var(--rv-line);
	border-radius: 12px;
	background: var(--rv-soft);
	color: var(--rv-muted);
	font-size: 13.5px;
}

.hbg-rv-message.is-visible {
	display: block;
}

.hbg-rv-message.is-error {
	border-color: rgba(214, 64, 69, 0.42);
	background: rgba(214, 64, 69, 0.08);
	color: #b02a2f;
}

.hbg-rv-message.is-ok {
	border-color: var(--rv-accent-line);
	background: var(--rv-accent-soft);
	color: var(--rv-accent);
}

/* ------------------------------------------------------------------ dark */

/* The card tokens are read from --hbg-* fallbacks, and on the home page those
   still resolve to the light palette inside body.dark. Pin the dark values
   here so the review copy never inherits #5d626b on #151515. */
body.dark .hbg-reviews {
	--rv-ink: #f3f4f6;
	--rv-muted: rgba(255, 255, 255, 0.66);
	--rv-faint: rgba(255, 255, 255, 0.46);
	--rv-line: #272a31;
	--rv-line-strong: #3a3d45;
	--rv-card: #181a1f;
	--rv-soft: #1a1c21;
	--rv-accent-soft: rgba(101, 113, 255, 0.16);
	--rv-accent-line: rgba(122, 133, 255, 0.42);
}

body.dark .hbg-rv-pill {
	box-shadow: none;
}

/* #6571ff on the dark panel is 4.35:1 — the "Sign in" link sits just under.
   The lighter accent is the same hue one step up. */
body.dark .hbg-rv-note a {
	color: var(--rv-accent-hi);
}

body.dark .hbg-rv-message.is-error {
	border-color: rgba(255, 120, 124, 0.42);
	background: rgba(255, 120, 124, 0.1);
	color: #ff9296;
}

body.dark .hbg-rv-message.is-ok {
	color: #aeb5ff;
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 1024px) {
	.hbg-rv-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.hbg-reviews {
		padding: 44px 0 8px;
	}

	.hbg-rv-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.hbg-rv-rule {
		display: none;
	}

	.hbg-rv-head h2 {
		font-size: 27px;
	}

	.hbg-rv-submit {
		justify-self: stretch;
	}
}
