/* PopupRoulette Pro — design overrides, placement and animations */

/* ===== Colours: each rule only applies when that colour was set ===== */
.popr-card.popr-pro {
	border-radius: var(--popr-radius, 18px);
}
.popr-card.popr-has-bg {
	background: var(--popr-card-bg);
}
.popr-card.popr-has-bg .popr-shade {
	display: none;
}
.popr-card.popr-has-bg.popr-tpl-banner .popr-shade {
	display: block;
	background: linear-gradient(180deg, transparent 40%, var(--popr-card-bg) 100%);
}
.popr-card.popr-has-title .popr-title,
#poststuff .popr-preview .popr-card.popr-has-title h2.popr-title {
	color: var(--popr-title-color);
}
.popr-card.popr-has-text .popr-content,
.popr-card.popr-has-text .popr-subtitle {
	color: var(--popr-text-color);
}
.popr-card.popr-has-highlight .popr-highlight {
	color: var(--popr-highlight-color);
}
.popr-card.popr-has-btn-bg .popr-btn {
	background: var(--popr-btn-bg);
	border-color: var(--popr-btn-bg);
	color: var(--popr-btn-color, #131a2c);
}
.popr-card.popr-has-btn-text .popr-btn,
.popr-card.popr-has-btn-text .popr-btn:hover {
	color: var(--popr-btn-color);
}

/* ===== Height and vertical position of the text ===== */
.popr-card.popr-has-height {
	min-height: var(--popr-min-height);
}
.popr-card.popr-has-height.popr-tpl-spotlight,
.popr-card.popr-has-height.popr-tpl-clean {
	display: flex;
	align-items: center;
	justify-content: center;
}
.popr-card.popr-has-height.popr-tpl-clean .popr-content,
.popr-card.popr-has-height.popr-tpl-spotlight .popr-content {
	width: 100%;
}
.popr-card.popr-valign-top.popr-tpl-spotlight,
.popr-card.popr-valign-top.popr-tpl-clean {
	align-items: flex-start;
}
.popr-card.popr-valign-bottom.popr-tpl-spotlight,
.popr-card.popr-valign-bottom.popr-tpl-clean {
	align-items: flex-end;
}
.popr-card.popr-valign-top.popr-tpl-split .popr-content {
	justify-content: flex-start;
}
.popr-card.popr-valign-bottom.popr-tpl-split .popr-content {
	justify-content: flex-end;
}

/* ===== Countdown to the end date ===== */
.popr-countdown {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	margin-top: 4px;
	padding: 6px 14px;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	opacity: 0.92;
}
.popr-countdown strong {
	font-variant-numeric: tabular-nums;
	font-weight: 800;
	letter-spacing: 0.02em;
}

/* ===== Animations ===== */
.popr-overlay.popr-anim-fade .popr-modal,
.popr-overlay.popr-anim-fade.is-closing .popr-modal {
	transform: none;
	transition: opacity 0.45s ease;
}
.popr-overlay.popr-anim-slide .popr-modal {
	transform: translateY(70px);
	transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}
.popr-overlay.popr-anim-slide.is-open .popr-modal {
	transform: translateY(0);
}
.popr-overlay.popr-anim-slide.is-closing .popr-modal {
	transform: translateY(40px);
}

/* ===== Placement: corners and bars leave the page usable ===== */
.popr-overlay.popr-placed {
	display: block;
	padding: 0;
	background: none;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	pointer-events: none;
}
.popr-overlay.popr-placed .popr-modal {
	position: absolute;
	pointer-events: auto;
}

/* corners */
.popr-overlay.popr-pos-bottom-right .popr-modal {
	right: 24px;
	bottom: 24px;
}
.popr-overlay.popr-pos-bottom-left .popr-modal {
	left: 24px;
	bottom: 24px;
}
.popr-overlay.popr-pos-bottom-right .popr-card,
.popr-overlay.popr-pos-bottom-left .popr-card {
	--popr-width: 380px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}
.popr-overlay.popr-pos-bottom-right .popr-tpl-spotlight,
.popr-overlay.popr-pos-bottom-left .popr-tpl-spotlight {
	min-height: 0;
}
.popr-overlay.popr-pos-bottom-right .popr-tpl-split.popr-has-image,
.popr-overlay.popr-pos-bottom-left .popr-tpl-split.popr-has-image {
	grid-template-columns: 1fr;
}
.popr-overlay.popr-pos-bottom-right .popr-tpl-split .popr-bg,
.popr-overlay.popr-pos-bottom-left .popr-tpl-split .popr-bg {
	min-height: 120px;
}
.popr-overlay.popr-pos-bottom-right .popr-tpl-banner .popr-bg,
.popr-overlay.popr-pos-bottom-left .popr-tpl-banner .popr-bg,
.popr-overlay.popr-pos-bottom-right .popr-tpl-banner .popr-shade,
.popr-overlay.popr-pos-bottom-left .popr-tpl-banner .popr-shade {
	height: 130px;
}
.popr-overlay.popr-pos-bottom-right .popr-content,
.popr-overlay.popr-pos-bottom-left .popr-content {
	padding: 28px 24px;
	gap: 8px;
}
.popr-overlay.popr-pos-bottom-right .popr-title,
.popr-overlay.popr-pos-bottom-left .popr-title {
	font-size: calc(var(--popr-title-size, 34px) * 0.7);
}
.popr-overlay.popr-pos-bottom-right .popr-highlight,
.popr-overlay.popr-pos-bottom-left .popr-highlight {
	font-size: calc(var(--popr-highlight-size, 52px) * 0.68);
}
.popr-overlay.popr-pos-bottom-right .popr-btn,
.popr-overlay.popr-pos-bottom-left .popr-btn {
	padding: 10px 26px;
	font-size: 15px;
}

/* bars */
.popr-overlay.popr-pos-top-bar .popr-modal,
.popr-overlay.popr-pos-bottom-bar .popr-modal {
	left: 0;
	right: 0;
	width: 100%;
	max-width: none;
	transform: translateY(-100%);
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
.popr-overlay.popr-pos-top-bar .popr-modal {
	top: 0;
}
.popr-overlay.popr-pos-bottom-bar .popr-modal {
	bottom: 0;
	transform: translateY(100%);
}
.popr-overlay.popr-pos-top-bar.is-open .popr-modal,
.popr-overlay.popr-pos-bottom-bar.is-open .popr-modal {
	transform: translateY(0);
}
.popr-overlay.popr-pos-top-bar .popr-card,
.popr-overlay.popr-pos-bottom-bar .popr-card {
	display: block;
	width: 100%;
	min-height: 0;
	border-radius: 0;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
}
.popr-overlay.popr-pos-top-bar .popr-bg,
.popr-overlay.popr-pos-bottom-bar .popr-bg,
.popr-overlay.popr-pos-top-bar .popr-shade,
.popr-overlay.popr-pos-bottom-bar .popr-shade {
	display: none;
}
.popr-overlay.popr-pos-top-bar .popr-content,
.popr-overlay.popr-pos-bottom-bar .popr-content {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 22px;
	padding: 14px 64px;
	text-align: start;
}
.popr-overlay.popr-pos-top-bar .popr-title,
.popr-overlay.popr-pos-bottom-bar .popr-title {
	font-size: 18px;
}
.popr-overlay.popr-pos-top-bar .popr-subtitle,
.popr-overlay.popr-pos-bottom-bar .popr-subtitle {
	font-size: 15px;
}
.popr-overlay.popr-pos-top-bar .popr-highlight,
.popr-overlay.popr-pos-bottom-bar .popr-highlight {
	margin: 0;
	font-size: 22px;
}
.popr-overlay.popr-pos-top-bar .popr-btn,
.popr-overlay.popr-pos-bottom-bar .popr-btn {
	margin-top: 0;
	padding: 8px 22px;
	font-size: 14px;
	box-shadow: none;
}
.popr-overlay.popr-pos-top-bar .popr-tpl-image .popr-image,
.popr-overlay.popr-pos-bottom-bar .popr-tpl-image .popr-image {
	max-height: 120px;
}
.popr-overlay.popr-pos-top-bar .popr-close,
.popr-overlay.popr-pos-bottom-bar .popr-close {
	top: 50%;
	right: 14px;
	width: 34px;
	height: 34px;
	margin-top: -17px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ===== Lead form ===== */
.popr-form {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
	max-width: 360px;
	margin: 12px 0 0;
	padding: 0;
}
.popr-form input.popr-input {
	box-sizing: border-box;
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 0 22px;
	border: 1px solid rgba(19, 26, 44, 0.22);
	border-radius: 999px;
	background: #fff;
	box-shadow: none;
	color: #131a2c;
	font-family: inherit;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	text-align: start;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* browsers force phone fields left-to-right; keep the empty field in line with the others */
[dir="rtl"] .popr-form input.popr-input[type="tel"]:placeholder-shown {
	direction: rtl;
}
.popr-form input.popr-input::placeholder {
	color: #7c8494;
	opacity: 1;
}
.popr-form input.popr-input:focus {
	outline: 0;
	border-color: var(--popr-btn-bg, var(--popr-accent, #f6a821));
	box-shadow: 0 0 0 3px rgba(246, 168, 33, 0.28);
}
.popr-form .popr-btn {
	width: 100%;
	min-height: 50px;
	margin: 2px 0 0;
	border: 0;
	cursor: pointer;
	line-height: 1.2;
	text-align: center;
	-webkit-appearance: none;
	appearance: none;
}
/* the outlined button of the Clean template is too quiet for a form */
.popr-tpl-clean:not(.popr-has-btn-bg) .popr-form .popr-btn {
	border: 0;
	background: var(--popr-accent, #f6a821);
	color: var(--popr-on-accent, #131a2c);
}
.popr-form.is-sending .popr-btn {
	opacity: 0.6;
	cursor: progress;
	transform: none;
}
.popr-form-hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	opacity: 0;
	pointer-events: none;
}
.popr-form-consent {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin: 2px 6px 0;
	color: inherit;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.5;
	text-align: start;
	cursor: pointer;
}
.popr-form-consent input {
	flex: none;
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	accent-color: var(--popr-btn-bg, var(--popr-accent, #f6a821));
}
.popr-form-consent a {
	color: inherit;
	text-decoration: underline;
}
.popr-form-msg {
	margin: 0;
	padding: 9px 16px;
	border-radius: 12px;
	background: #fde8e6;
	color: #8c1d18;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-align: start;
}
.popr-form-msg:empty {
	display: none;
}

/* after a sign-up */
.popr-form-done {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	box-sizing: border-box;
	width: 100%;
	max-width: 360px;
	margin-top: 14px;
	text-align: center;
	color: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
	animation: popr-done 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.popr-form-done svg {
	box-sizing: border-box;
	width: 46px;
	height: 46px;
	padding: 11px;
	border-radius: 50%;
	background: var(--popr-btn-bg, var(--popr-accent, #f6a821));
	color: var(--popr-btn-color, var(--popr-on-accent, #131a2c));
}
.popr-form-done path {
	stroke-dasharray: 22;
	stroke-dashoffset: 22;
	animation: popr-check 0.45s 0.2s ease-out forwards;
}
@keyframes popr-done {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}
@keyframes popr-check {
	to {
		stroke-dashoffset: 0;
	}
}

/* image popups: the form sits in a panel under the picture */
.popr-modal.popr-has-panel .popr-card {
	border-bottom-right-radius: 0;
	border-bottom-left-radius: 0;
}
.popr-modal.popr-has-panel .popr-image {
	max-height: 52vh;
}
.popr-form-panel {
	position: relative;
	display: flex;
	justify-content: center;
	box-sizing: border-box;
	/* as wide as the picture above it, never wider */
	width: 0;
	min-width: 100%;
	padding: 18px 20px 20px;
	border-radius: 0 0 var(--popr-radius, 18px) var(--popr-radius, 18px);
	background: #fff;
	color: #131a2c;
	text-align: center;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.popr-form-panel .popr-form {
	max-width: 420px;
	margin-top: 0;
}
.popr-form-panel .popr-form-done {
	max-width: 420px;
	margin-top: 0;
}
.popr-form-panel.popr-has-bg {
	background: var(--popr-card-bg);
}
.popr-form-panel.popr-has-text {
	color: var(--popr-text-color);
}
.popr-form-panel.popr-has-btn-bg .popr-btn {
	background: var(--popr-btn-bg);
	color: var(--popr-btn-color, #131a2c);
}
.popr-form-panel.popr-has-btn-text .popr-btn {
	color: var(--popr-btn-color);
}

/* a form can be taller than a phone screen with the keyboard open */
.popr-overlay.popr-has-form:not(.popr-placed) {
	align-items: flex-start;
	overflow-y: auto;
}
.popr-overlay.popr-has-form:not(.popr-placed) .popr-modal {
	margin: auto;
}

/* corners */
.popr-overlay.popr-pos-bottom-right .popr-form input.popr-input,
.popr-overlay.popr-pos-bottom-left .popr-form input.popr-input {
	height: 44px;
	padding: 0 18px;
}
.popr-overlay.popr-pos-bottom-right .popr-form .popr-btn,
.popr-overlay.popr-pos-bottom-left .popr-form .popr-btn {
	min-height: 44px;
}
.popr-overlay.popr-pos-bottom-right .popr-form-panel,
.popr-overlay.popr-pos-bottom-left .popr-form-panel {
	padding: 14px 16px 16px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

/* bars: everything on one line */
.popr-overlay.popr-pos-top-bar .popr-form,
.popr-overlay.popr-pos-bottom-bar .popr-form {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: auto;
	max-width: none;
	margin: 0;
}
.popr-overlay.popr-pos-top-bar .popr-form input.popr-input,
.popr-overlay.popr-pos-bottom-bar .popr-form input.popr-input {
	width: 190px;
	height: 40px;
	padding: 0 16px;
}
.popr-overlay.popr-pos-top-bar .popr-form .popr-btn,
.popr-overlay.popr-pos-bottom-bar .popr-form .popr-btn {
	width: auto;
	min-height: 40px;
	margin: 0;
}
.popr-overlay.popr-pos-top-bar .popr-form-consent,
.popr-overlay.popr-pos-bottom-bar .popr-form-consent,
.popr-overlay.popr-pos-top-bar .popr-form-msg,
.popr-overlay.popr-pos-bottom-bar .popr-form-msg {
	flex-basis: 100%;
	justify-content: center;
	margin: 0;
	text-align: center;
}
.popr-overlay.popr-pos-top-bar .popr-form-done,
.popr-overlay.popr-pos-bottom-bar .popr-form-done {
	flex-direction: row;
	width: auto;
	max-width: none;
	min-height: 0 !important;
	margin: 0;
	font-size: 16px;
}
.popr-overlay.popr-pos-top-bar .popr-form-done svg,
.popr-overlay.popr-pos-bottom-bar .popr-form-done svg {
	width: 30px;
	height: 30px;
	padding: 7px;
}
.popr-overlay.popr-pos-top-bar .popr-form-panel,
.popr-overlay.popr-pos-bottom-bar .popr-form-panel {
	padding: 10px 56px;
	border-radius: 0;
	box-shadow: none;
}

@media (max-width: 480px) {
	.popr-overlay.popr-pos-top-bar .popr-form input.popr-input,
	.popr-overlay.popr-pos-bottom-bar .popr-form input.popr-input {
		flex: 1 1 140px;
		width: auto;
	}
	.popr-overlay.popr-pos-bottom-right .popr-modal,
	.popr-overlay.popr-pos-bottom-left .popr-modal {
		left: 12px;
		right: 12px;
		bottom: 12px;
	}
	.popr-overlay.popr-pos-bottom-right .popr-card,
	.popr-overlay.popr-pos-bottom-left .popr-card {
		--popr-width: 100vw;
		width: 100%;
	}
	.popr-overlay.popr-pos-top-bar .popr-content,
	.popr-overlay.popr-pos-bottom-bar .popr-content {
		padding: 12px 52px 12px 16px;
		justify-content: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.popr-overlay.popr-placed .popr-modal,
	.popr-overlay.popr-anim-slide .popr-modal {
		transition: none !important;
		transform: none !important;
	}
	.popr-form-done,
	.popr-form-done path {
		animation: none !important;
		stroke-dashoffset: 0;
	}
}
