/* Site-wide feedback dialog. Self-contained: quiz.css is not loaded on
 * most pages, so the modal and button styles are repeated here under the
 * .eval-feedback scope. Values mirror quiz.css. */

.eval-feedback {
	--eval-fb-border: #d6dce4;
	--eval-fb-bg: #f4f6f9;
	--eval-fb-fail: #b42318;
	--eval-fb-accent: #2271b1;
	--eval-fb-accent-dark: #135e96;
	--eval-fb-star: #f59e0b;
	--eval-fb-text: #1f2937;
	--eval-fb-muted: #475569;
}

/* Floating trigger ------------------------------------------------ */

.eval-feedback__fab {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 1000;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.6rem 0.95rem;
	border: 1px solid var(--eval-fb-accent);
	border-radius: 999px;
	background: var(--eval-fb-accent);
	color: #fff;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
	cursor: pointer;
}

.eval-feedback__fab:hover {
	background: var(--eval-fb-accent-dark);
	border-color: var(--eval-fb-accent-dark);
	color: #fff;
}

.eval-feedback__fab:focus-visible {
	outline: 2px solid var(--eval-fb-accent-dark);
	outline-offset: 3px;
}

.eval-feedback__fab-icon {
	flex-shrink: 0;
}

@media (max-width: 640px) {
	.eval-feedback__fab {
		right: 0.75rem;
		bottom: 0.75rem;
		padding: 0.7rem;
	}

	.eval-feedback__fab-label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
}

/* Mascot on the quiz "ready" screen sits bottom-right too; nudge our button up. */
.eval-quiz--ready ~ .eval-feedback .eval-feedback__fab,
body:has(.eval-quiz--ready) .eval-feedback__fab {
	bottom: 4.5rem;
}

/* Shop/product already have a fixed "Try a free sample" CTA in this corner.
 * Do not stack a second floating button on top of it. */
@media (min-width: 1024px) {
	body:has(.eval-shop-free-sample--inline) .eval-feedback__fab {
		display: none;
	}
}

/* Dialog ---------------------------------------------------------- */

@keyframes eval-fb-pop {
	from {
		opacity: 0;
		transform: scale(0.96) translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

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

dialog.eval-feedback__dialog.eval-modal {
	width: min(30rem, calc(100vw - 1.5rem));
	max-height: calc(100dvh - 1.5rem);
	max-width: calc(100vw - 1.5rem);
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 1.25rem;
	background: #fff;
	color: var(--eval-fb-text);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.4) inset,
		0 24px 60px rgba(15, 23, 42, 0.22);
	animation: eval-fb-pop 0.18s ease;
}

.eval-feedback__dialog::backdrop {
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(6px);
	animation: eval-fb-fade 0.18s ease;
}

dialog.eval-feedback__dialog.eval-modal.is-exit {
	width: min(480px, calc(100vw - 2.5rem));
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 0;
	background: rgba(255, 255, 255, 0.5);
	color: #111827;
	font-family: Inter, "Segoe UI", sans-serif;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

.eval-feedback__dialog.is-exit .eval-modal__panel {
	display: block;
	max-height: none;
	padding: 18px 22px 16px;
	overflow: visible;
}

.eval-feedback__dialog.is-exit .eval-feedback__body,
.eval-feedback__dialog.is-exit .eval-feedback__offer {
	min-height: 0;
	padding: 0;
	overflow: visible;
}

.eval-feedback__dialog.is-exit .eval-modal__title {
	padding-right: 24px;
	color: #111827;
	font-family: "Playfair Display", Georgia, serif;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.25;
}

.eval-feedback__dialog.is-exit .eval-modal__text {
	margin: 0 0 12px;
	color: #4b5563;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.35;
}

.eval-feedback__dialog.is-exit .eval-modal__close {
	top: 20px;
	right: 20px;
	width: auto;
	height: auto;
	padding: 4px;
	border-radius: 0;
	background: none;
	color: #4b5563;
	font-size: 20px;
	transition: color 0.2s ease, transform 0.2s ease;
}

.eval-feedback__dialog.is-exit .eval-modal__close:hover {
	background: none;
	color: #111827;
	transform: scale(1.1);
}

.eval-feedback__dialog.is-exit .eval-modal__actions {
	padding: 0;
	border-top: 0;
	background: transparent;
}

.eval-feedback__dialog .eval-modal__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	max-height: calc(100dvh - 1.5rem);
	padding: 0;
	margin: 0;
	overflow: hidden;
}

.eval-feedback__body,
.eval-feedback__offer {
	min-height: 0;
	padding: 1.05rem 1.15rem 0.35rem;
	overflow: auto;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 transparent;
}

.eval-feedback__body::-webkit-scrollbar,
.eval-feedback__offer::-webkit-scrollbar {
	width: 8px;
}

.eval-feedback__body::-webkit-scrollbar-thumb,
.eval-feedback__offer::-webkit-scrollbar-thumb {
	border-radius: 999px;
	background: #cbd5e1;
}

.eval-feedback__dialog .eval-modal__title {
	margin: 0;
	padding-right: 2.25rem;
	font-size: 1.2rem;
	line-height: 1.25;
	letter-spacing: -0.025em;
}

.eval-feedback__dialog .eval-modal__text {
	margin: 0.3rem 0 0.75rem;
	color: var(--eval-fb-muted);
	font-size: 0.9rem;
	line-height: 1.4;
}

.eval-feedback__dialog .eval-modal__close {
	position: absolute;
	z-index: 2;
	top: 0.7rem;
	right: 0.7rem;
	display: grid;
	place-items: center;
	width: 1.85rem;
	height: 1.85rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #f1f5f9;
	color: #475569;
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
}

.eval-feedback__dialog .eval-modal__close:hover {
	background: #e2e8f0;
	color: #0f172a;
}

.eval-feedback__dialog .eval-modal__actions {
	display: flex;
	flex-shrink: 0;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.5rem;
	margin: 0;
	padding: 0.7rem 1.15rem;
	border-top: 1px solid #eef2f6;
	background: #fbfcfd;
}

.eval-feedback__dialog p {
	margin: 0 0 0.6rem;
}

.eval-feedback__dialog label {
	display: block;
	font-size: 0.92rem;
	font-weight: 600;
}

.eval-feedback__optional {
	font-weight: 400;
	color: var(--eval-fb-muted);
}

.eval-feedback__dialog textarea,
.eval-feedback__dialog input[type="email"] {
	box-sizing: border-box;
	width: 100%;
	margin-top: 0.28rem;
	padding: 0.5rem 0.7rem;
	border: 1px solid #e2e8f0;
	border-radius: 0.7rem;
	font: inherit;
	font-size: 0.95rem;
	color: var(--eval-fb-text);
	background: #f8fafc;
	transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.eval-feedback__dialog textarea {
	height: 3.6rem;
	min-height: 0;
	resize: none;
}

.eval-feedback__dialog textarea:focus,
.eval-feedback__dialog input[type="email"]:focus {
	outline: none;
	border-color: #93c5e4;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.16);
}

/* Exit offer ------------------------------------------------------- */

.eval-feedback__promo,
.eval-feedback__dialog.is-exit .eval-feedback__code {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 56px;
	margin: 0 0 14px;
	padding: 0 16px 0 64px;
	overflow: hidden;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(135deg, #ff6b6b 0%, #ffb84c 100%);
	box-shadow: 0 4px 15px rgba(255, 107, 107, 0.25);
	color: #fff;
	-webkit-mask-image:
		radial-gradient(circle 5px at 0% 10px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 0% 22px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 0% 34px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 0% 46px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 100% 10px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 100% 22px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 100% 34px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 100% 46px, transparent 99%, #000 100%);
	-webkit-mask-composite: destination-in;
	mask-image:
		radial-gradient(circle 5px at 0% 10px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 0% 22px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 0% 34px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 0% 46px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 100% 10px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 100% 22px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 100% 34px, transparent 99%, #000 100%),
		radial-gradient(circle 5px at 100% 46px, transparent 99%, #000 100%);
	mask-composite: intersect;
}

.eval-feedback__promo[hidden] {
	display: none;
}

.eval-feedback__promo::before,
.eval-feedback__dialog.is-exit .eval-feedback__code::before {
	content: "";
	position: absolute;
	top: 6px;
	bottom: 6px;
	left: 54px;
	border-left: 2px dashed rgba(255, 255, 255, 0.6);
}

.eval-feedback__promo-side {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 1px;
	line-height: 1;
	text-transform: uppercase;
	transform: rotate(180deg);
	writing-mode: vertical-rl;
}

.eval-feedback__promo-text {
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.5px;
	line-height: 1.2;
	text-align: center;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.eval-feedback__reasons {
	display: none;
	margin: 0 0 14px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.eval-feedback__form.is-exit .eval-feedback__reasons {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.eval-feedback__form.is-exit .eval-feedback__rating,
.eval-feedback__form.is-exit .eval-feedback__comment,
.eval-feedback__form.is-exit .eval-feedback__email {
	display: none;
}

.eval-feedback__reasons legend {
	margin: 0 0 8px;
	padding: 0;
	color: #111827;
	font-size: 16px;
	font-weight: 600;
}

.eval-feedback__dialog.is-exit .eval-feedback__reason {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.6);
	color: #111827;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
	user-select: none;
}

.eval-feedback__dialog.is-exit .eval-feedback__reason:hover {
	border-color: #cbd5e1;
	background: rgba(255, 255, 255, 0.85);
}

.eval-feedback__dialog.is-exit .eval-feedback__reason:has(input:checked) {
	border: 1.5px solid #3ebdf0;
	background: #fff;
	box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.eval-feedback__dialog.is-exit .eval-feedback__reason input {
	appearance: none;
	box-sizing: border-box;
	width: 20px;
	height: 20px;
	margin: 0 14px 0 0;
	flex-shrink: 0;
	border: 2px solid #94a3b8;
	border-radius: 50%;
	background: transparent;
	accent-color: #3ebdf0;
}

.eval-feedback__dialog.is-exit .eval-feedback__reason:has(input:checked) input {
	border-color: #3ebdf0;
	background: radial-gradient(circle, #3ebdf0 0 5px, transparent 5.5px);
}

.eval-feedback__form.is-exit .eval-modal__actions {
	flex-direction: column-reverse;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 0;
}

.eval-feedback__form.is-exit .eval-feedback__btn--primary {
	width: 100%;
	min-height: 48px;
	border: 0;
	border-radius: 14px;
	background: linear-gradient(135deg, #075985, #3ebdf0);
	box-shadow: 0 4px 14px rgba(7, 89, 133, 0.25);
	color: #fff !important;
	font-size: 18px;
	font-weight: 700;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.eval-feedback__form.is-exit .eval-feedback__btn--primary:hover {
	background: linear-gradient(135deg, #0c4a6e, #0284c7);
	box-shadow: 0 6px 20px rgba(7, 89, 133, 0.35);
	transform: translateY(-2px);
}

.eval-feedback__form.is-exit .eval-feedback__btn--ghost {
	margin-top: 10px;
	border-color: transparent;
	background: transparent;
	box-shadow: none;
	color: #4b5563 !important;
	font-size: 15px;
	font-weight: 500;
	text-align: center;
	text-decoration: none;
}

.eval-feedback__form.is-exit .eval-feedback__btn--ghost:hover {
	color: #111827 !important;
	text-decoration: underline;
}

/* Star rating ------------------------------------------------------ */

.eval-feedback__rating {
	margin: 0 0 0.7rem;
	padding: 0;
	border: 0;
	min-width: 0;
}

.eval-feedback__rating legend {
	padding: 0;
	margin: 0 0 0.35rem;
	font-weight: 600;
}

.eval-feedback__stars {
	display: inline-flex;
	gap: 0.05rem;
	padding: 0.1rem 0.25rem;
	border: 1px solid #e8edf3;
	border-radius: 999px;
	background: #f8fafc;
}

.eval-feedback__star {
	position: relative;
	display: inline-block;
	margin: 0;
	cursor: pointer;
	font-weight: 400;
}

.eval-feedback__star input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	opacity: 0;
	pointer-events: none;
}

/* Theme-independent visually-hidden text (do not rely on .screen-reader-text). */
.eval-feedback__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.eval-feedback__star-icon {
	display: block;
	padding: 0.1rem 0.15rem;
	font-size: 1.7rem;
	line-height: 1;
	color: #cbd5e1;
	transition: color 0.12s ease, transform 0.12s ease;
}

.eval-feedback__star.is-on .eval-feedback__star-icon,
.eval-feedback__star.is-hover .eval-feedback__star-icon {
	color: var(--eval-fb-star);
}

.eval-feedback__star:hover .eval-feedback__star-icon {
	transform: scale(1.1);
}

.eval-feedback__star input:focus-visible + .eval-feedback__star-icon {
	border-radius: 0.4rem;
	outline: 2px solid var(--eval-fb-accent);
	outline-offset: 1px;
}

/* Buttons (self-contained copies of .eval-quiz__btn variants) ------ */

.eval-feedback__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.4rem;
	padding: 0.45rem 1rem;
	border: 1px solid transparent;
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.eval-feedback__btn--primary {
	background: linear-gradient(135deg, #2271b1, #135e96);
	border-color: #135e96;
	color: #fff !important;
	box-shadow: 0 6px 16px rgba(34, 113, 177, 0.2);
}

.eval-feedback__btn--primary:hover {
	background: var(--eval-fb-accent-dark);
	border-color: var(--eval-fb-accent-dark);
}

.eval-feedback__btn--ghost {
	background: #fff;
	border-color: #64748b;
	color: #334155 !important;
}

.eval-feedback__btn--ghost:hover {
	background: var(--eval-fb-bg);
}

.eval-feedback__btn:focus-visible {
	outline: 2px solid var(--eval-fb-accent-dark);
	outline-offset: 2px;
}

.eval-feedback__btn:disabled {
	opacity: 0.6;
	cursor: default;
}

@media (max-width: 640px) {
	.eval-feedback__body,
	.eval-feedback__offer {
		padding: 0.95rem 0.95rem 0.3rem;
	}

	.eval-feedback__dialog .eval-modal__actions {
		flex-direction: column;
		align-items: stretch;
		padding: 0.65rem 0.95rem;
	}

	.eval-feedback__dialog.is-exit .eval-modal__panel {
		padding: 16px 18px 14px;
	}

	.eval-feedback__dialog.is-exit .eval-feedback__body,
	.eval-feedback__dialog.is-exit .eval-feedback__offer,
	.eval-feedback__dialog.is-exit .eval-modal__actions {
		padding: 0;
	}

	.eval-feedback__dialog.is-exit .eval-modal__title {
		font-size: 22px;
	}

	.eval-feedback__promo-text {
		font-size: 16px;
	}
}

/* Error, honeypot, toast ------------------------------------------- */

.eval-feedback__error {
	color: var(--eval-fb-fail);
}

.eval-feedback__hp {
	position: absolute !important;
	left: -9999px !important;
}

.eval-feedback__toast {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 100001;
	max-width: 24rem;
	margin: 0;
	padding: 0.8rem 1rem;
	border-radius: 0;
	background: #1f2937;
	color: #fff;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}

/* Inline trigger on the results page --------------------------------- */

.eval-feedback-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin: 1rem 0 0;
	padding: 0.9rem 1.1rem;
	border: 1px dashed #94a3b8;
	background: #f8fafc;
	color: #334155;
}

.eval-feedback-inline p {
	margin: 0;
	flex: 1 1 16rem;
}

.eval-feedback-inline__btn {
	padding: 0;
	border: 0;
	background: transparent;
	color: #2271b1;
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
}

.eval-feedback-inline__btn:hover,
.eval-feedback-inline__btn:focus-visible {
	color: #135e96;
}

.eval-feedback-inline[hidden] {
	display: none;
}

/* Exit-feedback discount code -------------------------------------- */

.eval-feedback__form.is-offer > :not(.eval-modal__close):not([data-eval-feedback-offer]) {
	display: none;
}

.eval-feedback__offer {
	display: flex;
	flex-direction: column;
	padding: 1.05rem 0 0;
	overflow: auto;
}

.eval-feedback__offer[hidden] {
	display: none;
}

.eval-feedback__offer > :not(.eval-modal__actions) {
	margin-left: 1.15rem;
	margin-right: 1.15rem;
}

.eval-feedback__code {
	margin: 0.75rem 0;
	padding: 0.85rem 1rem;
	border: 1px dashed #93c5e4;
	border-radius: 0.75rem;
	font-family: ui-monospace, Consolas, monospace;
	font-size: 1.2rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-align: center;
	background: #f8fafc;
}

.eval-feedback__dialog.is-exit .eval-feedback__offer > :not(.eval-modal__actions) {
	margin-left: 0;
	margin-right: 0;
}

.eval-feedback__dialog.is-exit .eval-feedback__code {
	font-family: inherit;
}

.eval-feedback__code:focus {
	outline: 2px solid var(--eval-fb-accent);
	outline-offset: 2px;
}

.eval-feedback__offer-note {
	color: var(--eval-fb-muted);
	font-size: 0.92rem;
}

.eval-feedback__offer .eval-modal__actions .eval-feedback__btn--primary {
	text-align: center;
}
