/**
 * Review Spark — popup styles.
 * Colors come from CSS custom properties set by PHP (theme palette).
 */

.rvs-root {
	--rvs-radius: 22px;
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.rvs-root[hidden] {
	display: none;
}

.rvs-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 15, 30, 0.62);
	backdrop-filter: blur(4px);
	animation: rvs-fade 0.25s ease both;
}

.rvs-modal {
	position: relative;
	width: min(640px, 100%);
	background: var(--rvs-bg, #fff);
	border-radius: var(--rvs-radius);
	box-shadow: 0 24px 70px rgba(2, 8, 23, 0.4), 0 0 0 1px var(--rvs-line, #e5e7eb);
	padding: 52px 54px 46px;
	text-align: center;
	font-family: inherit;
	color: var(--rvs-text, #1f2937);
	animation: rvs-pop 0.32s cubic-bezier(0.22, 1.2, 0.36, 1) both;
	overflow: hidden;
}

/* Top accent ribbon in theme color */
.rvs-modal::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 8px;
	background: linear-gradient(90deg, var(--rvs-primary, #4f46e5), var(--rvs-accent, #4f46e5));
}

.rvs-close {
	position: absolute;
	top: 18px;
	right: 20px;
	border: 0;
	background: transparent;
	font-size: 30px;
	line-height: 1;
	color: var(--rvs-muted, #6b7280);
	cursor: pointer;
	padding: 4px 10px;
	border-radius: 8px;
	transition: background 0.15s ease, color 0.15s ease;
}

.rvs-close:hover {
	background: rgba(0, 0, 0, 0.06);
	color: var(--rvs-text, #1f2937);
}

.rvs-head {
	margin-bottom: 20px;
	min-height: 26px;
}

.rvs-logo {
	max-height: 56px;
	max-width: 220px;
	object-fit: contain;
}

.rvs-logo--text {
	display: inline-block;
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--rvs-primary, #4f46e5);
	letter-spacing: 0.01em;
}

.rvs-title {
	font-size: 2rem;
	font-weight: 700;
	margin: 8px 0 10px;
	line-height: 1.2;
}

.rvs-sub {
	font-size: 1.125rem;
	color: var(--rvs-muted, #6b7280);
	margin: 0 0 24px;
	line-height: 1.55;
}

/* Stars */
.rvs-stars {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 16px 0 10px;
}

.rvs-star {
	border: 0;
	background: transparent;
	color: var(--rvs-line, #e5e7eb);
	cursor: pointer;
	padding: 8px;
	border-radius: 14px;
	transition: transform 0.15s cubic-bezier(0.22, 1.2, 0.36, 1), color 0.12s ease;
}

.rvs-star svg {
	display: block;
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}

.rvs-star:hover {
	transform: scale(1.18);
}

.rvs-star.is-hover,
.rvs-star.is-active {
	color: var(--rvs-star, #f59e0b);
}

.rvs-star.is-active {
	transform: scale(1.12);
}

.rvs-hint {
	font-size: 0.9rem;
	color: var(--rvs-muted, #6b7280);
	margin: 6px 0 0;
	min-height: 1em;
}

/* Eyebrow pill */
.rvs-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 12px;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--rvs-primary, #4f46e5);
	background: color-mix(in srgb, var(--rvs-primary, #4f46e5) 11%, transparent);
}

.rvs-eyebrow__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--rvs-primary, #4f46e5);
	animation: rvs-pulse 1.8s ease-in-out infinite;
}

/* Live rating label */
.rvs-rating-label {
	min-height: 1.5em;
	margin: 8px 0 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--rvs-muted, #6b7280);
	transition: color 0.15s ease;
}

.rvs-rating-label.is-set {
	color: var(--rvs-star, #f59e0b);
}

/* Trust list */
.rvs-trust {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px 22px;
	margin: 26px 0 0;
	padding: 22px 0 0;
	border-top: 1px solid var(--rvs-line, #e5e7eb);
}

.rvs-trust li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 0.9rem;
	color: var(--rvs-muted, #6b7280);
}

.rvs-trust svg {
	color: var(--rvs-primary, #4f46e5);
	flex: none;
}

/* Static stars (feedback recap) */
.rvs-stars--static {
	margin: 0 0 10px;
	gap: 4px;
}

.rvs-star--static {
	cursor: default;
	padding: 2px;
}

/* Gate step (before Google redirect) */
.rvs-spinner {
	width: 40px;
	height: 40px;
	margin: 12px auto 0;
	border-radius: 50%;
	border: 4px solid var(--rvs-line, #e5e7eb);
	border-top-color: var(--rvs-primary, #4f46e5);
	animation: rvs-spin 0.8s linear infinite;
}

/* Feedback form */
.rvs-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	text-align: left;
}

.rvs-input {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--rvs-line, #e5e7eb);
	border-radius: 12px;
	padding: 15px 18px;
	font-size: 1.0625rem;
	font-family: inherit;
	color: var(--rvs-text, #1f2937);
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rvs-input:focus {
	outline: none;
	border-color: var(--rvs-primary, #4f46e5);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rvs-primary, #4f46e5) 18%, transparent);
}

.rvs-textarea {
	resize: vertical;
	min-height: 130px;
}

.rvs-error {
	margin: 0;
	font-size: 0.95rem;
	color: #dc2626;
}

/* Field labels */
.rvs-field {
	display: block;
}

.rvs-field-label {
	display: block;
	margin: 0 0 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--rvs-text, #1f2937);
	text-align: left;
}

/* Reason chips */
.rvs-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 4px;
}

.rvs-chip {
	border: 1px solid var(--rvs-line, #e5e7eb);
	background: #fff;
	color: var(--rvs-text, #1f2937);
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 0.875rem;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.rvs-chip:hover {
	border-color: var(--rvs-primary, #4f46e5);
}

.rvs-chip.is-on {
	background: var(--rvs-primary, #4f46e5);
	border-color: var(--rvs-primary, #4f46e5);
	color: #fff;
}

/* Done-step follow-up note */
.rvs-done-note {
	margin: 6px 0 0;
	font-size: 0.9rem;
	color: var(--rvs-muted, #6b7280);
	line-height: 1.5;
}

.rvs-btn {
	border: 0;
	border-radius: 999px;
	padding: 15px 28px;
	font-size: 1.0625rem;
	font-weight: 600;
	font-family: inherit;
	color: #fff;
	background: var(--rvs-primary, #4f46e5);
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.rvs-btn:hover {
	filter: brightness(1.08);
}

.rvs-btn:active {
	transform: translateY(1px);
}

.rvs-btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* Done step */
.rvs-check {
	width: 84px;
	height: 84px;
	margin: 6px auto 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: #fff;
	background: var(--rvs-primary, #4f46e5);
	animation: rvs-pop 0.35s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

/* Shortcode button */
.rvs-open-btn {
	border: 0;
	border-radius: 999px;
	padding: 14px 28px;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	color: #fff;
	background: var(--rvs-primary, #4f46e5);
	cursor: pointer;
}

.rvs-open-btn:hover {
	filter: brightness(1.08);
}

@keyframes rvs-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes rvs-pop {
	from { opacity: 0; transform: translateY(14px) scale(0.96); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rvs-spin {
	to { transform: rotate(360deg); }
}

@keyframes rvs-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.45; transform: scale(0.7); }
}

@media (max-width: 560px) {
	.rvs-root {
		padding: 12px;
	}
	.rvs-modal {
		width: 100%;
		padding: 34px 24px 30px;
		border-radius: 16px;
	}
	.rvs-title {
		font-size: 1.55rem;
	}
	.rvs-sub {
		font-size: 1rem;
		margin-bottom: 18px;
	}
	.rvs-star svg {
		width: 34px;
		height: 34px;
	}
	.rvs-check {
		width: 68px;
		height: 68px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rvs-backdrop,
	.rvs-modal,
	.rvs-check,
	.rvs-eyebrow__dot {
		animation: none;
	}
	.rvs-star,
	.rvs-btn {
		transition: none;
	}
}
