/**
 * Paramount Verification Gate — frontend styles.
 *
 * All rules are anchored on the #pvg-overlay id so they win against the Uncode
 * theme's own selectors without needing !important everywhere. !important is
 * reserved for the handful of rules a theme or optimisation plugin could
 * plausibly override in a way that would break the gate.
 */

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

#pvg-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2147483001;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 40px);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	touch-action: none;

	/*
	 * The overlay conceals the page itself rather than relying on the critical
	 * anti-flash layer, so the gate is correct regardless of how the theme
	 * stacks its own elements.
	 */
	background: var( --pvg-overlay-bg-fallback, rgba( 15, 23, 32, 0.92 ) );
	font-family: inherit;
	color: var( --pvg-text, rgb( 27, 29, 31 ) );
	line-height: 1.55;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}

@supports ( ( -webkit-backdrop-filter: blur( 1px ) ) or ( backdrop-filter: blur( 1px ) ) ) {
	#pvg-overlay {
		background: var( --pvg-overlay-bg, rgba( 15, 23, 32, 0.72 ) );
		-webkit-backdrop-filter: blur( var( --pvg-blur, 8px ) );
		backdrop-filter: blur( var( --pvg-blur, 8px ) );
	}
}

#pvg-overlay *,
#pvg-overlay *::before,
#pvg-overlay *::after {
	box-sizing: border-box;
}

/* The modal panel must remain touch-scrollable inside the locked overlay. */
#pvg-overlay .pvg-panel {
	touch-action: auto;
}

/*
 * Neutralise decorative pseudo-elements injected by the theme.
 *
 * Uncode draws its own check glyph for a checked input with an absolutely
 * positioned pseudo-element. Because the panel is a positioned ancestor it
 * becomes that glyph's containing block, so the mark appears at the top of the
 * modal instead of in the checkbox. The gate supplies no pseudo-element
 * decoration of its own inside the panel, so removing them all is safe and
 * keeps the modal looking identical on any theme.
 */
#pvg-overlay::before,
#pvg-overlay::after,
#pvg-overlay .pvg-panel::before,
#pvg-overlay .pvg-panel::after,
#pvg-overlay .pvg-panel *::before,
#pvg-overlay .pvg-panel *::after {
	content: none !important;
	display: none !important;
}

/* -------------------------------------------------------------------------
 * Panel
 * ---------------------------------------------------------------------- */

#pvg-overlay .pvg-panel {
	position: relative;
	width: 100%;
	max-width: var( --pvg-max-width, 560px );
	max-height: 100%;
	margin: auto;
	padding: clamp(20px, 5vw, 40px);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border: 1px solid rgba( 27, 29, 31, 0.08 );
	border-radius: 10px;
	box-shadow: 0 18px 50px rgba( 0, 0, 0, 0.28 );
	font-family: inherit;
	color: var( --pvg-text, rgb( 27, 29, 31 ) );
	text-align: center;
	animation: pvg-fade-in 220ms ease-out both;
}

@keyframes pvg-fade-in {
	from {
		opacity: 0;
		transform: translateY( 8px );
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* -------------------------------------------------------------------------
 * Logo
 * ---------------------------------------------------------------------- */

#pvg-overlay .pvg-logo-wrap {
	margin: 0 0 clamp(16px, 3vw, 24px);
	text-align: center;
}

#pvg-overlay img.pvg-logo {
	display: inline-block;
	width: auto;
	max-width: min( 100%, 240px );
	height: auto;
	max-height: 90px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: contain;
	vertical-align: middle;
}

/* -------------------------------------------------------------------------
 * Introduction
 * ---------------------------------------------------------------------- */

#pvg-overlay .pvg-intro {
	margin: 0 0 clamp(16px, 3vw, 24px);
	padding: 0;
	font-family: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.6;
	color: var( --pvg-text, rgb( 27, 29, 31 ) );
	text-align: center;
}

/* -------------------------------------------------------------------------
 * Checkboxes
 * ---------------------------------------------------------------------- */

#pvg-overlay .pvg-checks {
	margin: 0 0 clamp(18px, 3vw, 26px);
	text-align: left;
}

#pvg-overlay .pvg-check {
	display: flex;
	align-items: flex-start;
	margin: 0 0 14px;
	padding: 0;
}

#pvg-overlay .pvg-check:last-child {
	margin-bottom: 0;
}

#pvg-overlay input.pvg-checkbox[type="checkbox"] {
	flex: 0 0 auto;
	width: 18px;
	min-width: 18px;
	height: 18px;
	margin: 2px 12px 0 0;
	padding: 0;
	opacity: 1;
	position: static;
	appearance: auto;
	-webkit-appearance: checkbox;
	-moz-appearance: checkbox;
	accent-color: var( --pvg-btn-bg, rgb( 62, 99, 175 ) );
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	pointer-events: auto;
	clip: auto;
	clip-path: none;
}

#pvg-overlay label.pvg-check-label {
	display: block;
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	color: var( --pvg-text, rgb( 27, 29, 31 ) );
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

/* -------------------------------------------------------------------------
 * Button
 * ---------------------------------------------------------------------- */

#pvg-overlay .pvg-actions {
	margin: 0 0 clamp(16px, 3vw, 22px);
	padding: 0;
	text-align: center;
}

#pvg-overlay button.pvg-button {
	display: inline-block;
	width: 100%;
	max-width: 280px;
	min-height: 46px;
	margin: 0;
	padding: 12px 28px;
	background: var( --pvg-btn-bg, rgb( 62, 99, 175 ) );
	border-style: solid;
	border-width: var( --pvg-btn-border-width, 1px );
	border-color: var( --pvg-btn-border-color, rgb( 62, 99, 175 ) );
	border-radius: var( --pvg-btn-border-radius, 7px );
	box-shadow: none;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	color: var( --pvg-btn-text, #fff );
	text-align: center;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
	-webkit-appearance: none;
	appearance: none;
}

#pvg-overlay button.pvg-button:hover:not( [disabled] ),
#pvg-overlay button.pvg-button:focus-visible:not( [disabled] ) {
	background: var( --pvg-btn-hover-bg, transparent );
	border-color: var( --pvg-btn-border-color, rgb( 62, 99, 175 ) );
	color: var( --pvg-btn-hover-text, rgb( 62, 99, 175 ) );
}

#pvg-overlay button.pvg-button[disabled],
#pvg-overlay button.pvg-button:disabled {
	background: #e6e8ec;
	border-color: #c7ccd4;
	color: #55595f;
	cursor: not-allowed;
	opacity: 1;
}

/* Keep the disabled appearance stable when hovered or focused. */
#pvg-overlay button.pvg-button[disabled]:hover,
#pvg-overlay button.pvg-button[disabled]:focus,
#pvg-overlay button.pvg-button[disabled]:focus-visible {
	background: #e6e8ec;
	border-color: #c7ccd4;
	color: #55595f;
}

/* -------------------------------------------------------------------------
 * Disclaimer and optional link
 * ---------------------------------------------------------------------- */

#pvg-overlay .pvg-disclaimer {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.55;
	color: var( --pvg-text, rgb( 27, 29, 31 ) );
	text-align: left;
}

#pvg-overlay .pvg-disclaimer-link-wrap {
	margin: 12px 0 0;
	padding: 0;
	text-align: left;
}

#pvg-overlay a.pvg-disclaimer-link {
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	color: var( --pvg-btn-bg, rgb( 62, 99, 175 ) );
	text-decoration: underline;
	background: none;
	border: 0;
	box-shadow: none;
}

#pvg-overlay a.pvg-disclaimer-link:hover,
#pvg-overlay a.pvg-disclaimer-link:focus-visible {
	text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Focus visibility
 * ---------------------------------------------------------------------- */

#pvg-overlay input.pvg-checkbox[type="checkbox"]:focus-visible,
#pvg-overlay button.pvg-button:focus-visible,
#pvg-overlay a.pvg-disclaimer-link:focus-visible {
	outline: 2px solid rgb( 62, 99, 175 );
	outline-offset: 2px;
}

/* Fallback for browsers without :focus-visible support. */
#pvg-overlay input.pvg-checkbox[type="checkbox"]:focus,
#pvg-overlay a.pvg-disclaimer-link:focus {
	outline: 2px solid rgb( 62, 99, 175 );
	outline-offset: 2px;
}

#pvg-overlay button.pvg-button:focus:not( :focus-visible ) {
	outline: none;
}

/* -------------------------------------------------------------------------
 * Screen-reader-only text
 * ---------------------------------------------------------------------- */

#pvg-overlay .pvg-sr-only,
body > .pvg-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	border: 0;
	clip: rect( 0 0 0 0 );
	clip-path: inset( 50% );
	white-space: nowrap;
}

/* -------------------------------------------------------------------------
 * Background isolation fallback for browsers without inert support
 * ---------------------------------------------------------------------- */

body > .pvg-inert-fallback {
	pointer-events: none !important;
	-webkit-user-select: none;
	user-select: none;
}

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

@media screen and ( max-width: 480px ) {
	#pvg-overlay {
		padding: 12px;
	}

	#pvg-overlay .pvg-panel {
		padding: 22px 18px;
		border-radius: 8px;
	}

	#pvg-overlay button.pvg-button {
		max-width: 100%;
	}

	#pvg-overlay img.pvg-logo {
		max-width: min( 100%, 200px );
		max-height: 72px;
	}
}

/* Short viewports: the panel scrolls internally rather than being clipped. */
@media screen and ( max-height: 620px ) {
	#pvg-overlay {
		align-items: flex-start;
	}

	#pvg-overlay .pvg-panel {
		margin: 0 auto;
		padding-top: 20px;
		padding-bottom: 20px;
	}
}

/* -------------------------------------------------------------------------
 * Reduced motion
 * ---------------------------------------------------------------------- */

@media ( prefers-reduced-motion: reduce ) {
	#pvg-overlay .pvg-panel {
		animation: none;
	}

	#pvg-overlay button.pvg-button {
		transition: none;
	}
}
