/* HMS Popups — front-end styles.

   Two defenses against theme CSS (this runs on arbitrary themes):
   1. every rule is prefixed with .hmsp-root, outranking bare element selectors;
   2. paint-critical properties carry !important, because themes ship rules like
      `button, input { border: 1px solid #ccc !important }` that specificity
      alone can never beat (OptinMonster hardens its CSS the same way).
   Layout/positioning on .hmsp-root itself stays un-!important so the admin
   live preview can re-seat the popup statically. */

.hmsp-root {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: inherit;
}

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

.hmsp-root .hmsp-view[hidden] {
	display: none !important;
}

.hmsp-root .hmsp-overlay {
	position: absolute;
	inset: 0;
	background: var(--hmsp-overlay, rgba(15, 19, 26, 0.78)) !important;
	border: 0 !important;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.hmsp-root .hmsp-popup {
	position: relative;
	width: 100%;
	max-width: var(--hmsp-width, 520px);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	background: var(--hmsp-bg, #fff) !important;
	border: 0 !important;
	border-radius: var(--hmsp-radius, 5px) !important;
	box-shadow: 0 24px 70px rgba(8, 12, 22, 0.45), 0 6px 20px rgba(8, 12, 22, 0.22) !important;
	padding: 44px 48px 38px !important;
	text-align: center !important;
	color: var(--hmsp-text, #52627a) !important;
	font-size: 16px !important;
	line-height: 1.5 !important;
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
	transform: scale(0.92) translateY(10px);
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}

.hmsp-root.hmsp-open .hmsp-overlay {
	opacity: 1;
}

.hmsp-root.hmsp-open .hmsp-popup {
	opacity: 1;
	transform: none;
	animation: hmsp-pop-in 0.5s cubic-bezier(0.19, 1.24, 0.38, 1) both;
}

@keyframes hmsp-pop-in {
	0% {
		opacity: 0;
		transform: scale(0.82) translateY(18px);
	}
	62% {
		opacity: 1;
		transform: scale(1.02) translateY(-2px);
	}
	100% {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

/* --- hard reset on everything we render --- */

.hmsp-root .hmsp-popup p,
.hmsp-root .hmsp-popup h2,
.hmsp-root .hmsp-popup form {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-shadow: none !important;
	box-shadow: none !important;
}

.hmsp-root .hmsp-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 34px !important;
	height: 34px !important;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none !important;
	border: 0 !important;
	border-radius: 50% !important;
	margin: 0 !important;
	padding: 0 !important;
	font-size: 22px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	color: #b3bbc8 !important;
	box-shadow: none !important;
	text-transform: none !important;
	cursor: pointer;
	transition: color 0.15s ease, background 0.15s ease;
}

.hmsp-root .hmsp-close:hover,
.hmsp-root .hmsp-close:focus {
	color: #46536b !important;
	background: #f0f3f8 !important;
	outline: none;
}

.hmsp-root .hmsp-heading {
	margin: 0 0 16px !important;
	font-family: inherit !important;
	font-size: 32px !important;
	line-height: 1.18 !important;
	font-weight: 700 !important;
	letter-spacing: -0.2px !important;
	text-transform: none !important;
	color: var(--hmsp-heading, #2d3b5e) !important;
}

.hmsp-root .hmsp-subtext {
	margin: 0 0 26px !important;
	font-size: 20px !important;
	line-height: 1.45 !important;
	font-weight: 400 !important;
	color: var(--hmsp-text, #52627a) !important;
}

.hmsp-root .hmsp-privacy {
	margin: 0 0 20px !important;
	font-size: 15px !important;
	line-height: 1.45 !important;
	font-weight: 400 !important;
	color: var(--hmsp-text, #52627a) !important;
	opacity: 0.92;
}

.hmsp-root .hmsp-btn {
	display: block;
	width: 100% !important;
	border: 0 !important;
	cursor: pointer;
	background: var(--hmsp-accent, #e2453c) !important;
	color: var(--hmsp-accent-text, #fff) !important;
	font-family: inherit !important;
	font-size: 21px !important;
	font-weight: 700 !important;
	line-height: 1.25 !important;
	padding: 17px 20px !important;
	margin: 0 !important;
	border-radius: 5px !important;
	text-decoration: none !important;
	text-transform: none !important;
	letter-spacing: 0.1px !important;
	box-sizing: border-box;
	box-shadow: 0 3px 10px rgba(20, 28, 45, 0.18) !important;
	transition: filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.hmsp-root .hmsp-btn:hover,
.hmsp-root .hmsp-btn:focus {
	filter: brightness(0.93);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(20, 28, 45, 0.24) !important;
	background: var(--hmsp-accent, #e2453c) !important;
	color: var(--hmsp-accent-text, #fff) !important;
	outline: none;
}

.hmsp-root .hmsp-btn:active {
	transform: translateY(0);
	box-shadow: 0 2px 6px rgba(20, 28, 45, 0.2) !important;
}

.hmsp-root .hmsp-btn:focus-visible {
	outline: 3px solid rgba(63, 127, 219, 0.45) !important;
	outline-offset: 2px;
}

.hmsp-root a.hmsp-btn-link {
	display: inline-block;
	width: auto !important;
	padding-left: 36px !important;
	padding-right: 36px !important;
}

.hmsp-root .hmsp-nothanks {
	display: block;
	margin: 18px auto 0 !important;
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 4px 8px !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	color: #8b94a5 !important;
	text-transform: none !important;
	text-decoration: none !important;
	letter-spacing: normal !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: color 0.15s ease;
}

.hmsp-root .hmsp-nothanks:hover,
.hmsp-root .hmsp-nothanks:focus {
	text-decoration: underline !important;
	color: #46536b !important;
	background: none !important;
	outline: none;
}

.hmsp-root .hmsp-field {
	margin: 0 0 14px !important;
	padding: 0 !important;
}

.hmsp-root .hmsp-form input[type="text"],
.hmsp-root .hmsp-form input[type="email"],
.hmsp-root .hmsp-form input[type="tel"] {
	display: block;
	width: 100% !important;
	box-sizing: border-box !important;
	margin: 0 !important;
	padding: 15px 16px !important;
	font-family: inherit !important;
	font-size: 16px !important;
	line-height: 1.3 !important;
	font-weight: 400 !important;
	color: #2d3748 !important;
	background: #fff !important;
	border: 1px solid #d3dbe5 !important;
	border-radius: 4px !important;
	box-shadow: none !important;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	text-transform: none !important;
	height: auto !important;
}

.hmsp-root .hmsp-form input::placeholder {
	color: #9aa5b5 !important;
	opacity: 1 !important;
}

.hmsp-root .hmsp-form input:focus {
	border-color: #3f7fdb !important;
	box-shadow: 0 0 0 3px rgba(63, 127, 219, 0.16) !important;
}

.hmsp-root .hmsp-form .hmsp-btn {
	margin-top: 6px !important;
}

.hmsp-root .hmsp-footer-note {
	margin: 16px 0 0 !important;
	font-size: 13px !important;
	line-height: 1.4 !important;
	font-weight: 700 !important;
	letter-spacing: 0.1px !important;
	color: var(--hmsp-heading, #2d3b5e) !important;
}

.hmsp-root .hmsp-error {
	margin: 12px 0 0 !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	color: #c0392b !important;
}

.hmsp-root .hmsp-success-icon {
	display: block;
	width: 58px !important;
	height: 58px !important;
	margin: 2px auto 18px !important;
}

.hmsp-root .hmsp-success-icon circle {
	fill: #e8f6ee;
	stroke: #2fa96b;
	stroke-width: 2.5;
}

.hmsp-root .hmsp-success-icon path {
	fill: none;
	stroke: #2fa96b;
	stroke-width: 4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.hmsp-root .hmsp-hp {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

.hmsp-root .hmsp-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.hmsp-root .hmsp-btn[disabled] {
	opacity: 0.65 !important;
	cursor: default;
	transform: none;
}

html.hmsp-noscroll,
html.hmsp-noscroll body {
	overflow: hidden !important;
}

@media (max-width: 600px) {
	.hmsp-root {
		padding: 16px;
	}

	.hmsp-root .hmsp-popup {
		padding: 34px 24px 28px !important;
	}

	.hmsp-root .hmsp-heading {
		font-size: 25px !important;
	}

	.hmsp-root .hmsp-subtext {
		font-size: 18px !important;
		margin-bottom: 22px !important;
	}

	.hmsp-root .hmsp-btn {
		font-size: 19px !important;
		padding: 15px 18px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hmsp-root .hmsp-overlay,
	.hmsp-root .hmsp-popup,
	.hmsp-root .hmsp-btn {
		transition: none;
	}

	.hmsp-root.hmsp-open .hmsp-popup {
		animation: none;
	}
}
