/* dec popup: form → "Find the Yeti" game → success. Every number is the Figma frames' (2-Pop up info 3:36,
   3-Pop up game 3:1550, 5-Pop up success 4:4409, and their - Mobile twins), measured by scripts/popup-layout.mjs
   (work/figma/layout-popup.json). Scoped to #popup-dec; the framework's popup.css / forms.css are untouched. */
#popup-dec {
	--popup-width: 660px;
	--popup-height: 600px;
	--popup-max-width: calc(100vw - 20px);
	--popup-max-height: none;
	--popup-align: flex-start;
	--close-x: 24.7px;
	--close-y: 26.3px;
	--form-width: 583.9px;
	--form-field-padding: 12.5px 10px;
	--form-input-height: 53px;
	--form-input-radius: 6px;
	--form-label-font-size: 16px;
	--form-input-font-size: 16px;
	--form-label-offset-x: 17.8px;
	--form-input-text-indent: 17.8px;
	--submit-dist: 31.5px;
	--submit-width: 235px;
	--submit-height: 45px;
	--submit-radius: 54px;
	--submit-bg: #eb0f10;
	--submit-color: #ffffff;
}
#popup-dec .popup-content {
	position: relative;
	width: var(--popup-width);
	max-width: var(--popup-max-width);
	height: var(--popup-height);
	max-height: var(--popup-max-height);
	background-color: #073767;
}
#popup-dec h2,
#popup-dec p {
	margin: 0;
}
#popup-dec picture img {
	max-width: none;
}

/* the panel background of each step (Form BG 3:37 / 3:1551 / 4:4410): the night sky and its snow (Layer_1), art behind
   the step's content. The mountains (the Form BG's Frames) are their own layer, tied to the panel's bottom edge, so they
   stay there on phones, where the panel is the screen's height. */
#popup-dec .popup-default,
#popup-dec .popup-game,
#popup-dec .popup-thanks {
	position: relative;
}
#popup-dec .dec-panel-bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
	background-color: #073767;
	background-position: center top;
	background-size: 100% 100%;
	background-repeat: no-repeat;
	background-image: url("../images/hero/popup-back.png");
	background-image: image-set(url("../images/hero/popup-back.webp") type("image/webp") 1x, url("../images/hero/popup-back@2x.webp") type("image/webp") 2x, url("../images/hero/popup-back.png") 1x, url("../images/hero/popup-back@2x.png") 2x);
}
/* the mountains (56:64 / 3:1552 / 4:4411): 660x179, the panel's bottom 179px, cut by its sides as Form BG clips them */
#popup-dec .dec-mountains {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	aspect-ratio: 660 / 179;
	background-position: center bottom;
	background-size: 100% 100%;
	background-repeat: no-repeat;
	background-image: url("../images/hero/mountains.png");
	background-image: image-set(url("../images/hero/mountains.webp") type("image/webp") 1x, url("../images/hero/mountains@2x.webp") type("image/webp") 2x, url("../images/hero/mountains.png") 1x, url("../images/hero/mountains@2x.png") 2x);
}
/* Figma layers baked into the panel art above (the mountains' tree/snow frames 3:1327 3:1402 3:1476 / 4:4485 4:4559,
   45:5581 45:5655 / 45:970 45:1044; the phone panel's snow layer 45:5729 / 45:1118): each tagged on its own empty box
   at its layer's place, painted by its parent's picture */
#popup-dec .dec-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
#popup-dec .dec-layer-m {
	display: none;
}
#popup-dec .dec-form-title,
#popup-dec .popup-form form,
#popup-dec .dec-game-title,
#popup-dec .dec-trees,
#popup-dec .dec-thanks {
	position: relative;
	z-index: 1;
}

/* the close: the frame's X (white bars, 3px x 27px, crossed at 45deg) */
#popup-dec .popup-close {
	top: var(--close-y);
	right: var(--close-x);
	width: 35.3px;
	height: 35.3px;
	padding: 0;
	z-index: 5;
	border: 0;
	background: transparent;
}
#popup-dec .popup-close::before,
#popup-dec .popup-close::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 3px;
	height: 27px;
	margin: -13.5px 0 0 -1.5px;
	border-radius: 2px;
	background-color: #ffffff;
	transform: rotate(45deg);
}
#popup-dec .popup-close::after {
	transform: rotate(-45deg);
}

/* step 2, the form (g1: title 3:727, Form Fields 3:705, Submit 3:707) */
#popup-dec .popup-default {
	align-items: var(--popup-align);
}
/* the title's glyphs at 71.6 (3:727's render box): its 50px line box starts 8px lower than 63.6, and gives the 8px
   back below it, so the form stays at 147.5 (first field 160) */
#popup-dec .popup-form {
	padding-top: 71.6px;
}
#popup-dec .dec-form-title {
	width: fit-content;
	margin: 0 auto 25.9px;
	font-size: 55px;
	line-height: 50px;
	font-weight: 400;
	letter-spacing: 0;
	text-align: center;
}
#popup-dec form.uni-style {
	color: #2a2a2a;
	font-family: 'Avenir-Roman', sans-serif;
}
#popup-dec form.uni-style input,
#popup-dec form.uni-style select,
#popup-dec form.uni-style textarea {
	border: 1.315px solid #c3c3c5;
	color: #373737;
}
#popup-dec label .f-red {
	color: #fc5147;
}
#popup-dec .form-action {
	display: flex;
	justify-content: center;
	padding-top: 0;
}
#popup-dec .promoLead {
	width: var(--submit-width);
	height: var(--submit-height);
	margin: var(--submit-dist) auto 0;
	padding: 0;
	border-radius: var(--submit-radius);
	background: var(--submit-bg);
	color: var(--submit-color);
	font-size: 20px;
	letter-spacing: 0;
	text-transform: uppercase;
	line-height: 1;
}

/* step 3, the game (3-Pop up game 1:7611, 3 trees 1:8430/1:8431/1:8432 at 19,254 / 239,254 / 458.8,254, 221x309; its
   4-Pop up game 1:8435 twin is the one tap's reveal Figma draws: tree 2 gone, the yeti (Frame 2 1:9256, 215x219 at
   223,307 — i.e. -16,53 of a 221x309 tree box) in its place, trees 1/1:9254 and 3/1:9255 unchanged). Fixed: the yeti
   is behind every tree, so each button carries its own hidden "Frame 2" at that same -16,53 offset (.dec-jump),
   revealed by .is-picked on tap — Figma only draws the one example, but the offset is the same for all three. */
#popup-dec .popup-game {
	display: flex;
	flex-direction: column;
	align-items: center;
}
#popup-dec .dec-game-title {
	margin-top: 63.5px;
	font-size: 64.74px;
	line-height: 68px;
	font-weight: 400;
	text-align: center;
}
#popup-dec .dec-trees {
	position: relative;
	width: 100%;
	height: 309px;
	margin-top: 54.5px;
}
#popup-dec .dec-tree {
	position: absolute;
	top: 0;
	width: 221px;
	height: 309px;
	padding: 0;
	background: transparent;
	cursor: pointer;
	transition: transform 0.2s ease;
}
/* revision (dev request): Figma's own trio (19,239,458.8, each 221 wide) is 660.8px end to end — 0.8px wider than
   the 660px panel — all shifted 19.4px right of centre, which ran tree 3 19.8px past the panel's right edge.
   Centred instead: shifted left by 19.417px so the 0.8px overflow splits evenly (0.4px) on each side. */
#popup-dec .dec-tree[data-pick="1"] {
	left: -0.4px;
}
#popup-dec .dec-tree[data-pick="2"] {
	left: 219.6px;
}
#popup-dec .dec-tree[data-pick="3"] {
	left: 439.4px;
}
#popup-dec .dec-tree:hover:not(:disabled),
#popup-dec .dec-tree:focus-visible,
#popup-dec .dec-tree.is-picked {
	transform: translateY(-6px);
}
#popup-dec .dec-tree-img {
	width: 100%;
	height: 100%;
	transition: opacity 0.25s ease;
}
/* the yeti (Frame 2 1:9256): hidden behind each tree until picked, at the one offset Figma's reveal frame draws */
#popup-dec .dec-jump {
	position: absolute;
	left: -16px;
	top: 53px;
	width: 215px;
	height: 219px;
	opacity: 0;
	transform: translateY(40px) scale(0.6);
	transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
	pointer-events: none;
}
#popup-dec .dec-tree.is-picked {
	z-index: 2;
}
#popup-dec .dec-tree.is-picked .dec-tree-img {
	opacity: 0;
}
#popup-dec .dec-tree.is-picked .dec-jump {
	opacity: 1;
	transform: none;
}

/* step 4, success (5-Pop up success 1:6337): title 1:7609 (box 59-142), the gift card (art 1:7157 at 155,175, 353x271
   with its shadow; its copy 1:7182 rotated -5.32deg with the card), the check line 1:7610 at 432 (it overlaps the card's
   shadow by 14px), Keep Shopping 1:7607 at 486. One column, Figma's gaps between its members. */
#popup-dec .popup-thanks {
	justify-content: flex-start;
	padding-top: 0;
}
#popup-dec .tracking_promo_success {
	position: absolute;
}
#popup-dec .dec-thanks {
	padding-top: 59px;
}
#popup-dec .thanks {
	width: fit-content;
}
#popup-dec .dec-found {
	width: 596px;
	max-width: 100%;
	font-size: 46px;
	line-height: 55.2px;
	font-weight: 400;
	text-align: center;
	text-box: trim-both cap alphabetic;
}
#popup-dec .dec-gift {
	display: grid;
	width: 353px;
	height: 271px;
	margin-top: 33px;
	margin-left: 5px;
}
#popup-dec .dec-gift-text {
	grid-area: 1 / 1;
}
/* the card's two layers, White surface 1:7158 and Ribbon 1:7160, at their render boxes; the container's drop shadow
   (Figma: 0 3.603px 13.51px rgba(0,0,0,.33)) is CSS */
#popup-dec .dec-gift-card {
	position: absolute;
	inset: 0;
	filter: drop-shadow(0 3.603px 13.51px rgba(0, 0, 0, 0.33));
	pointer-events: none;
}
#popup-dec .dec-gift-surface {
	position: absolute;
	left: -3px;
	top: 0;
	width: 351px;
	height: 240px;
}
#popup-dec .dec-gift-ribbon {
	position: absolute;
	left: -1px;
	top: 21px;
	width: 89px;
	height: 101px;
}
/* Figma: "$50" 132.39px and "gift card*" 43.34px, Boogaloo, line height 1.12, #009546 with a 1px centre stroke and a
   1 2 10 rgba(0,0,0,.25) drop shadow, centred 2.2px right and 8px down of the art's box, turned with the card */
#popup-dec .dec-gift-text {
	place-self: center;
	/* verify pass: the preview's ink drew "$50" 29px low and 18px right of Figma's, "gift card*" 11px low: the lines
	   sit 18px further apart (margin below) and the block 20px higher */
	transform: translate(2.2px, -28px) rotate(-5.32deg);
	color: #009546;
	-webkit-text-stroke: 1px #009546;
	text-shadow: 1px 2px 10px rgba(0, 0, 0, 0.25);
	font-weight: 400;
	font-size: 43.34px;
	line-height: 48.5px;
	text-align: center;
	white-space: nowrap;
}
#popup-dec .dec-gift-amt,
#popup-dec .dec-gift-sub {
	display: block;
}
#popup-dec .dec-gift-amt {
	font-size: 132.39px;
	line-height: 1.12;
	margin-bottom: -20px;
	/* Figma's line is "$50 " with its trailing space, which centres the glyphs half a space left of the second line */
	white-space: pre;
}
#popup-dec .dec-gift-sub {
	font-size: 43.34px;
	line-height: 1.12;
}
#popup-dec .dec-check {
	margin-top: -14px;
	font-size: 28px;
	line-height: 30.8px;
	letter-spacing: 0.28px;
	text-align: center;
	white-space: nowrap;
}
#popup-dec .dec-keep {
	width: 235px;
	height: 45px;
	margin: 23px auto 0 !important;
	padding: 0;
	border-radius: 54px;
	background: #eb0f10;
	color: #ffffff;
	font-size: 20px;
	letter-spacing: 0;
	line-height: 1;
}
/* the thumbs-up yeti (Frame 5 1:7183): at -1,394 (185x209), cut by the panel's bottom edge as Form BG clips it */
#popup-dec .dec-thanks-yeti {
	position: absolute;
	left: -1px;
	top: 394px;
	width: 185px;
	height: 206px;
	overflow: hidden;
	z-index: 0;
	pointer-events: none;
}
#popup-dec .dec-thanks-yeti img {
	position: absolute;
	left: 0;
	top: 0;
	width: 185px;
	height: auto;
	z-index: 0;
	pointer-events: none;
}
#popup-dec .dec-keep:hover,
#popup-dec .promoLead:hover {
	filter: brightness(1.12);
}

/* phones: full screen (rto-form-popups makes .popup-content 100% x 100% at <=567px; only its variables change here),
   with the 390 frames' own numbers. The sky (Form BG 1:9623's Layer_1) covers the panel from the top; the mountains
   (1:12913, 390x124) stay pinned to the real bottom of the panel (`bottom: 0`, their shared non-mobile rule) whatever
   the screen's height — `--popup-height`/`--popup-max-height` below are `dvh`, not `%`, so the panel is always the
   device's actual visible height, not the layout viewport's.
   Revision (dev request, not Figma): the mobile frame's own "Form BG" band is a fixed design height, so a phone taller
   than it leaves spare height below the content — a fixed figure can only ever be correct for one device height.
   Instead of chasing the frame's own number, `.popup-default`/`.popup-thanks` are flex columns whose one content child
   (`.popup-form` / `.dec-thanks`) is centred with `justify-content: center` in the space above the mountains: a
   `padding-bottom` the size of the mountains (124/390 of the full-bleed width) reserves their band so the free space
   splits evenly above and below the content instead of collecting under it. This intentionally reads differently from
   the Figma frame on a phone taller than the design's own height — don't revert it to chase the frame, and ignore
   verify-surface element failures it causes on the form/success steps' content position. The game step is unaffected:
   its own trees and mountains are already anchored to the panel's real bottom edge (below). */
@media (max-width: 567px) {
	#popup-dec {
		--popup-width: 100%;
		--popup-height: 100dvh;
		--popup-max-height: 100dvh;
		--popup-max-width: 100%;
		--popup-align: flex-start;
		--close-x: 12.7px;
		--close-y: 11.3px;
		--form-width: 350px;
		--form-width-mobile: 350px;
		--form-field-padding: 8px 0px;
		--form-field-padding-mobile: 8px 0px;
		--form-input-height: 53px;
		--form-input-radius: 6px;
		--form-input-radius-mobile: 6px;
		--form-label-font-size: 16px;
		--form-label-font-size-mobile: 16px;
		--form-input-font-size: 16px;
		--form-input-font-size-mobile: 16px;
		--form-label-offset-x: 17.75px;
		--form-input-text-indent: 17.75px;
		--submit-dist: 25px;
	}
	#popup-dec .dec-panel-bg {
		background-size: cover;
		background-image: url("../images/hero/popup-back-m.png");
		background-image: image-set(url("../images/hero/popup-back-m.webp") type("image/webp") 1x, url("../images/hero/popup-back-m@2x.webp") type("image/webp") 2x, url("../images/hero/popup-back-m.png") 1x, url("../images/hero/popup-back-m@2x.png") 2x);
	}
	#popup-dec .dec-mountains {
		aspect-ratio: 390 / 124;
		background-image: url("../images/hero/mountains-m.png");
		background-image: image-set(url("../images/hero/mountains-m.webp") type("image/webp") 1x, url("../images/hero/mountains-m@2x.webp") type("image/webp") 2x, url("../images/hero/mountains-m.png") 1x, url("../images/hero/mountains-m@2x.png") 2x);
	}
	/* revision (dev request): the game step's own snowbank (1:14576's "Form BG" stacks three snow layers 1:14577/
	   1:14651/1:14725 at 390x329 under the trees) is a taller, different snow shape than the 124px-tall range shared
	   by the form and thank-you steps above — on mobile only; its desktop export already matches the shared 660x179
	   mountains.png. mountains-game-m.png is that composite at its own render bounds. */
	#popup-dec .dec-mountains-game {
		aspect-ratio: 390 / 329;
		background-image: url("../images/hero/mountains-game-m.png");
		background-image: image-set(url("../images/hero/mountains-game-m.webp") type("image/webp") 1x, url("../images/hero/mountains-game-m@2x.webp") type("image/webp") 2x, url("../images/hero/mountains-game-m.png") 1x, url("../images/hero/mountains-game-m@2x.png") 2x);
	}
	/* revision (dev request): the mountains go back to the shared `bottom: 0` rule above (the mobile frame's "Form BG"
	   band is a fixed design height, but the panel is now `dvh`, not a fixed px figure, so there is no single number
	   that is still correct on every phone). `bottom: 0` keeps them flush with the real bottom of the panel at their
	   own size on every device; the content above no longer chases a fixed offset because it is centred in the space
	   the mountains leave above them, not pinned under the close button. */
	#popup-dec .popup-default,
	#popup-dec .popup-thanks {
		flex-direction: column;
		justify-content: center;
		/* ported from Affordable's Dec 2026 promo (b0efc3e): `vh`, not `vw` — this reserves space in the panel's own
		   height (it's `100dvh` on this breakpoint), not its width, so the padding needs to scale with the device's
		   height, not its width */
		padding-bottom: 4.7vh;
	}
	/* revision (dev request, measured against Figma at 390x692): with the `vh` reservation above, the success step's
	   centred content (title/check line/Keep Shopping) landed 32-37px lower than Figma's own y (59/433/487) — a
	   different padding-bottom is needed to centre THIS step's own content (468.3px tall) in the 692px-tall reference
	   panel at exactly Figma's title position; solved from `692 - 468.3 - 2*59 = 105.7px` (15.273vh of 692), which
	   also lands the check line and Keep Shopping within ~5px of Figma (433/487) — the small residual drift between
	   title and the lines below it is normal CSS line-height vs. Figma's own auto-layout gaps, not this reservation.
	   The form step isn't touched: its own content wasn't reported off, so it keeps the ported 4.7vh above. */
	#popup-dec .popup-thanks {
		padding-bottom: 15.273vh;
	}
	/* revision (dev request, intentionally off the design's fixed-height frame): `.popup-default` above now centres
	   this block itself (flex column, `justify-content: center`, padded for the mountains), so no fixed top padding is
	   needed to land the title at the design's own box — that number only ever held on a phone exactly as tall as the
	   frame. Horizontal padding stays 0: --form-width already carries the side margins. */
	#popup-dec .popup-form {
		margin: 0;
		padding: 0;
	}
	#popup-dec .dec-form-title {
		margin-bottom: 16px;
		font-size: 43px;
		line-height: 50px;
	}
	/* the game step's trees and mountains are both anchored to the panel's own real bottom edge (bottom: 0, below),
	   so unlike .popup-default/.popup-thanks it needs no flex centring to keep them together on a tall phone */
	#popup-dec .popup-game {
		container-type: inline-size;
	}
	#popup-dec .dec-game-title {
		margin-top: 61px;
		font-size: 49.74px;
		line-height: 59.7px;
	}
	/* game, phones (3-Pop up game-Mobile 1:13749: tree 1/1:14570 at 90,224 — the back tree, standing higher — tree
	   2/1:14571 and tree 3/1:14572 at -23,349 and 206,349 in front, each 221x309, each bleeding past the panel's edge
	   by design; 4-Pop up game-Mobile 1:14574 is the reveal Figma draws for a tap: tree 1 gone, the yeti (Frame 2
	   1:16123, 197x201 at 103,262 — 13,38 of its own 221x309 box) in its place, trees 2/1:16487 and 3/1:16488
	   unchanged). Fixed: the yeti is behind every tree, same as desktop — every number here is the frames' own, in cqw
	   of the panel so it keeps clear of the edges at any width instead of the fixed px + per-tree margin stack an
	   earlier build used (which is what let the trees run past the screen's edges on a phone narrower or wider than
	   the 390 frame).
	   Revision (dev request): .dec-trees is absolute, pinned to .popup-game's own bottom edge the same way
	   .dec-mountains-game is above (not normal flow pushed down from the title), so the trio stands on the snowbank at
	   the panel's true bottom on every phone, tall or short, instead of wherever flow happened to leave it — checked
	   at 375x667 and 390x844. */
	/* revision (dev request, measured against Figma at 390x692): the trio was measured off "Form BG"'s own local
	   origin (x=-7,y=-4 of the 390 frame — the same 7px side bleed the panel bg carries), not the frame itself, which
	   put all three trees 7px too far right; and the front two stood flush with the panel's real bottom (`bottom: 0`)
	   while Figma stands them 38px above it (trees 2/3 at y=345, 309 tall, bottom 654, 38px shy of the 692 frame).
	   Both are fixed from the frame's own numbers, in cqw of the panel so they keep clear of the edges at any width:
	   tree 1 at 83,220, trees 2/3 at -30,345 and 199,345, each 221x309 (83/390=21.282cqw, -30/390=-7.692cqw,
	   199/390=51.026cqw, 38/390=9.744cqw). */
	#popup-dec .dec-trees {
		position: absolute;
		left: 0;
		bottom: 9.744cqw;
		width: 100%;
		height: 111.282cqw;
	}
	/* tree 1 (the back one) sits partly behind trees 2/3, which paint over it in source order per the frame's own
	   stacking — only its clear crown (above where the front two begin, 32.051cqw of its own top) is left clickable;
	   the full picture still paints at its usual box, pinned to the button's own (unmoved) top-left corner */
	#popup-dec .dec-tree[data-pick="1"] {
		left: 21.282cqw;
		top: 0;
		width: 56.678cqw;
		height: 32.051cqw;
		overflow: visible;
	}
	#popup-dec .dec-tree[data-pick="2"] {
		left: -7.692cqw;
		top: 32.051cqw;
		width: 56.678cqw;
		height: 79.231cqw;
	}
	#popup-dec .dec-tree[data-pick="3"] {
		left: 51.026cqw;
		top: 32.051cqw;
		width: 56.678cqw;
		height: 79.231cqw;
	}
	#popup-dec .dec-tree[data-pick="1"] .dec-tree-img {
		position: absolute;
		top: 0;
		left: 0;
		width: 56.678cqw;
		height: 79.231cqw;
	}
	#popup-dec .dec-jump {
		left: 3.333cqw;
		top: 9.744cqw;
		width: 50.513cqw;
		height: 51.538cqw;
	}
	/* success, phones (1:16490): title 3:20175 (41px), the gift card 30px under it (art at 21,172), the check line 1:18358
	   (26px) 10px into the card's shadow, Keep Shopping 25px below.
	   Revision (dev request, intentionally off the design's fixed-height frame): `.popup-thanks` above now centres
	   this block itself (flex column, `justify-content: center`, padded for the mountains), so no fixed top/bottom
	   padding is needed here. */
	#popup-dec .dec-thanks {
		margin: 0;
		padding: 0;
	}
	#popup-dec .dec-found {
		width: 390px;
		font-size: 41px;
		line-height: 50px;
	}
	#popup-dec .dec-gift {
		margin-top: 30px;
		margin-left: 5px;
	}
	#popup-dec .dec-check {
		margin-top: -10px;
		font-size: 26px;
		line-height: 28.6px;
		letter-spacing: 0.26px;
	}
	#popup-dec .dec-keep {
		margin-top: 25px !important;
	}
	/* the thumbs-up yeti (1:17934) at 225,488 (186x210), cut by the frame's right edge; its feet tied to the panel's
	   bottom edge with the mountains (the image ends 6px below it) */
	#popup-dec .dec-layer-m {
		display: block;
	}
	#popup-dec .dec-layer-d {
		display: none;
	}
	#popup-dec .dec-thanks-yeti {
		position: static;
		width: auto;
		height: auto;
		overflow: visible;
	}
	#popup-dec .dec-thanks-yeti img {
		top: auto;
		left: 57.692vw;
		bottom: -1.538vw;
		width: 47.692vw;
		z-index: 1;
		clip-path: none;
	}
	/* the yeti hangs 6px below the frame's panel (1:17934): open only the panel's bottom edge */
	#popup-dec .popup-content {
		overflow: visible;
		clip-path: inset(0 0 -6px 0);
	}
}
