/* 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 here -
   correct at this fixed 600px desktop height, but overridden on phones (below, round 3) where the panel is the full
   screen's height and the art is shorter than that: there they anchor from the top of the design's own 692px sky instead. */
#popup-dec .popup-default,
#popup-dec .popup-game,
#popup-dec .popup-thanks {
	position: relative;
	overflow: hidden;
}
#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;
}
/* dev-reported (Wen): had to click a field several times before the cursor/caret appeared. template-form's
   floating label is `position: absolute` over the input with an `events-none` class meant to keep it out of the
   way of clicks (`resources/partials/template-form.blade.php`), but this theme's utility.css never defines that
   class - sep/oct/nov's own promo CSS already had to add it for the same reason. Without it the label (not
   `pointer-events: none`) is what a click or tap actually lands on; a `<label for>` does forward focus to its
   input, but only when the click is read as landing on the label as a whole rather than passing through, so the
   first tap could register as "nothing happened yet" before a second one went through. Explicit here so every
   field in this popup takes the tap on its own, first time. */
#popup-dec label.events-none {
	pointer-events: none;
}
#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 3:1550): the title, then three trees in a row (221x309, 13px overlap, top 254).
   The picked tree's yeti (4:2392, 215x219 at +4,+53 of its tree) jumps out, then the prize shows. */
#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 {
	display: flex;
	justify-content: center;
	width: 100%;
	margin-top: 54.5px;
}
#popup-dec .dec-tree {
	flex: 0 0 221px;
	width: 221px;
	height: 309px;
	padding: 0;
	background: transparent;
	cursor: pointer;
	transition: transform 0.2s ease;
}
#popup-dec .dec-tree + .dec-tree {
	margin-left: -13.3px;
}
#popup-dec .dec-tree:hover:not(:disabled),
#popup-dec .dec-tree:focus-visible {
	transform: translateY(-6px);
}
#popup-dec .dec-tree-img {
	width: 100%;
	height: 100%;
	transition: opacity 0.25s ease;
}
#popup-dec .dec-jump {
	position: absolute;
	left: 0;
	top: 49px;
	width: 224px;
	height: 227px;
	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 4:4409): title g1, then g2 (offer, check email, Keep Shopping, gaps 19/19). */
#popup-dec .popup-thanks {
	justify-content: flex-start;
	padding-top: 0;
}
#popup-dec .tracking_promo_success {
	position: absolute;
}
/* 4:5231's glyphs at 71.6, as the form's title: 8px lower, the offer's gap 8px less (g2 stays put) */
#popup-dec .dec-thanks {
	padding-top: 71.6px;
}
#popup-dec .dec-found {
	width: fit-content;
	font-size: 55px;
	line-height: 50px;
	font-weight: 400;
	text-align: center;
}
#popup-dec .thanks {
	width: fit-content;
}
#popup-dec .dec-offer {
	margin-top: 46px;
}
/* 4:5675 at its Figma top, 331 (it was 2.7px high); the CTA's gap 3px less, so it stays at 382 */
#popup-dec .dec-check {
	margin-top: 22px;
}
#popup-dec .dec-keep {
	margin-top: 16px !important;
}
#popup-dec .dec-offer {
	width: fit-content;
	font-size: 53.07px;
	line-height: 51.48px;
	text-align: center;
	white-space: nowrap;
}
#popup-dec .dec-sac {
	display: block;
	color: #009546;
	font-size: 34.07px;
	line-height: 42.75px;
	vertical-align: top;
}
/* 27.2px: the site's Avenir Medium sets the line wider than Figma draws it in 370 (verify round 3 measured 375.1 at
   27.6px on the preview): 27.6 x 370/375.1, within the drawn-size limit of the 28px style */
#popup-dec .dec-check {
	margin-top: 22px;
	font-size: 27.2px;
	line-height: 30.8px;
	letter-spacing: 0.28px;
	text-align: center;
}
#popup-dec .dec-keep {
	width: 235px;
	height: 45px;
	margin: 0 auto;
	padding: 0;
	border-radius: 54px;
	background: #eb0f10;
	color: #ffffff;
	font-size: 20px;
	letter-spacing: 0;
	line-height: 1;
}
/* the thumbs-up yeti (Frame 5 4:5250, in Layer_1): stands on the snow at 17.3,378 (205.7x232.7; the image has a 4px pad),
   in front of the mountains, cut by the panel's bottom edge 10.7px above its feet as Form BG clips it */
#popup-dec .dec-thanks-yeti {
	position: absolute;
	left: 17.3px;
	bottom: 0;
	width: 205.7px;
	height: 222px;
	overflow: hidden;
	z-index: 0;
	pointer-events: none;
}
#popup-dec .dec-thanks-yeti img {
	position: absolute;
	left: -4px;
	top: -4px;
	width: 214px;
	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.
   Dev-reported mobile bugs (not Figma mismatches), worked out the same way on wowie/20261119T0735-affordable-rto-
   promo-t6695375 (a flip of this same build) and applied here with that fix: `100%` is the layout viewport, which
   on a phone leaves out the browser chrome height, so `--popup-height`/`--popup-max-height` use `dvh` (the real
   visible viewport) instead. A fixed `--form-width: 350px` overflowed and scrolled the popup sideways on any phone
   narrower than 390 (375, 360, 320); it is the frame's own margins (20px each side) instead, so it always fits. */
@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: calc(100% - 40px);
		--form-width-mobile: calc(100% - 40px);
		--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;
	}
	/* round 2 (verify): popup-back-m.png is the sky at its own design size (390x692, the frame's 905 less the
	   213px left open above the mountains on a tall phone); "background-size: cover" scaled it up by height/692 to
	   fill the full-screen 100%-tall panel, which on an 844px-tall phone zooms it ~22% and crops the sides
	   (the elements check measured this node "visible 844px tall, Figma 692" - stretched, not just tall).
	   "100% auto" keeps it at its own width and true height, pinned to the top; the panel's own background-color
	   (#073767, same navy as the art's own base) fills whatever the sky doesn't reach above the mountains, exactly
	   as the Figma frame itself leaves that stretch of panel open. */
	#popup-dec .dec-panel-bg {
		background-size: 100% auto;
		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);
	}
	/* dev-reported: the 390x905 frame's "Form BG" band is only 692px tall, so a phone taller than that left spare
	   height below the form/success content under the fixed top offsets this build used to chase that 692px mark
	   (correct for one device height only). .popup-default/.popup-thanks already centre their one content child by
	   default (the popup component's own markup classes, `flex items-center justify-center` / `flex flex-column
	   items-center justify-center`) - restored here instead of fought with a margin/padding anchor, with a
	   padding-bottom reserving the mountains' own height so the centred content lands in the space above them, not
	   behind them. This reads differently from the Figma frame on a phone taller than 692px - don't revert it to
	   chase the frame, and ignore verify-surface element-position failures it causes on the form/success steps'
	   content position. The game step is unaffected: its own mountains and trees already anchor from `bottom: 0`
	   and already measure right.
	   Revision (dev request, worked out the same way on wowie/20261119T0735-affordable-rto-promo-t6695375's
	   b0efc3e): `vh`, not `vw` - this reserves space in the panel's own HEIGHT (`--popup-height` is `100dvh` here),
	   not its width, so the padding has to scale with the device's height, not its width. On a tall, narrow phone
	   `vw` gave a padding far bigger than the mountains' own height, pushing the form/success content up past the
	   top of the panel (and, on the success step, up into the mountains art behind the offer). */
	#popup-dec .popup-default,
	#popup-dec .popup-thanks {
		flex-direction: column;
		justify-content: center;
		padding-bottom: 4.7vh;
	}
	#popup-dec .popup-form {
		margin: 0;
		padding: 0;
	}
	#popup-dec .dec-form-title {
		margin-bottom: 16px;
		font-size: 43px;
		line-height: 50px;
	}
	#popup-dec .dec-game-title {
		margin-top: 61px;
		font-size: 49.74px;
		line-height: 59.7px;
	}
	/* game, phones (83.5,220), two in front (-30,345) and (199,345), each 221x309. Dev-reported: this row was in
	   normal flow, fixed to a 390px-wide box (`width: 390px`) with px margins - on any phone narrower than 390
	   (375, 360, 320) the fixed-width row overflowed and scrolled the popup sideways, and its flow height (pushed
	   down by the title above) could run past a short phone's dvh panel before the title even finished, leaving
	   the trees off-screen. Absolute now, in vw of the full-bleed popup and pinned to .popup-game's own bottom
	   edge (its "relative" box) the same way .dec-mountains is already pinned with bottom:0: the trio scales with
	   the real device width and always stands on the snow bank at the panel's true bottom, tall phone or short.
	   Trees 2 and 3 still bleed 30px (7.692vw) past the frame's sides, same as the design; .popup-content's own
	   edges crop it there, same as it already does for the success yeti below. */
	#popup-dec .dec-trees {
		position: absolute;
		left: 0;
		bottom: 0;
		width: 100%;
		height: 167.692vw;
	}
	#popup-dec .dec-tree {
		position: absolute;
		width: 56.667vw;
		height: 79.231vw;
	}
	/* the desktop row's `.dec-tree + .dec-tree { margin-left: -13.3px }` overlap isn't scoped to that layout, so it
	   still applied here on top of the absolute `left` below (a mobile leak: margin still shifts an absolutely
	   positioned box) and pulled tree 3 13.3px further over tree 1's crown than the frame draws it. Reset here;
	   the absolute `left` values already carry the frame's own overlap. */
	#popup-dec .dec-tree + .dec-tree {
		margin-left: 0;
	}
	#popup-dec .dec-tree[data-pick="1"] {
		left: 21.410vw;
		top: 56.410vw;
	}
	#popup-dec .dec-tree[data-pick="2"] {
		left: -7.692vw;
		top: 88.462vw;
	}
	#popup-dec .dec-tree[data-pick="3"] {
		left: 51.026vw;
		top: 88.462vw;
	}
	/* tree 1 sits behind trees 2 and 3 (its full 79.231vw-tall button reaches into their 88.462vw top, per Figma's
	   own stacking), so its hit box still covered the ground where they paint on top of it. A visitor's tap there
	   hit tree 3's rectangular button (the topmost element at that point, even where its art is transparent), so
	   the game could never advance past "Choose a tree" by tapping tree 1 on a phone. Trees 2 and 3 never overlap
	   each other, so only tree 1 needs this: its button now covers just the crown no one paints over (less than
	   the 32.052vw clear above 88.462vw), while the picture keeps painting at the full 56.667 x 79.231vw it always
	   had, pinned to the button's own top-left corner - so nothing in the art changes, only what is clickable
	   where it was already hidden behind the other two trees. */
	#popup-dec .dec-tree[data-pick="1"] {
		height: 28vw;
		overflow: visible;
	}
	#popup-dec .dec-tree[data-pick="1"] .dec-tree-img {
		position: absolute;
		top: 0;
		left: 0;
		width: 56.667vw;
		height: 79.231vw;
	}
	#popup-dec .dec-jump {
		left: 2.256vw;
		top: 8.795vw;
		width: 52.564vw;
		height: 53.333vw;
	}
	/* Dev-reported, round 2: the game step's own ground (3-Pop up game 3:1552 / 45:4681's "Frame", stacked 3x in
	   the design - 45:4682/45:4756/45:4830) is a much taller, closer snow bank than the thin mountains(-m) ridge
	   the form and thank-you steps share - this screen shows the mountain's full snow-covered body, not just its
	   distant peak. Reusing the shared ridge crop here was the original bug (a dark sliver showed through the gap
	   between trees 2 and 3 on phones, where the ridge's own peaks and valleys don't match this screen's close,
	   solid snow); painting over it with a flat colour (round 1) hid the sliver but wasn't the actual art.
	   Exported at this step's own render box instead (figma-export.mjs, frame 45:4679, nodes 45:4682/45:4756/
	   45:4830: the ground's 3 identical layers composited together, 398x337 canvas incl. 4px pad), bottom-aligned
	   with the panel the same way the shared rule above pins the ridge.
	   Revision (dev request, ported the same way wowie/20261119T0735-affordable-rto-promo-t6695375's fef3b3a did
	   it for Affordable's own game-step snowbank): a dedicated `.dec-mountains-game` class on the game step's own
	   markup, not a `.popup-game .dec-mountains` override - so it reads as its own named art rather than a
	   contextual override of the shared ridge - and the export renamed to `mountains-game-m` to match. Same
	   Growby pixels (45:4682/45:4756/45:4830 from its own Figma mobile game frame), same crop, just its own name. */
	#popup-dec .dec-mountains-game {
		aspect-ratio: 398 / 337;
		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);
	}
	/* success, phones: title 45:10808, g2 (offer 45:10809, check 45:2760, Keep Shopping 45:2335; gaps 22/25).
	   .popup-thanks 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 - that number only ever held on a phone
	   exactly as tall as the 692px frame. */
	#popup-dec .dec-thanks {
		margin: 0;
		padding: 0;
	}
	#popup-dec .dec-found {
		font-size: 42.42px;
		line-height: 38.56px;
	}
	#popup-dec .dec-offer {
		margin-top: 28px;
	}
	#popup-dec .dec-offer {
		font-size: 36.98px;
		line-height: 41.79px;
	}
	#popup-dec .dec-sac {
		font-size: 32px;
		line-height: 36.16px;
	}
	#popup-dec .dec-check {
		margin-top: 22px;
		font-size: 26px;
		line-height: 28.6px;
		letter-spacing: 0.26px;
	}
	#popup-dec .dec-keep {
		margin-top: 25px !important;
	}
	/* the thumbs-up yeti (45:2336) stands on the snow at 226,489 (design box 184x208; the exported art is cut at
	   172x216 by the frame's right edge, promo.json.edgeExempt), 5px past the sky's own bottom edge (panelClip
	   "bottom-open", opened at .popup-content below). Anchored off .popup-thanks's own bottom edge (its nearest
	   positioned ancestor, now the real dvh panel, not the design's 692-tall band) with the same bottom:0 the
	   mountains use, instead of a vw offset from the top measured against one device height: the yeti stays
	   standing on them at every device height instead of drifting away from the content above. */
	#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 {
		bottom: -5px;
		left: 56.923vw;
		top: auto;
		width: 44.103vw;
		z-index: 1;
		clip-path: none;
	}
	/* the yeti hangs 5px below the frame's panel (45:2336): open only the panel's bottom edge */
	#popup-dec .popup-content {
		clip-path: inset(0 0 -5px 0);
	}
}
