/* TIR Popup — colors match Betheme options (theme #2b6cf5, text #204289) */

.tir-popup {
	--tir-popup-primary: #2b6cf5;
	--tir-popup-navy: #204289;
	--tir-popup-muted: #a8a8a8;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: "Plus Jakarta Sans", sans-serif;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.tir-popup[hidden] {
	display: none;
}

.tir-popup.is-open {
	opacity: 1;
}

.tir-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(32, 66, 137, 0.45);
}

.tir-popup__box {
	position: relative;
	/* Two-thirds of the viewport; grows taller only if the content needs it. */
	display: flex;
	flex-direction: column;
	justify-content: center;
	justify-content: safe center; /* don't clip the top when content scrolls */
	width: 66.667vw;
	min-height: 66.667vh;
	min-height: 66.667dvh;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	box-sizing: border-box;
	padding: clamp(48px, 6vh, 72px) clamp(40px, 6vw, 96px);
	background: #ffffff;
	border-radius: 24px;
	box-shadow: 0 20px 60px rgba(32, 66, 137, 0.25);
	color: var(--tir-popup-navy);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.25s ease;
	outline: none;
}

.tir-popup.is-open .tir-popup__box {
	transform: none;
}

.tir-popup__close {
	position: absolute;
	top: 16px;
	right: 18px;
	padding: 4px 8px;
	border: 0;
	background: none;
	color: var(--tir-popup-muted);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.tir-popup__close:hover,
.tir-popup__close:focus-visible {
	color: var(--tir-popup-primary);
}

.tir-popup .tir-popup__title {
	margin: 0 0 20px;
	color: var(--tir-popup-navy);
	font-family: inherit;
	/* Scales with the smaller screen dimension, like the box (min 22px, max 56px). */
	font-size: clamp(22px, 4vmin, 56px);
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
}

.tir-popup__content {
	/* Scales with the smaller screen dimension, like the box (min 16px, max 26px). */
	font-size: clamp(16px, 2vmin, 26px);
	line-height: 1.6;
	color: var(--tir-popup-navy);
}

.tir-popup__content > :first-child {
	margin-top: 0;
}

.tir-popup__content p {
	margin: 0 0 16px;
}

.tir-popup__content ul,
.tir-popup__content ol {
	margin: 24px 0;
	padding-left: 1.5em;
}

/* Betheme strips list bullets globally (ul { list-style: none }), so restore them here. */
.tir-popup .tir-popup__content ul {
	list-style: disc outside;
}

.tir-popup .tir-popup__content ol {
	list-style: decimal outside;
}

.tir-popup .tir-popup__content ul ul {
	list-style-type: circle;
}

.tir-popup .tir-popup__content ul ul ul {
	list-style-type: square;
}

.tir-popup .tir-popup__content ul ul,
.tir-popup .tir-popup__content ol ol,
.tir-popup .tir-popup__content ul ol,
.tir-popup .tir-popup__content ol ul {
	margin: 4px 0;
}

.tir-popup .tir-popup__content li {
	display: list-item;
	margin-bottom: 4px;
}

.tir-popup__content li::marker {
	color: var(--tir-popup-primary);
}

.tir-popup__content a:not(.tir-popup__button) {
	color: var(--tir-popup-primary);
}

.tir-popup .tir-popup__button {
	display: block;
	align-self: center;
	width: 100%;
	max-width: 420px;
	box-sizing: border-box;
	margin-top: 32px;
	padding: 16px 32px;
	border: 1px solid var(--tir-popup-primary);
	border-radius: 38px;
	background: var(--tir-popup-primary);
	color: #ffffff;
	font-size: 17px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: background 0.2s, border-color 0.2s;
}

.tir-popup .tir-popup__button:hover,
.tir-popup .tir-popup__button:focus-visible {
	background: var(--tir-popup-navy);
	border-color: var(--tir-popup-navy);
	color: #ffffff;
}

body.tir-popup-lock {
	overflow: hidden;
}

/* Tablets and phones: 2/3 width is too narrow, so use the full screen minus the gutter. */
@media (max-width: 900px) {
	.tir-popup__box {
		width: 100%;
		min-height: 0;
	}
}

@media (max-width: 480px) {
	.tir-popup__box {
		padding: 44px 24px 28px;
		border-radius: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tir-popup,
	.tir-popup__box {
		transition: none;
	}
}
