/**
 * Review Collector — front-end styles.
 *
 * Kept deliberately restrained so it inherits the host theme's typography and
 * blends in. All key values are CSS custom properties so a theme or the site
 * owner can override them without editing the plugin.
 */

.rvc-review-widget {
	--rvc-accent: #2563eb;
	--rvc-accent-hover: #1d4ed8;
	--rvc-star: #f5a623;
	--rvc-star-empty: #d1d5db;
	--rvc-border: #d1d5db;
	--rvc-border-focus: var(--rvc-accent);
	--rvc-radius: 8px;
	--rvc-gap: 1.1rem;
	--rvc-text-muted: #6b7280;
	--rvc-error: #b91c1c;
	--rvc-success-bg: #ecfdf5;
	--rvc-success-border: #10b981;

	max-width: 640px;
	margin: 0 auto;
}

/* Intro ------------------------------------------------------------------ */
.rvc-intro {
	margin-bottom: 1.5rem;
}
.rvc-intro-heading {
	margin: 0 0 0.4rem;
	line-height: 1.25;
}
.rvc-intro-message {
	margin: 0;
	color: var(--rvc-text-muted);
}

/* Honeypot (spam trap) — visually removed but still in the DOM for bots ---- */
.rvc-hp-field {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Form layout ------------------------------------------------------------ */
.rvc-form {
	display: flex;
	flex-direction: column;
	gap: var(--rvc-gap);
}
.rvc-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.rvc-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--rvc-gap);
}
@media ( max-width: 480px ) {
	.rvc-field-row {
		grid-template-columns: 1fr;
	}
}

.rvc-field label,
.rvc-label {
	font-weight: 600;
	font-size: 0.95rem;
}
.rvc-required {
	color: var(--rvc-error);
}

.rvc-review-widget input[type="text"],
.rvc-review-widget input[type="email"],
.rvc-review-widget input[type="tel"],
.rvc-review-widget textarea {
	width: 100%;
	padding: 0.6rem 0.7rem;
	border: 1px solid var(--rvc-border);
	border-radius: var(--rvc-radius);
	font: inherit;
	color: inherit;
	background: #fff;
	box-sizing: border-box;
}
.rvc-review-widget input:focus,
.rvc-review-widget textarea:focus {
	outline: none;
	border-color: var(--rvc-border-focus);
	box-shadow: 0 0 0 3px rgba( 37, 99, 235, 0.15 );
}
.rvc-review-widget textarea {
	resize: vertical;
	min-height: 3rem;
}

/* Stars ------------------------------------------------------------------ */
.rvc-stars {
	display: inline-flex;
	gap: 0.15rem;
}
.rvc-star {
	background: none;
	border: none;
	padding: 0.1rem 0.15rem;
	margin: 0;
	cursor: pointer;
	font-size: 2rem;
	line-height: 1;
	color: var(--rvc-star-empty);
	transition: color 0.12s ease, transform 0.08s ease;
}
.rvc-star:hover {
	transform: scale( 1.08 );
}
.rvc-star.is-active {
	color: var(--rvc-star);
}
.rvc-star:focus-visible {
	outline: 2px solid var(--rvc-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Radio group ------------------------------------------------------------ */
.rvc-radio-group {
	display: flex;
	gap: 1.25rem;
}
.rvc-radio {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 400;
	cursor: pointer;
}

/* Conditional contact fields -------------------------------------------- */
.rvc-contact-fields {
	border: 1px dashed var(--rvc-border);
	border-radius: var(--rvc-radius);
	padding: 1rem;
}
.rvc-contact-hint {
	margin: 0 0 0.75rem;
	font-size: 0.9rem;
	color: var(--rvc-text-muted);
}

/* Errors ----------------------------------------------------------------- */
.rvc-form-error {
	color: var(--rvc-error);
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: var(--rvc-radius);
	padding: 0.7rem 0.9rem;
	font-size: 0.95rem;
}

/* Submit / buttons ------------------------------------------------------- */
.rvc-actions {
	margin-top: 0.25rem;
}
.rvc-submit,
.rvc-btn {
	display: inline-block;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 0.7rem 1.4rem;
	border-radius: var(--rvc-radius);
	border: 1px solid transparent;
	transition: background 0.15s ease, opacity 0.15s ease;
}
.rvc-submit,
.rvc-btn-primary {
	background: var(--rvc-accent);
	color: #fff;
}
.rvc-submit:hover,
.rvc-btn-primary:hover {
	background: var(--rvc-accent-hover);
}
.rvc-submit:disabled {
	opacity: 0.6;
	cursor: default;
}
.rvc-btn-secondary {
	background: transparent;
	color: var(--rvc-accent);
	border-color: var(--rvc-border);
}
.rvc-btn-secondary:hover {
	background: #f3f4f6;
}

/* Result / success + Google prompt -------------------------------------- */
.rvc-result:focus {
	outline: none;
}
.rvc-success {
	background: var(--rvc-success-bg);
	border: 1px solid var(--rvc-success-border);
	border-left-width: 4px;
	border-radius: var(--rvc-radius);
	padding: 1rem 1.1rem;
	font-size: 1.05rem;
}
.rvc-google-prompt {
	margin-top: 1.25rem;
	padding: 1.25rem;
	border: 1px solid var(--rvc-border);
	border-radius: var(--rvc-radius);
	background: #f9fafb;
}
.rvc-google-prompt .rvc-success {
	margin-bottom: 1rem;
}
.rvc-google-message,
.rvc-google-clipboard-note {
	margin: 0 0 1rem;
}
.rvc-google-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* Reviews display -------------------------------------------------------- */
.rvc-reviews-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: 1.1rem;
}
.rvc-reviews-list {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}
.rvc-review-card {
	border: 1px solid var(--rvc-border, #d1d5db);
	border-radius: 8px;
	padding: 1.1rem 1.2rem;
	background: #fff;
}
.rvc-review-stars {
	color: #f5a623;
	font-size: 1.2rem;
	letter-spacing: 0.05em;
	margin-bottom: 0.5rem;
}
.rvc-review-text {
	margin: 0 0 0.75rem;
	line-height: 1.55;
}
.rvc-review-author {
	margin: 0;
	font-weight: 600;
	font-size: 0.95rem;
}
.rvc-review-date {
	font-weight: 400;
	color: #6b7280;
}
.rvc-no-reviews {
	color: #6b7280;
	font-style: italic;
}

/* Reviews slider (carousel) --------------------------------------------- */
.rvc-slider {
	--rvc-star: #f5a623;
	--rvc-arrow-bg: #ffffff;
	--rvc-arrow-color: #111827;
	--rvc-arrow-border: #e5e7eb;
	position: relative;
}
.rvc-slider-title {
	margin: 0 0 1.25rem;
	text-align: center;
}
.rvc-slider-viewport {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.rvc-slider-window {
	overflow: hidden;
	flex: 1 1 auto;
}
.rvc-slider-track {
	display: flex;
	gap: 16px;
	/* Embla drives the transform; no CSS transition here. */
	will-change: transform;
}
.rvc-slider-card {
	box-sizing: border-box;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 1.25rem 1.35rem;
	background: #fff;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.04 );
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	min-width: 0; /* allow flex-basis to shrink cards evenly */
}
.rvc-slider-card .rvc-review-stars {
	color: var(--rvc-star);
	font-size: 1.15rem;
	letter-spacing: 0.05em;
	margin: 0;
}
.rvc-slider-card .rvc-review-text {
	margin: 0;
	line-height: 1.55;
	/* Keep cards even by clamping very long reviews. */
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.rvc-slider-card .rvc-review-author {
	margin: auto 0 0;
	font-weight: 600;
	font-size: 0.95rem;
}
.rvc-slider-card .rvc-review-date {
	font-weight: 400;
	color: #6b7280;
}

.rvc-slider-arrow {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--rvc-arrow-border);
	background: var(--rvc-arrow-bg);
	color: var(--rvc-arrow-color);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, opacity 0.15s ease;
}
.rvc-slider-arrow:hover {
	background: #f3f4f6;
}
.rvc-slider-arrow:disabled {
	opacity: 0.35;
	cursor: default;
}
.rvc-slider-arrow:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.rvc-slider-dots {
	display: flex;
	justify-content: center;
	gap: 0.4rem;
	margin-top: 1rem;
}
.rvc-slider-dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #d1d5db;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}
.rvc-slider-dot.is-active {
	background: #2563eb;
	transform: scale( 1.25 );
}
.rvc-slider-empty p {
	color: #6b7280;
	font-style: italic;
	text-align: center;
}

/* Pause / play button (shown only when autoplay is enabled) -------------- */
.rvc-slider-playpause {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0.75rem auto 0;
	min-height: 24px;
	padding: 0.35rem 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	background: #fff;
	color: #111827;
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}
.rvc-slider-playpause:hover {
	background: #f3f4f6;
}
.rvc-slider-playpause .rvc-pp-icon {
	width: 12px;
	height: 12px;
	display: inline-block;
	/* Default (paused): show a play triangle. */
	background: currentColor;
	clip-path: polygon( 0 0, 100% 50%, 0 100% );
}
.rvc-slider.is-playing .rvc-slider-playpause .rvc-pp-icon {
	/* Playing: show two pause bars. */
	clip-path: none;
	background:
		linear-gradient( currentColor 0 0 ) 0 / 35% 100% no-repeat,
		linear-gradient( currentColor 0 0 ) 100% / 35% 100% no-repeat;
}

/* Visible keyboard focus for all controls (WCAG 2.4.7 / 2.4.11) ---------- */
.rvc-slider-arrow:focus-visible,
.rvc-slider-dot:focus-visible,
.rvc-slider-playpause:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

@media ( prefers-reduced-motion: reduce ) {
	.rvc-slider-track {
		scroll-behavior: auto;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.rvc-slider-track {
		transition: none;
	}
}

/* Respect reduced motion ------------------------------------------------- */
@media ( prefers-reduced-motion: reduce ) {
	.rvc-star,
	.rvc-submit,
	.rvc-btn {
		transition: none;
	}
	.rvc-star:hover {
		transform: none;
	}
}
