/* Agewise Age Verification – gate styles. Colors come from CSS variables set inline. */

.agw-gate,
.agw-noscript {
	--agw-overlay: rgba(11, 13, 18, .85);
	--agw-card: #fff;
	--agw-text: #14161b;
	--agw-accent: #b4532a;
	--agw-accent-text: #fff;
	--agw-radius: 18px;
	--agw-line: color-mix(in srgb, var(--agw-text) 16%, transparent);
	--agw-soft: color-mix(in srgb, var(--agw-text) 5%, transparent);
	--agw-danger: #d4352b;

	position: fixed;
	inset: 0;
	z-index: 2147483000;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	font-family: var(--agw-font, inherit);
	-webkit-font-smoothing: antialiased;
	text-align: center;
	box-sizing: border-box;
}

.agw-gate.agw-is-leaving { display: flex; animation: agw-out .4s ease forwards; pointer-events: none; }
.agw-noscript { display: flex; }

.agw-gate *,
.agw-noscript * { box-sizing: border-box; }

.agw-gate [hidden] { display: none !important; }

.agw-gate .agw-backdrop,
.agw-noscript::before {
	position: fixed;
	inset: 0;
	background: var(--agw-bg, none) center / cover no-repeat;
}
.agw-gate .agw-backdrop::after,
.agw-noscript::before {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--agw-overlay);
}
.agw-noscript::before { position: fixed; }

/* ---------- card ---------- */

.agw-gate .agw-card,
.agw-noscript .agw-card {
	position: relative;
	width: 100%;
	max-width: 430px;
	margin: auto;
	padding: 40px 32px 30px;
	background: var(--agw-card);
	color: var(--agw-text);
	border-radius: var(--agw-radius);
	box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 32px 80px -24px rgba(0, 0, 0, .55), 0 8px 24px -12px rgba(0, 0, 0, .3);
	animation: agw-in .5s cubic-bezier(.2, .8, .2, 1) both;
}

.agw-gate .agw-logo {
	display: block;
	width: auto;
	height: auto;
	max-width: 170px;
	max-height: 72px;
	margin: 0 auto 22px;
}

.agw-gate .agw-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 64px;
	height: 64px;
	padding: 0 14px;
	margin: 0 auto 22px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--agw-accent) 12%, transparent);
	color: var(--agw-accent);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--agw-accent) 28%, transparent) inset;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -.02em;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.agw-gate .agw-title,
.agw-noscript .agw-title {
	margin: 0 0 10px;
	padding: 0;
	font-family: inherit;
	font-size: clamp(22px, 5vw, 27px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.015em;
	color: inherit;
	text-transform: none;
	outline: none;
}

.agw-gate .agw-desc,
.agw-noscript .agw-desc {
	margin: 0 auto 28px;
	max-width: 34ch;
	font-size: 15.5px;
	line-height: 1.55;
	color: inherit;
	opacity: .72;
}

/* ---------- buttons ---------- */

.agw-gate .agw-actions { display: grid; gap: 10px; }

.agw-gate .agw-btn {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 13px 20px;
	border: 1.5px solid transparent;
	border-radius: calc(var(--agw-radius) * .6);
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	transition: transform .12s ease, filter .15s ease, background-color .15s ease, border-color .15s ease;
}

/* Button states are locked with !important so theme rules like
   "button:hover, button:focus { background: pink }" can't leak in. */
.agw-gate .agw-btn.agw-btn--primary,
.agw-gate .agw-btn.agw-btn--primary:focus,
.agw-gate .agw-btn.agw-btn--primary:active {
	background: var(--agw-accent) !important;
	color: var(--agw-accent-text) !important;
	border-color: transparent !important;
	box-shadow: 0 8px 20px -10px var(--agw-accent);
}
.agw-gate .agw-btn.agw-btn--primary:hover {
	background: var(--agw-accent-hover, color-mix(in srgb, var(--agw-accent) 86%, #000)) !important;
	color: var(--agw-accent-hover-text, var(--agw-accent-text)) !important;
}

.agw-gate .agw-btn.agw-btn--ghost,
.agw-gate .agw-btn.agw-btn--ghost:focus,
.agw-gate .agw-btn.agw-btn--ghost:active {
	background: transparent !important;
	color: var(--agw-text) !important;
	border-color: var(--agw-line) !important;
}
.agw-gate .agw-btn.agw-btn--ghost:hover {
	background: var(--agw-soft) !important;
	color: var(--agw-text) !important;
	border-color: color-mix(in srgb, var(--agw-text) 28%, transparent) !important;
}

.agw-gate .agw-btn:active { transform: scale(.985); }

.agw-gate .agw-btn:focus-visible,
.agw-gate .agw-field input:focus-visible,
.agw-gate .agw-remember input:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--agw-accent) 55%, transparent);
	outline-offset: 2px;
}

/* ---------- date of birth ---------- */

.agw-gate .agw-dob fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }

.agw-gate .agw-dob legend {
	display: block;
	width: 100%;
	margin: 0 0 12px;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	color: inherit;
	opacity: .85;
}

.agw-gate .agw-fields { display: flex; justify-content: center; gap: 10px; }

.agw-gate .agw-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1 1 0;
	max-width: 92px;
	margin: 0;
	cursor: text;
}
.agw-gate .agw-field--y { flex-grow: 1.45; max-width: 128px; }

.agw-gate .agw-field input {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 58px;
	margin: 0;
	padding: 0 6px;
	border: 1.5px solid var(--agw-line);
	border-radius: calc(var(--agw-radius) * .5);
	background: var(--agw-soft);
	color: var(--agw-text);
	font-family: inherit;
	font-size: 22px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: .04em;
	text-align: center;
	box-shadow: none;
	transition: border-color .15s ease, background-color .15s ease;
}
.agw-gate .agw-field input::placeholder { color: var(--agw-text); opacity: .28; font-weight: 500; }
.agw-gate .agw-field input:focus { border-color: var(--agw-accent); background: transparent; outline: none; }
.agw-gate .agw-field input[aria-invalid="true"] { border-color: var(--agw-danger); }

.agw-gate .agw-field span {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .09em;
	text-transform: uppercase;
	opacity: .55;
}

.agw-gate .agw-error {
	min-height: 20px;
	margin: 12px 0 14px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--agw-danger);
}

/* ---------- extras ---------- */

.agw-gate .agw-remember {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin: 18px 0 0;
	font-size: 14px;
	cursor: pointer;
	opacity: .8;
}
.agw-gate .agw-remember input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--agw-accent);
	cursor: pointer;
}

.agw-gate .agw-footer {
	margin: 24px 0 0;
	padding-top: 18px;
	border-top: 1px solid var(--agw-line);
	font-size: 12.5px;
	line-height: 1.55;
	opacity: .62;
}
.agw-gate .agw-footer p { margin: 0 0 6px; }
.agw-gate .agw-footer p:last-child { margin-bottom: 0; }
.agw-gate .agw-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- denied state ---------- */

.agw-gate .agw-step--denied { display: none; }
html.agw-denied .agw-gate .agw-step--ask,
.agw-gate--preview.agw-show-denied .agw-step--ask { display: none; }
html.agw-denied .agw-gate .agw-step--denied,
.agw-gate--preview.agw-show-denied .agw-step--denied { display: block; animation: agw-in .4s cubic-bezier(.2, .8, .2, 1) both; }

.agw-gate .agw-denied-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin: 0 auto 20px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--agw-danger) 11%, transparent);
	color: var(--agw-danger);
}
html.agw-denied .agw-gate .agw-badge,
html.agw-denied .agw-gate .agw-logo,
.agw-gate--preview.agw-show-denied .agw-badge { display: none; }
html.agw-denied .agw-gate .agw-step--denied .agw-desc { margin-bottom: 4px; }

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

.agw-gate .agw-card.agw-shake { animation: agw-shake .42s cubic-bezier(.36, .07, .19, .97) both; }

@keyframes agw-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes agw-out { to { opacity: 0; } }
@keyframes agw-shake {
	10%, 90% { transform: translateX(-1px); }
	20%, 80% { transform: translateX(3px); }
	30%, 50%, 70% { transform: translateX(-6px); }
	40%, 60% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
	.agw-gate .agw-card,
	.agw-gate.agw-is-leaving,
	.agw-gate .agw-card.agw-shake,
	.agw-gate .agw-step--denied { animation: none !important; }
	.agw-gate .agw-btn { transition: none; }
}

@media (max-width: 480px) {
	.agw-gate .agw-card { padding: 32px 22px 24px; }
	.agw-gate .agw-field input { height: 54px; font-size: 20px; }
}

/* ---------- admin live preview ---------- */

.agw-gate.agw-gate--preview {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	isolation: isolate;
}
.agw-gate--preview .agw-backdrop { position: absolute; z-index: -1; }
