/* ============================================================
   NEWSLETTER POPUP — lightweight, dedicated stylesheet.
   Loaded only on qualifying pages (see functions.php).
   position:fixed throughout — the popup never occupies document
   flow, so it contributes zero Cumulative Layout Shift no matter
   when it appears.
   ============================================================ */

.tg-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(7, 17, 33, .45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease;
}
.tg-popup-overlay[hidden] { display: none; }
.tg-popup-overlay.tg-open {
	opacity: 1;
	pointer-events: auto;
}

.tg-popup {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: 85vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 30px 70px -20px rgba(1, 16, 38, .45);
	transform: translateY(16px) scale(.98);
	transition: transform .25s ease;
}
.tg-popup-overlay.tg-open .tg-popup { transform: translateY(0) scale(1); }

.tg-popup-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	border: none;
	background: #F6F8FC;
	color: #0A1B33;
	font-size: 22px;
	line-height: 1;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease;
}
.tg-popup-close:hover,
.tg-popup-close:focus-visible { background: #E7EBF1; }

.tg-popup-body {
	padding: 40px 32px 30px;
	text-align: center;
	font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.tg-popup-body h2 {
	font-family: "Sora", sans-serif;
	font-weight: 800;
	font-size: 1.5rem;
	line-height: 1.25;
	color: #0A1B33;
	margin: 0 0 10px;
}
.tg-popup-body p {
	font-size: .96rem;
	line-height: 1.6;
	color: #6E7E93;
	margin: 0 0 22px;
}

.tg-popup-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.tg-popup-form input[type="text"],
.tg-popup-form input[type="email"],
.tg-popup-form input[type="tel"] {
	width: 100%;
	box-sizing: border-box;
	padding: 13px 16px;
	border: 1.5px solid #D7DDE7;
	border-radius: 10px;
	font-family: inherit;
	font-size: .95rem;
	color: #2A3B54;
}
.tg-popup-form input[type="text"]:focus,
.tg-popup-form input[type="email"]:focus,
.tg-popup-form input[type="tel"]:focus {
	outline: none;
	border-color: #FD9902;
}

.tg-popup-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	text-align: left;
	font-size: .8rem;
	line-height: 1.45;
	color: #6E7E93;
	cursor: pointer;
	margin: 2px 0 4px;
}
.tg-popup-consent input[type="checkbox"] {
	flex-shrink: 0;
	width: 17px;
	height: 17px;
	margin-top: 2px;
	accent-color: #FD9902;
	cursor: pointer;
}
.tg-popup-consent a {
	color: #E27F00;
	text-decoration: underline;
}
.tg-popup-form button[type="submit"] {
	width: 100%;
	padding: 13px 16px;
	border: none;
	border-radius: 999px;
	background: #FD9902;
	color: #231400;
	font-family: inherit;
	font-weight: 700;
	font-size: .96rem;
	cursor: pointer;
	transition: background .15s ease, opacity .15s ease;
}
.tg-popup-form button[type="submit"]:hover { background: #E27F00; }
.tg-popup-form button[type="submit"][disabled] {
	opacity: .6;
	cursor: default;
}

.tg-popup-msg {
	font-size: .85rem;
	min-height: 1.2em;
}
.tg-popup-msg.tg-err { color: #C0392B; }
.tg-popup-msg.tg-ok  { color: #2E9E5B; font-weight: 700; }

.tg-popup-fine {
	display: block;
	margin-top: 16px;
	font-size: .78rem;
	color: #6E7E93;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---- Mobile: compact bottom-sheet, never full-screen ---- */
@media (max-width: 640px) {
	.tg-popup-overlay {
		align-items: flex-end;
		padding: 0 0 16px;
	}
	.tg-popup {
		width: 90%;
		max-width: none;
		max-height: 75vh;
		margin: 0 auto;
		border-radius: 18px;
		transform: translateY(24px);
	}
	.tg-popup-overlay.tg-open .tg-popup { transform: translateY(0); }
	.tg-popup-body { padding: 34px 22px 24px; }
	.tg-popup-body h2 { font-size: 1.28rem; }

	/* Large, easy-to-tap close button on mobile */
	.tg-popup-close {
		width: 42px;
		height: 42px;
		font-size: 24px;
		top: 8px;
		right: 8px;
	}
}

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