/*
 * Clarity Age Gate Design
 * Scoped to the companion class so theme and WooCommerce UI remain untouched.
 */

.cagd-age-gate.age-gate__wrapper,
.cagd-age-gate.age-gate-wrapper {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	min-height: 100vh;
	min-height: 100dvh;
	padding: max(22px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
	overflow: auto;
	overscroll-behavior: contain;
	background: var(--cagd-overlay, #020f23);
	color: var(--cagd-text, #fff);
	font-family: "Open Sans", Arial, sans-serif;
	text-align: center;
	-webkit-overflow-scrolling: touch;
}

.cagd-age-gate .age-gate__background-color,
.cagd-age-gate .age-gate-background-color {
	background:
		radial-gradient(circle at 50% 44%, rgba(var(--cagd-accent-rgb, 32, 200, 238), 0.14), transparent 34%),
		radial-gradient(circle at 16% 15%, rgba(var(--cagd-primary-rgb, 20, 120, 248), 0.12), transparent 32%),
		linear-gradient(145deg, rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.2)),
		var(--cagd-overlay, #020f23) !important;
	opacity: 1 !important;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.cagd-age-gate .age-gate__background,
.cagd-age-gate .age-gate-background {
	opacity: 0 !important;
	pointer-events: none;
}

.cagd-age-gate > .age-gate:not(.age-gate--shortcode):not(.age-gate-shortcode),
.cagd-age-gate .age-gate:not(.age-gate--shortcode):not(.age-gate-shortcode) {
	position: relative;
	z-index: 10000;
	box-sizing: border-box;
	width: min(100%, var(--cagd-width, 550px));
	max-width: var(--cagd-width, 550px);
	max-height: calc(100vh - 44px);
	max-height: calc(100dvh - max(44px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
	margin: auto;
	padding: 44px 42px 36px;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid rgba(var(--cagd-border-rgb, 166, 199, 237), 0.62);
	border-radius: var(--cagd-radius, 18px);
	background:
		radial-gradient(circle at 50% -12%, rgba(var(--cagd-primary-rgb, 20, 120, 248), 0.19), transparent 40%),
		linear-gradient(155deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.2)),
		var(--cagd-modal, #061d38);
	box-shadow:
		0 28px 80px rgba(0, 7, 18, 0.62),
		0 0 42px rgba(var(--cagd-primary-rgb, 20, 120, 248), 0.11),
		inset 0 1px 0 rgba(255, 255, 255, 0.06);
	color: var(--cagd-text, #fff);
	scrollbar-width: thin;
	scrollbar-color: rgba(var(--cagd-border-rgb, 166, 199, 237), 0.42) transparent;
	-webkit-overflow-scrolling: touch;
}

.cagd-age-gate .age-gate::-webkit-scrollbar {
	display: block;
	width: 6px;
}

.cagd-age-gate .age-gate::-webkit-scrollbar-thumb {
	border-radius: 99px;
	background: rgba(var(--cagd-border-rgb, 166, 199, 237), 0.42);
}

.cagd-age-gate .age-gate__form,
.cagd-age-gate .age-gate-form {
	display: block;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.cagd-age-gate .age-gate__fields,
.cagd-age-gate .age-gate-fields {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

.cagd-age-gate .age-gate__heading,
.cagd-age-gate .age-gate-heading {
	display: flex;
	align-items: center;
	flex-direction: column;
	width: 100%;
	position: relative;
	margin: 0 0 32px;
	text-align: center;
}

.cagd-age-gate .age-gate__heading::after,
.cagd-age-gate .age-gate-heading::after {
	display: block;
	width: 86px;
	height: 4px;
	margin: 20px auto 0;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--cagd-primary, #1478f8), var(--cagd-accent, #20c8ee));
	box-shadow: 0 0 18px rgba(var(--cagd-accent-rgb, 32, 200, 238), 0.35);
	content: "";
}

.cagd-age-gate .age-gate__heading-title--logo,
.cagd-age-gate .age-gate-heading-title-logo {
	display: block;
	align-self: center;
	width: auto !important;
	max-width: min(100%, 220px) !important;
	height: auto !important;
	max-height: 88px !important;
	margin: 0 auto !important;
	object-fit: contain;
	object-position: center;
	filter: brightness(1.08) contrast(1.08);
}

.cagd-age-gate .age-gate__heading-title,
.cagd-age-gate .age-gate-heading-title {
	margin: 0;
	color: var(--cagd-text, #fff);
	font-family: "Montserrat", Arial, sans-serif;
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.2;
}

.cagd-age-gate .age-gate__headline,
.cagd-age-gate .age-gate-headline {
	margin: 0 0 16px;
	color: var(--cagd-text, #fff);
	font-family: "Montserrat", Arial, sans-serif;
	font-size: clamp(2rem, 5vw, 2.35rem);
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.14;
}

.cagd-age-gate .age-gate__subheadline,
.cagd-age-gate .age-gate-subheadline {
	max-width: 440px;
	margin: 0 auto 30px;
	color: var(--cagd-text, #fff);
	opacity: 0.9;
	font-family: "Open Sans", Arial, sans-serif;
	font-size: 1.04rem;
	font-weight: 400;
	line-height: 1.65;
}

.cagd-age-gate .age-gate__challenge,
.cagd-age-gate .age-gate-challenge {
	display: none !important;
}

.cagd-age-gate .age-gate__buttons,
.cagd-age-gate .age-gate-buttons {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
	gap: 14px;
	width: 100%;
	margin: 0;
}

.cagd-age-gate button.age-gate__submit--no,
.cagd-age-gate button.age-gate-submit-no,
.cagd-age-gate button.age-gate__submit--yes,
.cagd-age-gate button.age-gate-submit-yes {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 56px;
	margin: 0 !important;
	padding: 13px 18px;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 11px;
	box-shadow: none;
	font-family: "Open Sans", Arial, sans-serif;
	font-size: 1rem;
	font-weight: 650;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.cagd-age-gate button.age-gate__submit--no,
.cagd-age-gate button.age-gate-submit-no {
	border: 1px solid rgba(var(--cagd-border-rgb, 166, 199, 237), 0.82);
	background: rgba(4, 22, 43, 0.45);
	color: var(--cagd-text, #fff);
}

.cagd-age-gate button.age-gate__submit--no:hover,
.cagd-age-gate button.age-gate-submit-no:hover {
	border-color: var(--cagd-border, #a6c7ed);
	background: rgba(var(--cagd-border-rgb, 166, 199, 237), 0.11);
	color: var(--cagd-text, #fff);
	transform: translateY(-1px);
}

.cagd-age-gate button.age-gate__submit--yes,
.cagd-age-gate button.age-gate-submit-yes {
	border: 1px solid rgba(255, 255, 255, 0.16);
	background:
		linear-gradient(135deg, rgba(0, 0, 0, 0.12), rgba(255, 255, 255, 0.1)),
		var(--cagd-primary, #1478f8);
	box-shadow: 0 12px 30px rgba(var(--cagd-primary-rgb, 20, 120, 248), 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
	color: #fff;
}

.cagd-age-gate button.age-gate__submit--yes:hover,
.cagd-age-gate button.age-gate-submit-yes:hover {
	border-color: rgba(255, 255, 255, 0.28);
	color: #fff;
	filter: brightness(1.08);
	transform: translateY(-1px);
}

.cagd-age-gate button.age-gate__submit--no:focus-visible,
.cagd-age-gate button.age-gate-submit-no:focus-visible,
.cagd-age-gate button.age-gate__submit--yes:focus-visible,
.cagd-age-gate button.age-gate-submit-yes:focus-visible {
	outline: 3px solid var(--cagd-accent, #20c8ee);
	outline-offset: 4px;
	box-shadow: 0 0 0 6px rgba(var(--cagd-accent-rgb, 32, 200, 238), 0.16);
}

/*
 * Age Gate keeps Exit focused while its focus trap is active. For pointer
 * users, suppress that programmatic ring even after they click empty modal
 * space. Keyboard users still receive the normal ring after pressing Tab.
 */
.cagd-focus-managed .cagd-age-gate:not(.cagd-keyboard-navigation) button.age-gate__submit--no:focus,
.cagd-focus-managed .cagd-age-gate:not(.cagd-keyboard-navigation) button.age-gate__submit--no:focus-visible,
.cagd-focus-managed .cagd-age-gate:not(.cagd-keyboard-navigation) button.age-gate-submit-no:focus,
.cagd-focus-managed .cagd-age-gate:not(.cagd-keyboard-navigation) button.age-gate-submit-no:focus-visible {
	outline: 0 !important;
	box-shadow: none !important;
}

.cagd-focus-managed .cagd-age-gate:not(.cagd-keyboard-navigation) button.age-gate__submit--yes:focus,
.cagd-focus-managed .cagd-age-gate:not(.cagd-keyboard-navigation) button.age-gate__submit--yes:focus-visible,
.cagd-focus-managed .cagd-age-gate:not(.cagd-keyboard-navigation) button.age-gate-submit-yes:focus,
.cagd-focus-managed .cagd-age-gate:not(.cagd-keyboard-navigation) button.age-gate-submit-yes:focus-visible {
	outline: 0 !important;
	box-shadow: 0 12px 30px rgba(var(--cagd-primary-rgb, 20, 120, 248), 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

.cagd-age-gate .age-gate__additional-information,
.cagd-age-gate .age-gate-additional-information {
	margin: 28px 0 0;
	padding: 0;
	color: var(--cagd-muted, #a8bfdc);
	font-family: "Open Sans", Arial, sans-serif;
	font-size: 0.88rem;
	font-weight: 400;
	line-height: 1.65;
}

.cagd-age-gate .age-gate__additional-information p,
.cagd-age-gate .age-gate-additional-information p {
	margin: 0;
}

.cagd-age-gate .age-gate__additional-information p + p,
.cagd-age-gate .age-gate-additional-information p + p {
	margin-top: 3px;
}

.cagd-age-gate .age-gate__errors,
.cagd-age-gate .age-gate-errors {
	margin: 18px 0 0;
	padding: 0;
}

.cagd-age-gate .age-gate__error,
.cagd-age-gate .age-gate-error {
	margin: 0;
	padding: 11px 13px;
	border: 1px solid rgba(255, 151, 151, 0.32);
	border-radius: 9px;
	background: rgba(139, 28, 42, 0.2);
	color: #ffd8dc;
	font-size: 0.88rem;
	line-height: 1.45;
}

@media (max-width: 600px) {
	.cagd-age-gate.age-gate__wrapper,
	.cagd-age-gate.age-gate-wrapper {
		align-items: center;
		justify-content: center;
		padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
	}

	.cagd-age-gate > .age-gate:not(.age-gate--shortcode):not(.age-gate-shortcode),
	.cagd-age-gate .age-gate:not(.age-gate--shortcode):not(.age-gate-shortcode) {
		width: 100%;
		max-width: 100%;
		max-height: calc(100vh - 32px);
		max-height: calc(100dvh - max(32px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
		padding: 32px 22px 26px;
		border-radius: min(var(--cagd-radius, 18px), 18px);
	}

	.cagd-age-gate .age-gate__heading,
	.cagd-age-gate .age-gate-heading {
		margin-bottom: 25px;
	}

	.cagd-age-gate .age-gate__heading::after,
	.cagd-age-gate .age-gate-heading::after {
		width: 72px;
		height: 3px;
		margin-top: 16px;
	}

	.cagd-age-gate .age-gate__heading-title--logo,
	.cagd-age-gate .age-gate-heading-title-logo {
		max-width: min(70vw, 190px) !important;
		max-height: 76px !important;
	}

	.cagd-age-gate .age-gate__headline,
	.cagd-age-gate .age-gate-headline {
		margin-bottom: 12px;
		font-size: clamp(1.72rem, 8.5vw, 2rem);
	}

	.cagd-age-gate .age-gate__subheadline,
	.cagd-age-gate .age-gate-subheadline {
		margin-bottom: 24px;
		font-size: 0.95rem;
		line-height: 1.58;
	}

	.cagd-age-gate .age-gate__buttons,
	.cagd-age-gate .age-gate-buttons {
		grid-template-columns: 1fr;
		gap: 11px;
	}

	.cagd-age-gate button.age-gate__submit--no,
	.cagd-age-gate button.age-gate-submit-no,
	.cagd-age-gate button.age-gate__submit--yes,
	.cagd-age-gate button.age-gate-submit-yes {
		min-height: 54px;
	}

	.cagd-age-gate .age-gate__additional-information,
	.cagd-age-gate .age-gate-additional-information {
		margin-top: 23px;
		font-size: 0.82rem;
	}
}

@media (max-height: 700px) {
	.cagd-age-gate > .age-gate:not(.age-gate--shortcode):not(.age-gate-shortcode),
	.cagd-age-gate .age-gate:not(.age-gate--shortcode):not(.age-gate-shortcode) {
		padding-top: 27px;
		padding-bottom: 24px;
	}

	.cagd-age-gate .age-gate__heading,
	.cagd-age-gate .age-gate-heading {
		margin-bottom: 21px;
	}

	.cagd-age-gate .age-gate__heading-title--logo,
	.cagd-age-gate .age-gate-heading-title-logo {
		max-height: 64px !important;
	}

	.cagd-age-gate .age-gate__heading::after,
	.cagd-age-gate .age-gate-heading::after {
		margin-top: 13px;
	}

	.cagd-age-gate .age-gate__subheadline,
	.cagd-age-gate .age-gate-subheadline {
		margin-bottom: 20px;
	}

	.cagd-age-gate .age-gate__additional-information,
	.cagd-age-gate .age-gate-additional-information {
		margin-top: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cagd-age-gate.age-gate__wrapper,
	.cagd-age-gate.age-gate-wrapper,
	.cagd-age-gate button.age-gate__submit--no,
	.cagd-age-gate button.age-gate-submit-no,
	.cagd-age-gate button.age-gate__submit--yes,
	.cagd-age-gate button.age-gate-submit-yes {
		transition-duration: 0.01ms !important;
	}
}
