/* Montrose sign-up popup. Tokens follow the Montrose email design system. Every rule is scoped to
   #ma-popup / #ma-popup-teaser so the theme's button and input styles cannot leak in. */

#ma-popup,
#ma-popup-teaser {
	--ma-ink: #212529;
	--ma-body: #484f56;
	--ma-muted: #6d757e;
	--ma-paper: #ffffff;
	--ma-canvas: #f9fafb;
	--ma-line: #dfe3e7;
	--ma-teal: #35dad4;
	--ma-teal-line: #2ebcb6;
	--ma-error: #b42318;
	--ma-radius: 10px;
	--ma-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#ma-popup[hidden],
#ma-popup [hidden],
#ma-popup-teaser[hidden] { display: none !important; }

html.ma-popup-open,
html.ma-popup-open body { overflow: hidden !important; }

#ma-popup {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: var(--ma-font);
	color: var(--ma-body);
	-webkit-font-smoothing: antialiased;
}

#ma-popup *,
#ma-popup *::before,
#ma-popup *::after { box-sizing: border-box; }

#ma-popup .ma-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(33, 37, 41, 0.55);
	opacity: 0;
	transition: opacity 0.2s ease;
}

#ma-popup .ma-popup__dialog {
	position: relative;
	outline: none;
	display: flex;
	width: 100%;
	max-width: 440px;
	max-height: calc(100vh - 32px);
	overflow: auto;
	background: var(--ma-paper);
	border-radius: var(--ma-radius);
	box-shadow: 0 24px 64px rgba(33, 37, 41, 0.28);
	transform: translateY(12px);
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

#ma-popup.ma-popup--media .ma-popup__dialog { max-width: 820px; }

#ma-popup.is-open .ma-popup__backdrop { opacity: 1; }
#ma-popup.is-open .ma-popup__dialog { opacity: 1; transform: none; }

#ma-popup .ma-popup__media {
	flex: 0 0 46%;
	min-height: 520px;
	background-color: var(--ma-ink);
	background-size: cover;
	background-position: center;
	border-radius: var(--ma-radius) 0 0 var(--ma-radius);
}

#ma-popup .ma-popup__body {
	flex: 1 1 auto;
	padding: 40px 36px 28px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

#ma-popup .ma-popup__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ma-muted);
	font: 400 28px/40px var(--ma-font);
	text-align: center;
	cursor: pointer;
	box-shadow: none;
}
#ma-popup .ma-popup__close:hover { background: var(--ma-canvas); color: var(--ma-ink); }

#ma-popup .ma-popup__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: var(--ma-ink);
}
#ma-popup .ma-popup__mark img { display: block; width: 26px; height: 26px; margin: 0; }

#ma-popup .ma-popup__step { text-align: left; }
#ma-popup .ma-popup__step[data-ma-step="form"] { display: flex; flex-direction: column; }

#ma-popup .ma-popup__title {
	margin: 0 0 18px;
	padding: 0;
	font: 700 30px/1.12 var(--ma-font);
	letter-spacing: -0.01em;
	color: var(--ma-ink);
	text-transform: none;
}
#ma-popup .ma-popup__title--success {
	text-align: center;
	text-transform: uppercase;
	font-size: 28px;
	outline: none;
}

#ma-popup .ma-popup__form { margin: 0; display: flex; flex-direction: column; gap: 10px; }

#ma-popup .ma-popup__choices { margin: 0 0 6px; padding: 0; border: 0; min-width: 0; }
#ma-popup .ma-popup__question {
	display: block;
	margin: 0 0 10px;
	padding: 0;
	font: 500 16px/1.4 var(--ma-font);
	letter-spacing: normal;
	text-transform: none;
	color: var(--ma-ink);
	float: none;
	width: auto;
}

#ma-popup .ma-choice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0 0 8px;
	padding: 12px 14px;
	border: 1px solid var(--ma-line);
	border-radius: var(--ma-radius);
	background: var(--ma-paper);
	cursor: pointer;
	font: 400 14px/1.4 var(--ma-font);
	color: var(--ma-body);
	transition: border-color 0.15s ease, background 0.15s ease;
}
#ma-popup .ma-choice:hover { border-color: var(--ma-muted); }
#ma-popup .ma-choice input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--ma-ink);
}
#ma-popup .ma-choice strong { font-weight: 600; color: var(--ma-ink); }
#ma-popup .ma-choice:has(input:checked) { border-color: var(--ma-ink); background: var(--ma-canvas); box-shadow: inset 0 0 0 1px var(--ma-ink); }
#ma-popup .ma-choice:has(input:focus-visible) { outline: 2px solid var(--ma-teal-line); outline-offset: 2px; }

#ma-popup .ma-input {
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--ma-line);
	border-radius: var(--ma-radius);
	background: var(--ma-canvas);
	box-shadow: none;
	font: 400 15px/48px var(--ma-font);
	color: var(--ma-ink);
}
#ma-popup .ma-input::placeholder { color: var(--ma-muted); opacity: 1; }
#ma-popup .ma-input:focus { outline: none; border-color: var(--ma-ink); background: var(--ma-paper); box-shadow: 0 0 0 3px rgba(53, 218, 212, 0.35); }
#ma-popup .ma-input[aria-invalid="true"] { border-color: var(--ma-error); }

#ma-popup .ma-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

#ma-popup .ma-popup__error { margin: 0; min-height: 0; font: 500 13px/1.4 var(--ma-font); color: var(--ma-error); }
#ma-popup .ma-popup__error:empty { display: none; }

#ma-popup .ma-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 50px;
	margin: 4px 0 0;
	padding: 0 20px;
	border: 0;
	border-radius: var(--ma-radius);
	background: var(--ma-ink);
	color: #ffffff;
	font: 600 14px/1 var(--ma-font);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	box-shadow: none;
	transition: background 0.15s ease;
}
#ma-popup .ma-btn:hover { background: #000000; color: #ffffff; }
#ma-popup .ma-btn:focus-visible { outline: 3px solid var(--ma-teal); outline-offset: 2px; }
#ma-popup .ma-btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }

#ma-popup .ma-popup__legal {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 6px 0 0;
	font: 400 12px/1.4 var(--ma-font);
	color: var(--ma-muted);
}
#ma-popup .ma-info {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--ma-muted);
	border-radius: 50%;
	background: transparent;
	color: var(--ma-muted);
	font: italic 600 11px/1 Georgia, serif;
	cursor: pointer;
	box-shadow: none;
}
#ma-popup .ma-info:hover,
#ma-popup .ma-info[aria-expanded="true"] { border-color: var(--ma-ink); color: var(--ma-ink); }

#ma-popup .ma-popup__consent {
	margin: 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: var(--ma-canvas);
	font: 400 11.5px/1.5 var(--ma-font);
	color: var(--ma-body);
}

#ma-popup .ma-popup__tagline {
	margin: 4px 0 0;
	text-align: center;
	font: 500 11px/1.4 var(--ma-font);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ma-muted);
}

#ma-popup .ma-popup__step[data-ma-step="success"] { text-align: center; }
#ma-popup .ma-popup__lead { margin: 0 0 18px; font: 400 17px/1.45 var(--ma-font); color: var(--ma-body); }
#ma-popup .ma-code {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 12px;
	padding: 12px 12px 12px 18px;
	border: 1.5px dashed var(--ma-ink);
	border-radius: var(--ma-radius);
	background: var(--ma-canvas);
}
#ma-popup .ma-code__value { font: 600 22px/1.2 var(--ma-font); letter-spacing: 0.04em; color: var(--ma-ink); word-break: break-all; text-align: left; }
#ma-popup .ma-code__copy {
	flex: 0 0 auto;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var(--ma-ink);
	border-radius: 8px;
	background: var(--ma-paper);
	color: var(--ma-ink);
	font: 600 12px/1 var(--ma-font);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: none;
}
#ma-popup .ma-popup__note { margin: 0 0 18px; font: 400 13px/1.5 var(--ma-font); color: var(--ma-muted); }
#ma-popup .ma-popup__note:empty { display: none; }

/* Corner teaser shown after the popup is closed: a dark triangle in the bottom-left corner. */
#ma-popup-teaser {
	position: fixed;
	left: 0;
	bottom: 0;
	z-index: 2147482999;
	width: 112px;
	height: 112px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	clip-path: polygon(0 0, 100% 100%, 0 100%);
	cursor: pointer;
	box-shadow: none;
	overflow: hidden;
}
#ma-popup-teaser::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--ma-ink);
}
#ma-popup-teaser span {
	position: absolute;
	left: 50%;
	top: 50%;
	display: block;
	white-space: nowrap;
	color: #ffffff;
	font: 700 13px/1 "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	letter-spacing: 0.02em;
	/* centre on the diagonal, turn to follow it, then move into the triangle */
	transform: translate(-50%, -50%) rotate(45deg) translateY(16px);
}
#ma-popup-teaser:hover::before { background: #000000; }
#ma-popup-teaser:focus-visible { outline: none; }
#ma-popup-teaser:focus-visible::before { background: #000000; box-shadow: inset 0 0 0 3px var(--ma-teal); }

@media (max-width: 700px) {
	#ma-popup { align-items: flex-end; padding: 0; }
	#ma-popup .ma-popup__dialog,
	#ma-popup.ma-popup--media .ma-popup__dialog {
		max-width: none;
		max-height: 92vh;
		border-radius: 16px 16px 0 0;
		transform: translateY(24px);
	}
	#ma-popup .ma-popup__media { display: none; }
	#ma-popup .ma-popup__body { padding: 32px 20px calc(20px + env(safe-area-inset-bottom)); }
	#ma-popup .ma-popup__title { font-size: 25px; }
	#ma-popup-teaser { width: 96px; height: 96px; }
	#ma-popup-teaser span { font-size: 11.5px; transform: translate(-50%, -50%) rotate(45deg) translateY(14px); }
}

@media (prefers-reduced-motion: reduce) {
	#ma-popup .ma-popup__backdrop,
	#ma-popup .ma-popup__dialog { transition: none; }
}
