/* Case Reviews — front end. Variables: --crv-accent, --crv-star, --crv-radius (plugin settings, Pro); themes may override. */
.crv {
	--crv-accent: #1a7fae;
	--crv-star: #f5a524;
	--crv-radius: 18px;
	--crv-text: #1c2833;
	--crv-muted: #5d6b78;
	--crv-border: #e4e9ee;
	--crv-bg: #ffffff;
	--crv-soft: color-mix(in srgb, var(--crv-accent) 9%, #ffffff);
	--crv-shadow: 0 12px 32px rgba(16, 40, 60, .08);
	color: var(--crv-text);
	font-family: inherit;
	line-height: 1.6;
}

.crv *,
.crv *::before,
.crv *::after {
	box-sizing: border-box;
}

.crv [hidden] {
	display: none !important;
}

.crv-sr,
.crv-hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Several blocks on one page. */
.crv:not(.crv-root) + .crv:not(.crv-root) {
	margin-top: 56px;
}

/* ---------- Stars ---------- */
.crv-stars {
	position: relative;
	display: inline-flex;
	vertical-align: middle;
	line-height: 0;
}

.crv-stars svg {
	width: var(--crv-size, 18px);
	height: var(--crv-size, 18px);
	margin-right: 2px;
}

.crv-stars__bg svg {
	fill: #dfe4e9;
}

.crv-stars__fg {
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--crv-fill, 100%);
	overflow: hidden;
	white-space: nowrap;
}

.crv-stars__fg svg {
	fill: var(--crv-star);
}

/* ---------- Buttons ---------- */
.crv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 12px 24px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	color: #ffffff;
	text-decoration: none;
	background: var(--crv-accent);
	border: 2px solid var(--crv-accent);
	border-radius: 999px;
	cursor: pointer;
	transition: filter .2s, transform .2s, background-color .2s, color .2s;
}

.crv-btn:hover {
	color: #ffffff;
	filter: brightness(1.07);
	transform: translateY(-1px);
}

.crv-btn--ghost {
	color: var(--crv-accent);
	background: transparent;
}

.crv-btn--ghost:hover {
	color: #ffffff;
	background: var(--crv-accent);
}

.crv-btn--block {
	width: 100%;
}

.crv-btn:disabled {
	opacity: .7;
	cursor: default;
	transform: none;
}

/* ---------- Summary ---------- */
.crv-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 24px 40px;
	margin-bottom: 28px;
	padding: 26px 30px;
	background: var(--crv-bg);
	border: 1px solid var(--crv-border);
	border-radius: var(--crv-radius);
}

.crv-summary__score {
	display: grid;
	grid-template-columns: auto auto;
	align-items: center;
	gap: 2px 14px;
}

.crv-summary__score strong {
	grid-row: span 2;
	font-size: 52px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.02em;
}

.crv-summary__score span:last-child {
	font-size: 14px;
	color: var(--crv-muted);
}

.crv-summary__bars {
	flex: 1;
	min-width: 220px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.crv-summary__bars li {
	margin: 0;
}

.crv-summary__bars button {
	display: grid;
	grid-template-columns: 34px 1fr 36px;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 2px 4px;
	font: inherit;
	font-size: 13px;
	color: var(--crv-muted);
	text-align: left;
	background: none;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}

.crv-summary__bars button:hover,
.crv-summary__bars button.is-active {
	color: var(--crv-text);
	background: var(--crv-soft);
}

.crv-summary__bars i {
	height: 8px;
	overflow: hidden;
	background: #edf0f3;
	border-radius: 999px;
}

.crv-summary__bars b {
	display: block;
	height: 100%;
	background: var(--crv-star);
	border-radius: 999px;
}

.crv-summary__bars em {
	font-style: normal;
	text-align: right;
}

.crv-summary--compact {
	display: inline-flex;
	gap: 16px;
	margin: 0;
	padding: 14px 18px;
}

.crv-summary--compact .crv-summary__score strong {
	font-size: 34px;
}

.crv-summary--compact .crv-btn {
	min-height: 40px;
	padding: 8px 18px;
	font-size: 14px;
}

/* ---------- Filter ---------- */
.crv-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 22px;
}

.crv-filter button {
	padding: 8px 16px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--crv-text);
	background: var(--crv-bg);
	border: 1px solid var(--crv-border);
	border-radius: 999px;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s;
}

.crv-filter button small {
	margin-left: 4px;
	color: var(--crv-muted);
}

.crv-filter button:hover {
	border-color: var(--crv-accent);
}

.crv-filter button.is-active {
	color: #ffffff;
	background: var(--crv-accent);
	border-color: var(--crv-accent);
}

.crv-filter button.is-active small {
	color: rgba(255, 255, 255, .8);
}

/* ---------- Card ---------- */
.crv-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 24px;
	background: var(--crv-bg);
	border: 1px solid var(--crv-border);
	border-radius: var(--crv-radius);
	transition: box-shadow .25s, border-color .25s;
}

.crv-card:hover {
	border-color: color-mix(in srgb, var(--crv-accent) 25%, var(--crv-border));
	box-shadow: var(--crv-shadow);
}

.crv-card__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.crv-avatar {
	display: grid;
	flex: none;
	place-items: center;
	width: 46px;
	height: 46px;
	overflow: hidden;
	font-size: 16px;
	font-weight: 800;
	color: hsl(var(--crv-hue, 200) 55% 32%);
	background: hsl(var(--crv-hue, 200) 70% 92%);
	border-radius: 50%;
}

.crv-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.crv-card__who {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 8px;
	min-width: 0;
	flex: 1;
}

.crv-card__name {
	font-weight: 700;
	line-height: 1.3;
}

.crv-verified {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 12px;
	font-weight: 600;
	color: #16a34a;
}

.crv-verified svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 3;
}

.crv-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0 10px;
	line-height: 1.5;
	width: 100%;
	font-size: 13px;
	color: var(--crv-muted);
}

.crv-card__meta > * + *::before {
	content: "·";
	margin-right: 10px;
}

.crv-source {
	display: grid;
	flex: none;
	place-items: center;
	width: 26px;
	height: 26px;
}

.crv-source svg {
	width: 20px;
	height: 20px;
}

.crv-card__text p {
	margin: 0;
	font-size: 15.5px;
	line-height: 1.65;
}

.crv-more-link {
	margin-top: 6px;
	padding: 0;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--crv-accent);
	background: none;
	border: 0;
	cursor: pointer;
}

.crv-reply {
	margin-top: 4px;
	padding: 14px 16px;
	font-size: 14px;
	background: var(--crv-soft);
	border-left: 3px solid var(--crv-accent);
	border-radius: 0 12px 12px 0;
}

.crv-reply strong {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
}

.crv-reply p {
	margin: 0;
	color: var(--crv-muted);
}

/* ---------- Layouts ---------- */
.crv-list--grid {
	display: grid;
	grid-template-columns: repeat(var(--crv-cols, 3), minmax(0, 1fr));
	gap: 20px;
}

.crv-list--list {
	display: grid;
	gap: 16px;
	max-width: 880px;
}

.crv-list--list .crv-card {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 8px 28px;
}

.crv-list--list .crv-card__head {
	grid-row: span 3;
	align-items: flex-start;
	flex-direction: column;
}

.crv-list--masonry {
	column-count: var(--crv-cols, 3);
	column-gap: 20px;
}

.crv-list--masonry .crv-card {
	break-inside: avoid;
	margin-bottom: 20px;
}

.crv-list--slider {
	display: grid;
	grid-auto-columns: calc((100% - (var(--crv-cols, 3) - 1) * 20px) / var(--crv-cols, 3));
	grid-auto-flow: column;
	gap: 20px;
	overflow-x: auto;
	padding: 4px 2px 8px;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.crv-list--slider::-webkit-scrollbar {
	display: none;
}

.crv-list--slider .crv-card {
	scroll-snap-align: start;
}

.crv-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 18px;
}

.crv-nav__btn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--crv-text);
	background: var(--crv-bg);
	border: 1px solid var(--crv-border);
	border-radius: 50%;
	cursor: pointer;
	transition: background-color .2s, color .2s, border-color .2s;
}

.crv-nav__btn svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.crv-nav__btn:hover:not(:disabled) {
	color: #ffffff;
	background: var(--crv-accent);
	border-color: var(--crv-accent);
}

.crv-nav__btn:disabled {
	opacity: .4;
	cursor: default;
}

.crv-dots {
	display: flex;
	gap: 6px;
}

.crv-dots button {
	width: 8px;
	height: 8px;
	padding: 0;
	background: #d3dae1;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: width .25s, background-color .25s;
}

.crv-dots button.is-active {
	width: 22px;
	background: var(--crv-accent);
}

.crv-more {
	margin-top: 24px;
	text-align: center;
}

.crv-empty {
	padding: 32px;
	text-align: center;
	background: var(--crv-soft);
	border-radius: var(--crv-radius);
}

.crv-empty p {
	margin: 0 0 16px;
	color: var(--crv-muted);
}

.crv-list.is-loading {
	opacity: .5;
	pointer-events: none;
	transition: opacity .2s;
}

/* ---------- Form ---------- */
.crv-form {
	margin: 0;
}

.crv--form-inline .crv-form {
	max-width: 620px;
	padding: 28px;
	background: var(--crv-bg);
	border: 1px solid var(--crv-border);
	border-radius: var(--crv-radius);
}

.crv-form__title {
	margin: 0 0 14px;
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
}

.crv-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 14px;
}

.crv-rate {
	margin: 0 0 14px;
	padding: 0;
	border: 0;
}

.crv-rate legend {
	margin-bottom: 4px;
	padding: 0;
	font-size: 13px;
	font-weight: 700;
}

.crv-rate__stars {
	display: inline-flex;
	flex-direction: row-reverse;
	gap: 4px;
}

.crv-rate__stars input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.crv-rate__stars label {
	cursor: pointer;
	line-height: 0;
}

.crv-rate__stars svg {
	width: 36px;
	height: 36px;
	fill: #dfe4e9;
	transition: fill .15s, transform .15s;
}

/* Selected rating (row-reverse: the checked star and all before it visually). */
.crv-rate__stars input:checked ~ label svg {
	fill: var(--crv-star);
}

/* While hovering, preview the hovered rating instead. */
.crv-rate__stars:hover input ~ label svg {
	fill: #dfe4e9;
}

.crv-rate__stars:hover label:hover svg,
.crv-rate__stars:hover label:hover ~ label svg {
	fill: var(--crv-star);
}

.crv-rate__stars label:hover svg {
	transform: scale(1.12);
}

.crv-rate__stars input:focus-visible + label svg {
	outline: 2px solid var(--crv-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

.crv-field {
	display: block;
	margin-bottom: 14px;
}

.crv-field > span {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 700;
}

.crv-field small {
	font-weight: 500;
	color: var(--crv-muted);
}

.crv-field input,
.crv-field select,
.crv-field textarea {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 11px 14px;
	font: inherit;
	font-size: 16px;
	color: var(--crv-text);
	background: #f4f7f9;
	border: 1.5px solid transparent;
	border-radius: 12px;
	transition: border-color .2s, background-color .2s, box-shadow .2s;
}

.crv-field textarea {
	min-height: 120px;
	resize: vertical;
}

.crv-field :is(input, select, textarea):focus {
	background: var(--crv-bg);
	border-color: var(--crv-accent);
	outline: none;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--crv-accent) 14%, transparent);
}

.crv-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 14px;
	font-size: 13px;
	color: var(--crv-muted);
}

.crv-consent input {
	margin-top: 2px;
	accent-color: var(--crv-accent);
}

.crv-consent a {
	color: var(--crv-accent);
}

.crv-form__error {
	margin: 0 0 12px;
	padding: 10px 14px;
	font-size: 14px;
	color: #b42318;
	background: #fef1f0;
	border-radius: 10px;
}

.crv-form__done {
	padding: 20px 0 6px;
	text-align: center;
}

.crv-form__done:focus {
	outline: none;
}

.crv-form__check {
	display: grid;
	place-items: center;
	width: 68px;
	height: 68px;
	margin: 0 auto 14px;
	background: var(--crv-accent);
	border-radius: 50%;
}

.crv-form__check svg {
	width: 34px;
	height: 34px;
	fill: none;
	stroke: #ffffff;
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.crv-form__done p:last-child {
	margin: 0;
	color: var(--crv-muted);
}

/* ---------- Popup ---------- */
.crv-modal-open {
	overflow: hidden;
}

.crv-modal {
	position: fixed;
	inset: 0;
	z-index: 100003;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.crv-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 20, 30, .5);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .25s;
}

.crv-modal__card {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100dvh - 40px);
	overflow-y: auto;
	padding: 30px;
	background: var(--crv-bg);
	border-radius: var(--crv-radius);
	box-shadow: 0 30px 80px rgba(10, 20, 30, .3);
	opacity: 0;
	transform: translateY(16px) scale(.98);
	transition: opacity .25s, transform .3s cubic-bezier(.2, .8, .3, 1);
}

.crv-modal.is-open .crv-modal__backdrop,
.crv-modal.is-open .crv-modal__card {
	opacity: 1;
	transform: none;
}

.crv-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	color: var(--crv-muted);
	background: #f1f4f6;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.crv-modal__close svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
}

/* ---------- Floating badge (Pro) ---------- */
.crv-badge {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 99980;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 16px 8px 8px;
	font: inherit;
	color: var(--crv-text);
	text-decoration: none;
	background: var(--crv-bg);
	border: 1px solid var(--crv-border);
	border-radius: 999px;
	box-shadow: 0 10px 30px rgba(10, 20, 30, .15);
	cursor: pointer;
	transition: transform .2s;
}

.crv-badge--right {
	right: 20px;
	left: auto;
}

.crv-badge:hover {
	color: var(--crv-text);
	transform: translateY(-2px);
}

.crv-badge__score {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	font-size: 16px;
	font-weight: 800;
	color: #ffffff;
	background: var(--crv-accent);
	border-radius: 50%;
}

.crv-badge__body {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.crv-badge__body small {
	margin-top: 2px;
	font-size: 12px;
	color: var(--crv-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.crv-list--grid,
	.crv-list--masonry {
		--crv-cols: 2 !important;
	}

	.crv-list--slider {
		--crv-cols: 2 !important;
	}
}

@media (max-width: 680px) {
	.crv-list--grid {
		grid-template-columns: 1fr;
	}

	.crv-list--masonry {
		column-count: 1;
	}

	.crv-list--slider {
		grid-auto-columns: 86%;
	}

	.crv-list--list .crv-card {
		grid-template-columns: 1fr;
	}

	.crv-list--list .crv-card__head {
		flex-direction: row;
		align-items: center;
	}

	.crv-summary {
		padding: 20px;
	}

	.crv-summary__score strong {
		font-size: 44px;
	}

	.crv-summary .crv-btn {
		width: 100%;
	}

	.crv-form__row {
		grid-template-columns: 1fr;
	}

	.crv-modal {
		align-items: flex-end;
		padding: 0;
	}

	.crv-modal__card {
		max-width: none;
		max-height: 94dvh;
		padding: 26px 20px calc(20px + env(safe-area-inset-bottom));
		border-radius: var(--crv-radius) var(--crv-radius) 0 0;
	}

	.crv-badge {
		bottom: 12px;
		left: 12px;
		padding: 6px 12px 6px 6px;
	}

	.crv-badge--right {
		right: 12px;
		left: auto;
	}
}

/* Keep clear of the Case Callback floating button. */
body:has(.ccb-root--right .ccb-fab) .crv-badge--right,
body:has(.ccb-root--left .ccb-fab) .crv-badge--left {
	bottom: 100px;
}
