/**
 * Discount popup — T125. Prefix: hdm-dp-.
 *
 * Visual redesign (T125 redesign): clean white card, navy #1a3a5c headline,
 * green #2cba0b accents + CTA, 80%-black overlay. Built for readability on
 * touch + elderly users — ≥16px body text, ≥22px headline, large tap targets,
 * a 44×44 close button, and generous padding. Mobile-first and centered (not a
 * bottom sheet); desktop caps at 480px.
 *
 * The JS (discount-popup.js) is unchanged: it shows/hides via the `is-open`
 * class + `hidden` attribute, swaps the `data-step` panels with `hidden`, and
 * toggles `.has-error` / `.is-copied`. Every one of those hooks is honoured
 * below — do not rename these selectors without updating the JS.
 */

:root {
	--hdm-dp-green: #2cba0b;
	--hdm-dp-green-dark: #239408;
	--hdm-dp-navy: #1a3a5c;
	--hdm-dp-ink: #2b2b2b;
	--hdm-dp-muted: #5a6573;
	--hdm-dp-line: #e3e8ee;
}

/* ── overlay ──────────────────────────────────────────────────────────── */
.hdm-dp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;          /* centered on screen (mobile + desktop) */
	justify-content: center;
	padding: 24px;                /* breathing room so tapping outside closes */
	background: rgba(0, 0, 0, .8); /* 80% black */
	opacity: 0;
	transition: opacity .18s ease;
}
.hdm-dp-overlay.is-open { opacity: 1; }
.hdm-dp-overlay[hidden] { display: none; }

.hdm-dp-overlay *,
.hdm-dp-overlay *::before,
.hdm-dp-overlay *::after { box-sizing: border-box; }

/* ── the card ─────────────────────────────────────────────────────────── */
.hdm-dp-card {
	position: relative;
	width: 100%;
	max-width: 480px;             /* desktop cap */
	border-radius: 16px;
	background: #fff;
	color: var(--hdm-dp-ink);
	padding: 28px 24px 24px;      /* generous (≥24px) */
	box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
	font-family: inherit;
	transform: translateY(10px) scale(.985);
	transition: transform .2s ease;
}
.hdm-dp-overlay.is-open .hdm-dp-card { transform: none; }

/* ── close button — large circle, navy border, top-right ─────────────── */
.hdm-dp-close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;                  /* ≥44×44 tap target */
	height: 44px;
	padding: 0;
	border: 2px solid var(--hdm-dp-navy);
	border-radius: 50%;
	background: #fff;
	color: var(--hdm-dp-navy);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background .14s ease, color .14s ease;
}
.hdm-dp-close:hover,
.hdm-dp-close:focus-visible { background: var(--hdm-dp-navy); color: #fff; }

/* ── eyebrow — green "EXCLUSIVE OFFER" pill, top-left ────────────────── */
.hdm-dp-eyebrow {
	display: inline-block;
	background: var(--hdm-dp-green);
	color: #fff;
	border-radius: 999px;
	padding: 6px 12px;
	margin-bottom: 16px;
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* ── offer hero ──────────────────────────────────────────────────────── */
.hdm-dp-offer { margin-bottom: 16px; }
.hdm-dp-offer-lead {
	display: block;
	font-size: 30px;
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -.5px;
	color: var(--hdm-dp-green);
}
.hdm-dp-offer-sub {
	display: block;
	margin-top: 4px;
	font-size: 15px;
	font-weight: 500;
	color: var(--hdm-dp-muted);
}

/* ── divider ─────────────────────────────────────────────────────────── */
.hdm-dp-divider {
	height: 1px;
	background: var(--hdm-dp-line);
	margin: 0 0 18px;
}

/* ── headline + subtext ──────────────────────────────────────────────── */
.hdm-dp-headline {
	margin: 0 0 10px;
	font-size: 24px;              /* ≥22px */
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -.3px;
	color: var(--hdm-dp-navy);
}
.hdm-dp-sub {
	margin: 0 0 18px;
	font-size: 16px;              /* ≥16px body */
	font-weight: 400;
	line-height: 1.5;
	color: var(--hdm-dp-muted);
}

/* ── form ────────────────────────────────────────────────────────────── */
.hdm-dp-form { display: flex; flex-direction: column; gap: 12px; }

.hdm-dp-input {
	width: 100%;
	height: 54px;                 /* large, easy to tap */
	padding: 0 16px;
	border: 1.5px solid #cbd5e0;
	border-radius: 10px;
	background: #fff;
	color: var(--hdm-dp-ink);
	font-size: 16px;              /* ≥16px also avoids iOS zoom-on-focus */
	font-family: inherit;
}
.hdm-dp-input::placeholder { color: #8b95a3; }
.hdm-dp-input:focus {
	outline: none;
	border-color: var(--hdm-dp-green);
	box-shadow: 0 0 0 3px rgba(44, 186, 11, .22);
}
.hdm-dp-input.has-error {
	border-color: #e02424;
	box-shadow: 0 0 0 3px rgba(224, 36, 36, .18);
}

.hdm-dp-error {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: #c81e1e;
}
.hdm-dp-error[hidden] { display: none; }

/* full-width green CTA */
.hdm-dp-submit {
	width: 100%;
	height: 54px;
	border: 0;
	border-radius: 10px;
	background: var(--hdm-dp-green);
	color: #fff;
	font-size: 17px;
	font-weight: 800;
	letter-spacing: .2px;
	cursor: pointer;
	font-family: inherit;
	transition: transform .12s ease, background .14s ease;
}
.hdm-dp-submit:hover { background: var(--hdm-dp-green-dark); }
.hdm-dp-submit:active { transform: translateY(1px); }
.hdm-dp-submit[disabled] { opacity: .7; cursor: default; }

.hdm-dp-fineprint {
	margin: 2px 0 0;
	text-align: center;
	font-size: 13px;
	color: var(--hdm-dp-muted);
}

.hdm-dp-decline {
	display: block;
	margin: 6px auto 0;
	background: none;
	border: 0;
	color: var(--hdm-dp-muted);
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	font-family: inherit;
}
.hdm-dp-decline:hover { color: var(--hdm-dp-navy); }

/* ── reveal step (post-submit) ───────────────────────────────────────── */
.hdm-dp-step[hidden] { display: none; }

.hdm-dp-step[data-step="reveal"] .hdm-dp-headline { margin-bottom: 14px; }

.hdm-dp-code {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 4px 0 14px;
	padding: 14px 16px;
	border: 2px dashed var(--hdm-dp-green);
	border-radius: 12px;
	background: #f1faee;
	color: var(--hdm-dp-navy);
	cursor: pointer;
	font-family: inherit;
}
.hdm-dp-code-text {
	font-size: 22px;
	font-weight: 800;
	letter-spacing: 1.5px;
	color: var(--hdm-dp-green);
}
.hdm-dp-code-copy {
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .5px;
	background: var(--hdm-dp-green);
	color: #fff;
	border-radius: 6px;
	padding: 6px 11px;
}
/* JS adds .is-copied — swap "Copy" for "Copied!" */
.hdm-dp-code.is-copied .hdm-dp-code-copy { font-size: 0; }
.hdm-dp-code.is-copied .hdm-dp-code-copy::after {
	content: "Copied!";
	font-size: 11px;
	letter-spacing: .5px;
}

.hdm-dp-done {
	width: 100%;
	height: 50px;
	border: 1.5px solid var(--hdm-dp-navy);
	border-radius: 10px;
	background: #fff;
	color: var(--hdm-dp-navy);
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
}
.hdm-dp-done:hover { background: #f4f6f8; }

/* ── screen-reader-only label ────────────────────────────────────────── */
.hdm-dp-sronly {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}

/* ── mobile: stay centered, give the card a touch more room ──────────── */
@media (max-width: 560px) {
	.hdm-dp-overlay { padding: 16px; }
	.hdm-dp-card { padding: 26px 20px 22px; }
	.hdm-dp-offer-lead { font-size: 27px; }
	.hdm-dp-headline { font-size: 22px; } /* keep ≥22px floor */
}

@media (prefers-reduced-motion: reduce) {
	.hdm-dp-overlay,
	.hdm-dp-card { transition: none; }
}
