/**
 * Upbeat Survey Gate
 *
 * z-index note: the overlay sits at 9000. Google's web interstitial container
 * uses a near-maximum z-index, so it paints above this and its close control
 * stays reachable. Do not raise these values.
 */

.upbeat-survey {
	position: fixed;
	inset: 0;
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.upbeat-survey[hidden] { display: none; }

.upbeat-survey__scrim {
	position: fixed;
	inset: 0;
	background: rgba(9, 16, 22, .55);
	z-index: 0;
}

.upbeat-survey__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 440px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 48px rgba(9, 16, 22, .26), 0 2px 8px rgba(9, 16, 22, .12);
	padding: 26px 24px 20px;
	/* Safe areas for iOS notch / home indicator. */
	margin: max(16px, env(safe-area-inset-top)) 0 max(16px, env(safe-area-inset-bottom));
	animation: upbeat-rise .28s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes upbeat-rise {
	from { opacity: 0; transform: translateY(14px) scale(.985); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.upbeat-survey__dialog { animation: none; }
}

/* Progress -------------------------------------------------------------- */
.upbeat-survey__progress {
	height: 4px;
	background: #e8edf1;
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 18px;
}
.upbeat-survey__bar {
	display: block;
	height: 100%;
	width: 0;
	background: #0a4ea8;
	border-radius: 999px;
	transition: width .32s cubic-bezier(.3, .8, .3, 1);
}

.upbeat-survey__step {
	margin: 0 0 6px;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #6b7c87;
}

/* Copy ------------------------------------------------------------------ */
.upbeat-survey__title {
	margin: 0 0 8px;
	font-size: 1.32rem;
	line-height: 1.25;
	letter-spacing: -.02em;
	color: #10171d;
	font-weight: 750;
}

.upbeat-survey__intro,
.upbeat-survey__question {
	margin: 0 0 16px;
	color: #3d4d5a;
	font-size: .96rem;
	line-height: 1.5;
}

.upbeat-survey__question {
	font-weight: 650;
	color: #10171d;
	font-size: 1.04rem;
}

/* Panel transitions ----------------------------------------------------- */
.upbeat-survey__panel { position: relative; }

.upbeat-survey__view {
	animation: upbeat-fade .26s ease both;
}
.upbeat-survey__view.is-leaving {
	animation: upbeat-fade-out .16s ease both;
}

@keyframes upbeat-fade {
	from { opacity: 0; transform: translateX(10px); }
	to   { opacity: 1; transform: none; }
}
@keyframes upbeat-fade-out {
	from { opacity: 1; }
	to   { opacity: 0; transform: translateX(-8px); }
}
@media (prefers-reduced-motion: reduce) {
	.upbeat-survey__view,
	.upbeat-survey__view.is-leaving { animation: none; }
}

/* Answers --------------------------------------------------------------- */
.upbeat-survey__answers {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.upbeat-survey__answer {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	/* 52px min target: comfortable on mobile. */
	min-height: 52px;
	padding: 14px 16px;
	background: #fff;
	border: 1.5px solid #dde4e9;
	border-radius: 11px;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	color: #10171d;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, transform .1s ease;
}

.upbeat-survey__answer:hover {
	border-color: #0a4ea8;
	background: #f6f9fe;
}
.upbeat-survey__answer:active { transform: scale(.985); }
.upbeat-survey__answer:focus-visible {
	outline: 3px solid #0a4ea8;
	outline-offset: 2px;
}
.upbeat-survey__answer.is-chosen {
	border-color: #0a4ea8;
	background: #eaf1fb;
}

.upbeat-survey__answer::after {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	border: 1.5px solid #c6d1da;
	border-radius: 50%;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.upbeat-survey__answer.is-chosen::after {
	border-color: #0a4ea8;
	box-shadow: inset 0 0 0 4px #0a4ea8;
}

/* Back link ------------------------------------------------------------- */
.upbeat-survey__back {
	appearance: none;
	background: none;
	border: 0;
	margin: 14px 0 0;
	padding: 6px 2px;
	font: inherit;
	font-size: .88rem;
	font-weight: 600;
	color: #6b7c87;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.upbeat-survey__back:hover { color: #0a4ea8; }

/* Final CTA ------------------------------------------------------------- */
.upbeat-survey__done-icon {
	width: 46px;
	height: 46px;
	margin: 0 0 14px;
	border-radius: 50%;
	background: #e6f6ed;
	display: grid;
	place-items: center;
	color: #11794a;
	font-size: 1.35rem;
	font-weight: 700;
}

/*
 * The CTA is a plain anchor with a real same-origin HTTPS href. It must stay
 * an anchor: GPT only treats genuine anchor navigation as an eligible
 * interstitial trigger. No preventDefault, no target="_blank", and no
 * data-google-interstitial="false" anywhere in its ancestry.
 */
.upbeat-survey__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 54px;
	margin-top: 4px;
	padding: 15px 20px;
	background: #0a4ea8;
	color: #fff;
	border-radius: 11px;
	font-size: 1.04rem;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: background .15s ease, transform .1s ease;
}
.upbeat-survey__cta:hover { background: #083b7f; color: #fff; }
.upbeat-survey__cta:active { transform: scale(.99); }
.upbeat-survey__cta:focus-visible {
	outline: 3px solid #10171d;
	outline-offset: 3px;
}

.upbeat-survey__fineprint {
	margin: 16px 0 0;
	font-size: .76rem;
	line-height: 1.45;
	color: #8697a2;
	text-align: center;
}

/* Mobile ---------------------------------------------------------------- */
@media (max-width: 560px) {
	.upbeat-survey { padding: 12px; align-items: flex-end; }
	.upbeat-survey__dialog {
		max-width: none;
		border-radius: 18px;
		padding: 22px 18px 16px;
	}
	.upbeat-survey__title { font-size: 1.22rem; }
	.upbeat-survey__answer { font-size: .98rem; min-height: 54px; }
}

/* Very short viewports: let the dialog scroll rather than clip. */
@media (max-height: 520px) {
	.upbeat-survey { align-items: flex-start; }
	.upbeat-survey__dialog { margin-top: 12px; }
}
