/**
 * Wolf Gate Capture
 *
 * The Wolf theme already styles .gate, .gate__box, .gate__check, .btn,
 * .eyebrow, .muted and the form controls. This file inherits all of that and
 * adds only what is new: the offer block, the code panel, the skip link and
 * the honeypot. Every colour is taken from the theme's own variables, with a
 * light fallback matching the Wolf palette so the gate still looks right if
 * the theme is ever switched off.
 */

/* --- Overlay --------------------------------------------------------- */

#wgcGate {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: none;
	place-items: center;
	padding: 20px;
	background: rgba(11, 42, 91, .72);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

/* .is-on is the theme's own class; .is-open keeps this working without it. */
#wgcGate.is-on,
#wgcGate.is-open {
	display: grid;
}

html.wgc-locked,
body.wgc-locked {
	overflow: hidden;
}

#wgcGate .wgc__box {
	width: 100%;
	max-width: 500px;
	max-height: 92vh;
	padding: 26px 28px 24px;
	overflow: auto;
	text-align: center;
	background: #fff;
	border-radius: 20px;
	box-shadow: var(--shadow-lg, 0 24px 60px rgba(11, 42, 91, .16));
	color: var(--ink, #152238);
}

/*
 * The gate carries two attestations, an offer and three buttons, so it is
 * taller than the theme's plain gate. These pull the vertical rhythm in so
 * the submit button stays in view without scrolling inside the card.
 */

#wgcGate .wgc__box > div > svg,
#wgcGate .wgc__box .wrp-mark {
	width: 46px;
	height: 46px;
	margin: 0 auto 10px;
}

#wgcGate .eyebrow {
	margin: 0 0 4px;
	font-size: .66rem;
}

#wgcGate h2 {
	margin: 0 0 6px;
	font-size: 1.55rem;
	line-height: 1.15;
}

#wgcGate .muted {
	margin: 0 0 14px;
	font-size: .86rem;
	line-height: 1.45;
}

#wgcGate .gate__check {
	margin-bottom: 9px;
	padding: 11px 13px;
}

#wgcGate .gate__check span {
	font-size: .81rem;
	line-height: 1.4;
}

#wgcGate small {
	margin-top: 12px;
	font-size: .68rem;
	line-height: 1.45;
}

#wgcGate .btn {
	padding: 13px 24px;
	font-size: .9rem;
}

/* --- The offer block -------------------------------------------------- */

#wgcGate .wgc__offer {
	margin: 14px 0;
	padding: 13px 14px 12px;
	border-radius: 12px;
	text-align: left;
	background: var(--surface, #f4f8fd);
	border: 1px dashed var(--blue, #1b4fd8);
}

#wgcGate .wgc__offer-head {
	display: flex;
	gap: 10px;
	align-items: center;
	margin: 0 0 4px;
	font-size: .98rem;
	color: var(--ink, #152238);
}

#wgcGate .wgc__badge {
	flex: 0 0 auto;
	padding: 4px 9px;
	border-radius: 7px;
	font-size: .82rem;
	font-weight: 800;
	color: #fff;
	background: var(--blue, #1b4fd8);
}

#wgcGate .wgc__offer-sub {
	margin: 0 0 11px;
	font-size: .78rem;
	line-height: 1.4;
	color: var(--slate, #5b6b82);
}

#wgcGate .wgc__field {
	margin-bottom: 9px;
}

#wgcGate .wgc__field label {
	display: block;
	margin-bottom: 5px;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--slate, #5b6b82);
}

/* The theme styles the controls themselves - this only makes them fill the
   block and flags an invalid address. */
#wgcGate .wgc__field input,
#wgcGate .wgc__field select {
	width: 100%;
	box-sizing: border-box;
}

#wgcGate .wgc__field input.has-error {
	border-color: var(--flag, #c63a28);
}

#wgcGate .wgc__err {
	margin: 5px 0 0;
	font-size: .76rem;
	color: var(--flag, #c63a28);
}

#wgcGate .wgc__optin {
	margin-bottom: 10px;
	background: #fff;
	border-style: dashed;
}

#wgcGate .wgc__optin span {
	font-size: .8rem;
}

#wgcGate .wgc__legal {
	margin: 0;
	font-size: .74rem;
	line-height: 1.5;
	color: var(--slate, #5b6b82);
}

#wgcGate .wgc__note {
	margin: 0 0 12px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: .84rem;
	text-align: left;
	color: var(--flag, #c63a28);
	background: rgba(198, 58, 40, .07);
	border: 1px solid rgba(198, 58, 40, .3);
}

/* --- Buttons ---------------------------------------------------------- */

#wgcGate .wgc__skip {
	display: block;
	width: 100%;
	margin: 10px 0 0;
	padding: 6px;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: .8rem;
	color: var(--slate, #5b6b82);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

#wgcGate .wgc__skip:hover {
	color: var(--blue, #1b4fd8);
}

/* --- The honeypot. Off-screen for people, reachable by bots. ----------- */

#wgcGate .wgc__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none;
}

/* --- The code panel --------------------------------------------------- */

#wgcGate .wgc__tick {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: var(--surface, #f4f8fd);
	border: 1px solid var(--blue, #1b4fd8);
}

#wgcGate .wgc__tick svg {
	width: 26px;
	height: 26px;
	fill: none;
	stroke: var(--blue, #1b4fd8);
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

#wgcGate .wgc__code {
	display: block;
	width: 100%;
	margin: 4px 0 10px;
	padding: 16px 12px;
	border-radius: 12px;
	font-family: var(--mono, ui-monospace, Menlo, Consolas, monospace);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: .09em;
	color: var(--blue, #1b4fd8);
	background: var(--surface, #f4f8fd);
	border: 1px dashed var(--blue, #1b4fd8);
	cursor: pointer;
}

#wgcGate .wgc__code:hover {
	border-style: solid;
}

#wgcGate .wgc__code.is-copied::after {
	content: attr(data-copied);
	display: block;
	margin-top: 6px;
	font-family: var(--body, inherit);
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--assay, #0b7355);
}

#wgcGate .wgc__code + .wgc__legal {
	margin-bottom: 16px;
}

/* --- Standalone fallbacks --------------------------------------------- *
 * Wrapped in :where() so they carry zero specificity. The Wolf theme's own
 * .btn, .gate__check, .eyebrow and control rules therefore always win when
 * the theme is present, and these only take effect if it is not - which is
 * what keeps the gate usable if the theme is ever switched off mid-sale.  */

:where(#wgcGate) :where(.gate__check) {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin-bottom: 12px;
	padding: 14px;
	text-align: left;
	background: var(--surface, #f4f8fd);
	border: 1px solid var(--line, #d5e0ee);
	border-radius: 10px;
	cursor: pointer;
}

:where(#wgcGate) :where(.gate__check) :where(input) {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-top: 3px;
	accent-color: var(--blue, #1b4fd8);
	cursor: pointer;
}

:where(#wgcGate) :where(.gate__check span) {
	font-size: .88rem;
	color: var(--slate, #5b6b82);
}

:where(#wgcGate) :where(.eyebrow) {
	margin: 0 0 .7em;
	font-size: .74rem;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--blue, #1b4fd8);
}

:where(#wgcGate) :where(.muted) {
	color: var(--slate, #5b6b82);
}

:where(#wgcGate) :where(small) {
	display: block;
	margin-top: 16px;
	font-size: .76rem;
	color: var(--slate, #5b6b82);
}

:where(#wgcGate) :where(input, select) {
	font: inherit;
	font-size: .92rem;
	padding: 11px 13px;
	color: var(--ink, #152238);
	background: #fff;
	border: 1px solid var(--line, #d5e0ee);
	border-radius: var(--radius-sm, 8px);
}

:where(#wgcGate) :where(.btn) {
	display: inline-flex;
	gap: .5em;
	align-items: center;
	justify-content: center;
	padding: 14px 26px;
	font-weight: 700;
	font-size: .94rem;
	color: #fff;
	background: var(--blue, #1b4fd8);
	border: 2px solid transparent;
	border-radius: 999px;
	cursor: pointer;
}

:where(#wgcGate) :where(.btn--ghost) {
	color: var(--blue, #1b4fd8);
	background: transparent;
	border-color: var(--line, #d5e0ee);
}

:where(#wgcGate) :where(.btn--block) {
	display: flex;
	width: 100%;
}

/* This one is NOT a fallback - a disabled button has to read as disabled
   whatever the theme does, and the theme only styles [disabled]. */
#wgcGate .btn:disabled {
	opacity: .5;
	pointer-events: none;
}

/* --- Small screens ----------------------------------------------------- */

@media (max-width: 480px) {
	#wgcGate {
		padding: 12px;
	}

	#wgcGate .wgc__box {
		padding: 24px 18px 20px;
		max-height: 94vh;
	}

	#wgcGate .wgc__code {
		font-size: 1.25rem;
		letter-spacing: .06em;
	}
}

/* --- Short screens ------------------------------------------------------ *
 * Older phones and laptops in landscape. Trims the decorative height so the
 * submit button stays reachable without scrolling inside the card.         */

@media (max-height: 720px) {
	#wgcGate .wgc__box > div > svg,
	#wgcGate .wgc__box .wrp-mark {
		width: 36px;
		height: 36px;
		margin-bottom: 6px;
	}

	#wgcGate h2 {
		font-size: 1.3rem;
	}

	#wgcGate .muted {
		margin-bottom: 10px;
		font-size: .8rem;
	}

	#wgcGate .gate__check {
		margin-bottom: 7px;
		padding: 9px 11px;
	}

	#wgcGate .wgc__offer {
		margin: 11px 0;
		padding: 11px 12px 10px;
	}

	#wgcGate .wgc__field {
		margin-bottom: 7px;
	}

	#wgcGate .btn {
		padding: 11px 22px;
	}
}

/*
 * Deliberately no prefers-color-scheme block. The Wolf site has one palette,
 * and an OS-level override here would redefine the theme's own variables and
 * hand a mismatched gate to anyone whose system is set the other way.
 */

@media (prefers-reduced-motion: reduce) {
	#wgcGate * {
		transition: none !important;
	}
}
