/*
 * Total Definer Lead Popup
 * Design tokens taken from the live store: Astra global accent #caae6c (gold),
 * navy #1f385f, cream #f5ece5, Montserrat as the site-wide font family, and
 * Astra's 30px pill button radius. No webfont is loaded here: Montserrat is
 * already served by the theme, so the popup adds zero font requests.
 */

.tdlp-overlay {
	--tdlp-gold: #caae6c;
	--tdlp-gold-dark: #b3955a;
	--tdlp-navy: #1f385f;
	--tdlp-cream: #f5ece5;
	--tdlp-ink: #1a1a1a;
	--tdlp-muted: #7d7669;
	--tdlp-line: #e4dbd0;

	position: fixed;
	inset: 0;
	z-index: 999990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(20, 16, 12, 0.58);
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
	opacity: 0;
	transition: opacity 0.28s ease;
	-webkit-tap-highlight-color: transparent;
}

/* Hidden until opened: `hidden` keeps it out of the flow, so the popup can
   never shift layout or contribute to CLS. */
.tdlp-overlay[hidden] {
	display: none;
}

.tdlp-overlay.tdlp-visible {
	opacity: 1;
}

.tdlp-modal {
	position: relative;
	width: 100%;
	max-width: 430px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border: 1px solid var(--tdlp-line);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(20, 16, 12, 0.28);
	padding: 38px 32px 26px;
	transform: translateY(14px) scale(0.985);
	transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
	text-align: center;
	box-sizing: border-box;
}

.tdlp-overlay.tdlp-visible .tdlp-modal {
	transform: translateY(0) scale(1);
}

/* Thin gold rule across the top, echoing the store's accent detailing. */
.tdlp-modal::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	border-radius: 18px 18px 0 0;
	background: linear-gradient(90deg, var(--tdlp-gold) 0%, #e2cd9c 50%, var(--tdlp-gold) 100%);
}

/* ------------------------------------------------------------------ close */

.tdlp-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid var(--tdlp-line);
	border-radius: 50%;
	background: #fff;
	color: #5b5348;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tdlp-close svg {
	width: 18px;
	height: 18px;
	display: block;
}

.tdlp-close:hover,
.tdlp-close:focus-visible {
	background: var(--tdlp-cream);
	border-color: var(--tdlp-gold);
	color: var(--tdlp-navy);
}

/* ------------------------------------------------------------- typography */

.tdlp-body {
	margin: 0;
}

.tdlp-kicker {
	margin: 0 0 10px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--tdlp-gold-dark);
}

.tdlp-title {
	margin: 0 0 10px;
	font-size: 23px;
	line-height: 1.22;
	font-weight: 800;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--tdlp-navy);
}

.tdlp-subtitle {
	margin: 0 auto 22px;
	max-width: 340px;
	font-size: 14px;
	line-height: 1.55;
	color: #4a4a4a;
}

/* ------------------------------------------------------------------ form */

.tdlp-form {
	margin: 0;
	text-align: left;
}

.tdlp-field {
	margin-bottom: 14px;
}

.tdlp-label {
	display: block;
	margin-bottom: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tdlp-navy);
}

.tdlp-input {
	width: 100%;
	box-sizing: border-box;
	padding: 13px 16px;
	font-family: inherit;
	font-size: 15px;
	color: var(--tdlp-ink);
	background: #fdfcfa;
	border: 1px solid var(--tdlp-line);
	border-radius: 10px;
	outline: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
	/* 15px keeps iOS Safari from zooming the viewport on focus. */
}

.tdlp-input:focus {
	background: #fff;
	border-color: var(--tdlp-gold);
	box-shadow: 0 0 0 3px rgba(202, 174, 108, 0.22);
}

.tdlp-input.tdlp-invalid {
	border-color: #c0392b;
	box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.14);
}

/* Honeypot: pulled off-canvas rather than display:none, which some bots skip.
   Not tabbable, not announced, zero footprint for real customers. */
.tdlp-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.tdlp-turnstile {
	margin: 4px 0 12px;
	display: flex;
	justify-content: center;
}

.tdlp-error {
	margin: 0 0 10px;
	min-height: 0;
	font-size: 13px;
	line-height: 1.45;
	color: #c0392b;
}

.tdlp-error:empty {
	margin: 0;
}

/* ---------------------------------------------------------------- buttons */

.tdlp-submit {
	display: block;
	width: 100%;
	padding: 15px 20px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #fff;
	background: var(--tdlp-gold);
	border: 1px solid var(--tdlp-gold);
	border-radius: 30px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.tdlp-submit:hover:not(:disabled) {
	background: #fff;
	color: var(--tdlp-gold-dark);
}

.tdlp-submit:active:not(:disabled) {
	transform: translateY(1px);
}

.tdlp-submit:disabled {
	opacity: 0.62;
	cursor: default;
}

.tdlp-consent {
	margin: 14px 0 0;
	font-size: 10.5px;
	line-height: 1.5;
	color: var(--tdlp-muted);
}

/* ---------------------------------------------------------------- success */

.tdlp-success {
	padding: 6px 0 0;
}

.tdlp-check {
	width: 58px;
	height: 58px;
	margin: 0 auto 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--tdlp-cream);
	color: var(--tdlp-gold-dark);
}

.tdlp-check svg {
	width: 28px;
	height: 28px;
}

.tdlp-code-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0 0 20px;
	padding: 14px 16px;
	background: var(--tdlp-cream);
	border: 1px dashed var(--tdlp-gold);
	border-radius: 12px;
}

.tdlp-code {
	font-size: 19px;
	font-weight: 800;
	letter-spacing: 0.14em;
	color: var(--tdlp-navy);
	word-break: break-all;
}

.tdlp-copy {
	padding: 7px 14px;
	font-family: inherit;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tdlp-navy);
	background: #fff;
	border: 1px solid var(--tdlp-gold);
	border-radius: 30px;
	cursor: pointer;
}

.tdlp-continue {
	margin-top: 4px;
}

/* --------------------------------------------------------- scroll locking */

/* Applied to <html> while the dialog is open. Uses overflow only, so the
   scroll position is preserved and restored without any jump. */
html.tdlp-noscroll,
html.tdlp-noscroll body {
	overflow: hidden !important;
}

/* ------------------------------------------------------------- responsive */

/* On phones the dialog becomes a bottom sheet: it never covers the whole
   viewport, the page stays visible above it, and the close button stays in
   easy thumb reach. */
@media (max-width: 600px) {
	.tdlp-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.tdlp-modal {
		max-width: 100%;
		max-height: 86vh;
		border-radius: 20px 20px 0 0;
		border-bottom: 0;
		padding: 30px 20px 22px;
		transform: translateY(100%);
		transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
	}

	.tdlp-modal::before {
		border-radius: 20px 20px 0 0;
	}

	.tdlp-overlay.tdlp-visible .tdlp-modal {
		transform: translateY(0);
	}

	.tdlp-title {
		font-size: 20px;
	}

	.tdlp-subtitle {
		font-size: 13.5px;
		margin-bottom: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tdlp-overlay,
	.tdlp-modal {
		transition: none !important;
	}

	.tdlp-modal {
		transform: none !important;
	}
}
