/**
 * iToolkit Capture - frontend shells (Wave 2).
 *
 * Theme-defensive: everything namespaced under .itk-cap-, aggressive
 * resets on the card so host-theme typography/box-model bleed stays
 * out, z-index high enough to clear sticky headers but below browser
 * UI. Colors come inline from the campaign design config; this file
 * owns layout, spacing, and motion only.
 */

/* ------------------------------------------------------------------
 * Root containers
 * ---------------------------------------------------------------- */

.itk-cap-root {
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}

.itk-cap-root *,
.itk-cap-root *::before,
.itk-cap-root *::after {
	box-sizing: inherit;
}

html.itk-cap-scroll-lock,
html.itk-cap-scroll-lock body {
	overflow: hidden !important;
}

/* ------------------------------------------------------------------
 * Lightbox + fullscreen (modal shells)
 * ---------------------------------------------------------------- */

.itk-cap-root--lightbox,
.itk-cap-root--fullscreen {
	position: fixed;
	inset: 0;
	z-index: 999990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.itk-cap-root--lightbox.itk-cap-visible,
.itk-cap-root--fullscreen.itk-cap-visible {
	opacity: 1;
}

.itk-cap-overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 20, 0.65);
}

.itk-cap-root--lightbox .itk-cap-card {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	border-radius: 10px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
	padding: 36px 32px 32px;
	transform: translateY(14px) scale(0.97);
	transition: transform 0.25s ease;
}

.itk-cap-root--lightbox.itk-cap-visible .itk-cap-card {
	transform: translateY(0) scale(1);
}

/* The welcome mat is edge-to-edge: no gutter, page must not peek through. */
.itk-cap-root--fullscreen {
	padding: 0;
}

.itk-cap-root--fullscreen .itk-cap-card {
	position: relative;
	width: 100%;
	height: 100%;
	border-radius: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 24px;
	overflow-y: auto;
}

.itk-cap-root--fullscreen .itk-cap-form,
.itk-cap-root--fullscreen .itk-cap-body,
.itk-cap-root--fullscreen .itk-cap-success {
	width: 100%;
	max-width: 560px;
	text-align: center;
}

/* ------------------------------------------------------------------
 * Slide-in
 * ---------------------------------------------------------------- */

.itk-cap-root--slidein {
	position: fixed;
	bottom: 20px;
	z-index: 999980;
	width: 360px;
	max-width: calc(100vw - 40px);
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.itk-cap-root--slidein.itk-cap-pos-right { right: 20px; }
.itk-cap-root--slidein.itk-cap-pos-left  { left: 20px; }

.itk-cap-root--slidein.itk-cap-visible {
	opacity: 1;
	transform: translateY(0);
}

.itk-cap-root--slidein .itk-cap-card {
	position: relative;
	border-radius: 10px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
	padding: 26px 24px 22px;
}

/* ------------------------------------------------------------------
 * Floating bar
 * ---------------------------------------------------------------- */

.itk-cap-root--bar {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 999985;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.itk-cap-root--bar.itk-cap-pos-top    { top: 0;    transform: translateY(-100%); }
.itk-cap-root--bar.itk-cap-pos-bottom { bottom: 0; transform: translateY(100%); }

.itk-cap-root--bar.itk-cap-visible {
	opacity: 1;
	transform: translateY(0);
}

.itk-cap-root--bar .itk-cap-card {
	position: relative;
	box-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
	padding: 12px 56px 12px 20px;
}

.itk-cap-root--bar .itk-cap-form,
.itk-cap-root--bar .itk-cap-body,
.itk-cap-root--bar .itk-cap-success {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 16px;
	max-width: 1100px;
	margin: 0 auto;
}

.itk-cap-root--bar .itk-cap-headline {
	font-size: 16px;
	margin: 0;
}

.itk-cap-root--bar .itk-cap-subhead,
.itk-cap-root--bar .itk-cap-text {
	font-size: 14px;
	margin: 0;
}

.itk-cap-root--bar .itk-cap-field {
	margin: 0;
}

.itk-cap-root--bar .itk-cap-input {
	width: 220px;
	padding: 8px 12px;
}

.itk-cap-root--bar .itk-cap-button-wrap {
	margin: 0;
}

.itk-cap-root--bar .itk-cap-button {
	padding: 8px 18px;
	font-size: 14px;
}

/* ------------------------------------------------------------------
 * Inline
 * ---------------------------------------------------------------- */

.itk-cap-root--inline {
	position: relative;
	margin: 24px 0;
}

.itk-cap-root--inline .itk-cap-card {
	position: relative;
	border-radius: 10px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	padding: 30px 28px;
}

/* ------------------------------------------------------------------
 * Card internals
 * ---------------------------------------------------------------- */

.itk-cap-headline {
	margin: 0 0 10px;
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.itk-cap-subhead {
	margin: 0 0 14px;
	font-size: 16px;
	opacity: 0.85;
}

.itk-cap-text {
	margin: 0 0 14px;
	font-size: 14.5px;
}

.itk-cap-image {
	margin: 0 0 16px;
}

.itk-cap-image img {
	max-width: 100%;
	height: auto;
	display: inline-block;
	border-radius: 6px;
}

.itk-cap-field {
	margin: 0 0 12px;
}

.itk-cap-input {
	width: 100%;
	padding: 11px 14px;
	font-size: 15px;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 6px;
	background: #fff;
	color: #1a1a2e;
	outline: none;
}

.itk-cap-input:focus {
	border-color: rgba(0, 0, 0, 0.45);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

.itk-cap-consent {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 14px;
	font-size: 13px;
	cursor: pointer;
}

.itk-cap-consent input {
	margin-top: 2px;
	flex: none;
}

.itk-cap-divider {
	border: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	margin: 16px 0;
}

.itk-cap-button-wrap {
	margin: 4px 0 0;
}

.itk-cap-button {
	display: inline-block;
	border: 0;
	border-radius: 6px;
	padding: 12px 26px;
	font-size: 15.5px;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.15s ease, transform 0.1s ease;
	width: 100%;
}

.itk-cap-root--bar .itk-cap-button,
.itk-cap-body .itk-cap-button {
	width: auto;
}

.itk-cap-button:hover  { filter: brightness(1.08); }
.itk-cap-button:active { transform: translateY(1px); }

.itk-cap-success {
	text-align: center;
	padding: 8px 0;
}

/* Wave 5: honeypot field - off-canvas, not display:none (some bots
 * skip display:none inputs; off-canvas catches more of them). */
.itk-cap-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

/* Wave 5: inline submit error (server message, role=alert). Fixed
 * red regardless of campaign palette - errors must read as errors. */
.itk-cap-error {
	margin: 0 0 10px;
	font-size: 13.5px;
	line-height: 1.4;
	color: #c0392b;
	font-weight: 600;
}

.itk-cap-decline {
	display: block;
	margin: 14px auto 0;
	background: none;
	border: 0;
	font-size: 13.5px;
	opacity: 0.65;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	min-height: 44px;
}

.itk-cap-decline:hover {
	opacity: 1;
}

.itk-cap-root--bar .itk-cap-decline {
	margin: 0;
	display: inline-block;
	min-height: 0;
}

/* ------------------------------------------------------------------
 * Close button
 * ---------------------------------------------------------------- */

.itk-cap-close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.07);
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

.itk-cap-close:hover {
	background: rgba(0, 0, 0, 0.16);
}

.itk-cap-root--bar .itk-cap-close {
	top: 50%;
	transform: translateY(-50%);
}

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

@media (max-width: 480px) {
	.itk-cap-root--lightbox {
		padding: 14px;
	}

	.itk-cap-root--lightbox .itk-cap-card {
		padding: 28px 20px 24px;
	}

	.itk-cap-root--slidein {
		left: 12px !important;
		right: 12px !important;
		bottom: 12px;
		width: auto;
	}

	.itk-cap-headline {
		font-size: 20px;
	}

	.itk-cap-root--bar .itk-cap-card {
		padding-right: 48px;
	}
}

/* ------------------------------------------------------------------
 * Wave 8: WP admin bar offset for the top bar
 *
 * Logged-in users with the admin bar were getting the campaign bar
 * painted OVER it (the known Wave 3 nit). WP adds body.admin-bar and
 * the bar is 32px (46px <= 782px, where it also becomes absolute and
 * scrolls away - matching core's own behavior is correct here).
 * ---------------------------------------------------------------- */

body.admin-bar .itk-cap-root--bar.itk-cap-pos-top {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .itk-cap-root--bar.itk-cap-pos-top {
		top: 46px;
		position: absolute;
	}
}

/* ------------------------------------------------------------------
 * Wave 8: unlicensed attribution badge (license soften, never disable)
 * ---------------------------------------------------------------- */

.itk-cap-badge {
	display: block;
	text-align: center;
	font-size: 11px;
	line-height: 1;
	padding: 10px 0 0;
	opacity: 0.55;
	color: inherit;
	text-decoration: none;
}

.itk-cap-badge:hover {
	opacity: 0.85;
	text-decoration: underline;
}

.itk-cap-root--bar .itk-cap-badge {
	display: inline-block;
	padding: 0 0 0 12px;
	vertical-align: middle;
}

/* ------------------------------------------------------------------
 * 0.9.0 - countdown timer block
 * ---------------------------------------------------------------- */

.itk-cap-countdown {
	display: flex;
	justify-content: center;
	gap: 18px;
	margin: 14px 0;
}

.itk-cap-cd-seg {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 48px;
}

.itk-cap-cd-num {
	font-size: 30px;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.itk-cap-cd-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.7;
}

.itk-cap-cd-expired {
	text-align: center;
	font-weight: 600;
}

.itk-cap-root--bar .itk-cap-countdown {
	display: inline-flex;
	gap: 10px;
	margin: 0 12px;
	vertical-align: middle;
}

.itk-cap-root--bar .itk-cap-cd-num {
	font-size: 18px;
}

/* ------------------------------------------------------------------
 * 0.9.0 - yes/no two-step gate
 * ---------------------------------------------------------------- */

.itk-cap-yesno {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	margin: 14px 0 4px;
}

.itk-cap-yesno .itk-cap-yes {
	width: 100%;
}

.itk-cap-yesno .itk-cap-no {
	align-self: center;
}

/* ------------------------------------------------------------------
 * 0.17.0 design depth: banner layout. The first headline becomes an
 * accent-colored band (bg + text colors are set inline from the
 * campaign's accent). Generic band on purpose - no per-type negative
 * margins, so it can never fight a card's overflow or radius.
 * ---------------------------------------------------------------- */

.itk-cap-headline.itk-cap-banner-head {
	padding: 14px 18px;
	border-radius: 8px;
	margin: 0 0 18px;
}

/* ------------------------------------------------------------------
 * 0.21.0 spin-to-win wheel. The wheel is inline SVG, so it scales
 * cleanly and needs no image requests. Only the inner group rotates;
 * the pointer and hub stay put. transform-box/origin pin the spin to
 * the wheel center. Reduced-motion users get the same landing without
 * the long animation (the JS skips the transition).
 * ---------------------------------------------------------------- */

.itk-cap-wheel {
	text-align: center;
	margin: 4px 0 6px;
}

.itk-cap-wheel-stage {
	position: relative;
	width: 300px;
	max-width: 100%;
	margin: 0 auto 16px;
}

.itk-cap-wheel-svg {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 50%;
	filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.itk-cap-wheel-rot {
	transform-box: fill-box;
	transform-origin: center;
	will-change: transform;
}

.itk-cap-wheel-pointer {
	position: absolute;
	top: -8px;
	left: 50%;
	width: 0;
	height: 0;
	transform: translateX(-50%);
	border-left: 13px solid transparent;
	border-right: 13px solid transparent;
	border-top: 20px solid #1a1a2e;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 1px #ffffff);
	z-index: 4;
}

.itk-cap-spin {
	display: inline-block;
}

.itk-cap-spin--claimed {
	animation: itk-cap-claim-pulse 1.4s ease-in-out infinite;
}

@keyframes itk-cap-claim-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.03); }
}

/* Confetti burst on win - pure DOM elements, no image requests, removed
 * from the DOM after ~1.3s by the JS. Skipped for reduced-motion users. */
.itk-cap-confetti {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	pointer-events: none;
	overflow: visible;
	z-index: 3;
}

.itk-cap-confetti-piece {
	position: absolute;
	left: 50%;
	top: 42%;
	width: 9px;
	height: 9px;
	border-radius: 2px;
	opacity: 1;
	will-change: transform, opacity;
}

.itk-cap-wheel-result {
	margin: 14px 0 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	opacity: 0;
	max-height: 0;
	overflow: hidden;
	transition: opacity 0.3s ease;
}

.itk-cap-wheel-result.itk-cap-wheel-result--show {
	opacity: 1;
	max-height: 180px;
}

.itk-cap-wheel-won {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.7;
}

.itk-cap-wheel-prize {
	display: inline-block;
	padding: 8px 22px;
	border-radius: 999px;
	color: #ffffff;
	font-size: 22px;
	font-weight: 800;
	line-height: 1.2;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	animation: itk-cap-prize-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes itk-cap-prize-pop {
	0% { transform: scale(0.6); opacity: 0; }
	60% { transform: scale(1.08); }
	100% { transform: scale(1); opacity: 1; }
}

/* Click-to-copy coupon code chip shown on a win, plus the redeem line.
 * The code value is monospace and selectable; clicking copies it. */
.itk-cap-wheel-code {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 2px 0 0;
	padding: 7px 10px 7px 12px;
	border: 1px dashed rgba(127, 127, 127, 0.55);
	border-radius: 10px;
	background: rgba(127, 127, 127, 0.10);
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.itk-cap-wheel-code-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.65;
}

.itk-cap-wheel-code-value {
	font-family: 'SF Mono', 'Cascadia Code', 'Courier New', monospace;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.itk-cap-wheel-code--copied {
	border-color: rgba(52, 199, 123, 0.8);
	background: rgba(52, 199, 123, 0.14);
}

.itk-cap-wheel-redeem {
	margin: 0;
	font-size: 13px;
	opacity: 0.75;
}

.itk-cap-wheel-timer {
	margin: 2px 0 0;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.itk-cap-wheel-timer--done {
	font-weight: 600;
	opacity: 0.7;
}

/* 0.22.0 - minted-coupon reveal. Stacks the heading, the click-to-copy
 * code chip (reused from the wheel), the body line, and an optional
 * shop-now button. Centered so it reads as a "you got it" moment. */
.itk-cap-reward {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	text-align: center;
}

.itk-cap-reward .itk-cap-wheel-code-value {
	font-size: 22px;
}

.itk-cap-reward-shop {
	margin-top: 4px;
}
