/**
 * Data-Mania Lead Magnet Experiments — frontend styles.
 *
 * Tokens are taken from the existing on-site CTA so the box reads as native:
 * rust accent, cream field, square corners, Oswald headings, Work Sans body.
 *
 * Every variant shares this exact styling. Only the headline, promise and button
 * label change, so the test measures the offer concept and nothing else.
 */

.dm-lme-slot {
	--dm-lme-accent: #be5c00;
	/* Deepened a step purely so white button text clears WCAG AA (5.4:1). */
	--dm-lme-accent-ink: #a85200;
	--dm-lme-ink: #1a1a1a;
	--dm-lme-muted: #6b6b6b;
	--dm-lme-cream: #f4efe8;
	--dm-lme-border: #cfcdc9;

	display: block;
	margin: 2.5rem 0;
	/* Reserved height keeps the article from jumping when the box paints. */
	min-height: 17rem;
}

/* ---------------------------------------------------------------- the box */

.dm-lme-box {
	box-sizing: border-box;
	background: var(--dm-lme-cream);
	border: 1px solid var(--dm-lme-border);
	border-left: 4px solid var(--dm-lme-accent);
	border-radius: 0;
	padding: 2rem 2.25rem;
	color: var(--dm-lme-ink);
	text-align: left;
}

.dm-lme-box * {
	box-sizing: border-box;
}

.dm-lme-box__eyebrow {
	margin: 0 0 0.85rem;
	font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 1.8px;
	text-transform: uppercase;
	line-height: 1.2;
	color: var(--dm-lme-accent-ink);
}

.dm-lme-box__headline {
	margin: 0 0 0.75rem;
	font-family: 'Oswald', 'Work Sans', sans-serif;
	font-size: 1.5rem;
	font-weight: 500;
	line-height: 1.25;
	color: var(--dm-lme-ink);
	text-transform: none;
}

.dm-lme-box__promise {
	margin: 0 0 1.5rem;
	font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.6;
	color: var(--dm-lme-ink);
	max-width: 46ch;
}

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

.dm-lme-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 1.8px;
	text-transform: uppercase;
	line-height: 1;
	white-space: normal;
	background: var(--dm-lme-accent-ink);
	color: #fff;
	border: 1px solid #000;
	border-radius: 0;
	padding: 17px 34px;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, transform 0.15s ease;
	min-height: 44px; /* Comfortable mobile tap target. */
}

.dm-lme-btn:hover,
.dm-lme-btn:focus-visible {
	background: #8f4600;
	color: #fff;
}

.dm-lme-btn:focus-visible {
	outline: 3px solid var(--dm-lme-ink);
	outline-offset: 2px;
}

.dm-lme-btn[disabled] {
	opacity: 0.65;
	cursor: default;
}

/* ---------------------------------------------------------------- modal */

.dm-lme-modal[hidden] {
	display: none;
}

.dm-lme-modal {
	--dm-lme-accent: #be5c00;
	--dm-lme-accent-ink: #a85200;
	--dm-lme-ink: #1a1a1a;
	--dm-lme-muted: #6b6b6b;
	--dm-lme-cream: #f4efe8;
	--dm-lme-border: #cfcdc9;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
}

.dm-lme-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(26, 26, 26, 0.7);
}

.dm-lme-modal__panel {
	position: relative;
	width: 100%;
	max-width: 30rem;
	max-height: 90vh;
	overflow-y: auto;
	background: var(--dm-lme-cream);
	border: 1px solid var(--dm-lme-border);
	border-top: 4px solid var(--dm-lme-accent);
	border-radius: 0;
	padding: 2.25rem 2rem 2rem;
	color: var(--dm-lme-ink);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.dm-lme-modal__panel * {
	box-sizing: border-box;
}

.dm-lme-modal__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 44px;
	height: 44px;
	font-size: 1.6rem;
	line-height: 1;
	background: none;
	border: 0;
	color: var(--dm-lme-muted);
	cursor: pointer;
}

.dm-lme-modal__close:hover,
.dm-lme-modal__close:focus-visible {
	color: var(--dm-lme-ink);
}

.dm-lme-modal__eyebrow {
	margin: 0 0 0.75rem;
	font-family: 'Work Sans', sans-serif;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 1.8px;
	text-transform: uppercase;
	color: var(--dm-lme-accent-ink);
	padding-right: 2.5rem;
}

.dm-lme-modal__title {
	margin: 0 0 0.6rem;
	font-family: 'Oswald', 'Work Sans', sans-serif;
	font-size: 1.375rem;
	font-weight: 500;
	line-height: 1.3;
	color: var(--dm-lme-ink);
}

.dm-lme-modal__body {
	margin: 0 0 1.4rem;
	font-family: 'Work Sans', sans-serif;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--dm-lme-ink);
}

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

.dm-lme-form__label {
	display: block;
	margin-bottom: 0.4rem;
	font-family: 'Work Sans', sans-serif;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: var(--dm-lme-ink);
}

.dm-lme-form__input {
	display: block;
	width: 100%;
	font-family: 'Work Sans', sans-serif;
	font-size: 1rem; /* 16px stops iOS zooming on focus. */
	line-height: 1.4;
	padding: 0.85rem 0.9rem;
	background: #fff;
	color: var(--dm-lme-ink);
	border: 1px solid var(--dm-lme-border);
	border-radius: 0;
	min-height: 44px;
}

.dm-lme-form__input:focus-visible {
	outline: 3px solid var(--dm-lme-accent-ink);
	outline-offset: 1px;
	border-color: var(--dm-lme-accent-ink);
}

.dm-lme-form__error {
	margin: 0.6rem 0 0;
	min-height: 1.2em;
	font-family: 'Work Sans', sans-serif;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: #971c0f; /* 6.4:1 on the cream field. */
}

.dm-lme-form__error:empty {
	margin: 0;
	min-height: 0;
}

.dm-lme-btn--submit {
	width: 100%;
	margin-top: 1rem;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.dm-lme-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.dm-lme-success__text {
	margin: 0;
	font-family: 'Work Sans', sans-serif;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.6;
	color: var(--dm-lme-ink);
}

/* Stop background scroll while the modal is open. */
html.dm-lme-modal-open,
html.dm-lme-modal-open body {
	overflow: hidden;
}

/* --------------------------------------------------------------- mobile */

@media (max-width: 600px) {
	.dm-lme-slot {
		margin: 2rem 0;
		min-height: 19rem;
	}

	.dm-lme-box {
		padding: 1.5rem 1.25rem;
	}

	.dm-lme-box__headline {
		font-size: 1.3125rem;
	}

	.dm-lme-box__promise {
		font-size: 0.9375rem;
	}

	.dm-lme-box__cta {
		width: 100%;
	}

	.dm-lme-modal {
		padding: 0;
		align-items: flex-end;
	}

	.dm-lme-modal__panel {
		max-width: none;
		max-height: 92vh;
		padding: 2rem 1.25rem 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dm-lme-btn {
		transition: none;
	}
}

/* ------------------------------------------------------ admin debug panel */

.dm-lme-debug {
	position: fixed;
	bottom: 12px;
	left: 12px;
	z-index: 1000000;
	max-width: 22rem;
	padding: 12px 14px;
	background: #1a1a1a;
	color: #f4efe8;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 11px;
	line-height: 1.6;
	border-left: 4px solid #be5c00;
}

.dm-lme-debug strong {
	display: block;
	margin-bottom: 6px;
	color: #e7c379;
}
