/**
 * Age Gate — Common base CSS (loads for every style).
 *
 * Shared mechanics only: the fixed overlay, panel container, logo, text, verify
 * controls (buttons / date inputs / checkbox), error + decline screens, the
 * passed/edit states and scroll lock. Each style file paints the visual skin.
 *
 * The overlay is visible by default so content stays protected even before JS
 * runs; JS adds `is-passed` to remove it once the visitor is verified, and
 * `is-preview` inside the Elementor editor so the gate is contained and editable.
 *
 * @package captain-widgets-kit
 * @since   1.6.0
 */

.captwiki-age-gate {
	--captwiki-age-accent: #6366f1;
	box-sizing: border-box;
}

.captwiki-age-gate *,
.captwiki-age-gate *::before,
.captwiki-age-gate *::after {
	box-sizing: border-box;
}

/* Fully verified — remove the gate entirely. */
.captwiki-age-gate.is-passed {
	display: none;
}

/* ── Overlay ───────────────────────────────────────────── */
.captwiki-age-gate__overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba( 12, 14, 24, 0.9 );
	overflow-y: auto;
}

/* ── Panel ─────────────────────────────────────────────── */
.captwiki-age-gate__panel {
	position: relative;
	width: 100%;
	max-width: 460px;
	background: #ffffff;
	border-radius: 18px;
	box-shadow: 0 40px 90px -30px rgba( 0, 0, 0, 0.6 );
	overflow: hidden;
	animation: captwiki-age-pop 0.32s ease;
}

.captwiki-age-gate__media {
	text-align: center;
}

.captwiki-age-gate__logo {
	display: inline-block;
	width: 120px;
	height: auto;
	margin: 28px auto 0;
}

/* ── Body ──────────────────────────────────────────────── */
.captwiki-age-gate__body {
	padding: 32px;
	text-align: center;
}

.captwiki-age-gate__title {
	margin: 0 0 12px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	color: #111827;
}

.captwiki-age-gate__desc {
	margin: 0 0 24px;
	font-size: 15px;
	line-height: 1.6;
	color: #6b7280;
}

/* ── Buttons ───────────────────────────────────────────── */
.captwiki-age-gate__buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 8px;
}

.captwiki-age-gate__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 130px;
	margin: 0;
	padding: 13px 26px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: #ffffff;
	background: var( --captwiki-age-accent );
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: color 0.22s ease, background-color 0.22s ease, transform 0.12s ease, box-shadow 0.22s ease;
	-webkit-appearance: none;
	appearance: none;
}

.captwiki-age-gate__btn:hover {
	box-shadow: 0 10px 22px -10px rgba( 99, 102, 241, 0.7 );
}

.captwiki-age-gate__btn:active {
	transform: translateY( 1px );
}

.captwiki-age-gate__btn:focus-visible {
	outline: 2px solid var( --captwiki-age-accent );
	outline-offset: 2px;
}

.captwiki-age-gate__btn--decline {
	color: #374151;
	background: #eef0f4;
}

.captwiki-age-gate__btn--decline:hover {
	background: #e2e5ec;
	box-shadow: none;
}

.captwiki-age-gate__btn--retry {
	margin-top: 6px;
	color: #374151;
	background: #eef0f4;
}

.captwiki-age-gate__btn--retry:hover {
	background: #e2e5ec;
	box-shadow: none;
}

/* ── Date of birth fields ──────────────────────────────── */
.captwiki-age-gate__dob {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-bottom: 18px;
}

.captwiki-age-gate__dob-input {
	width: 84px;
	padding: 12px 10px;
	font-size: 16px;
	text-align: center;
	color: #111827;
	background: #f7f8fb;
	border: 1px solid #dfe2ea;
	border-radius: 10px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-moz-appearance: textfield;
}

.captwiki-age-gate__dob-input::-webkit-outer-spin-button,
.captwiki-age-gate__dob-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.captwiki-age-gate__dob-year {
	width: 104px;
}

.captwiki-age-gate__dob-input:focus {
	border-color: var( --captwiki-age-accent );
	box-shadow: 0 0 0 3px rgba( 99, 102, 241, 0.15 );
}

/* ── Checkbox ──────────────────────────────────────────── */
.captwiki-age-gate__check {
	display: inline-flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 20px;
	font-size: 14px;
	line-height: 1.5;
	color: #374151;
	text-align: left;
	cursor: pointer;
}

.captwiki-age-gate__checkbox {
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var( --captwiki-age-accent );
	flex: 0 0 auto;
	cursor: pointer;
}

/* ── Error + decline screen ────────────────────────────── */
.captwiki-age-gate__error {
	margin: 14px 0 0;
	font-size: 14px;
	font-weight: 600;
	color: #dc2626;
}

.captwiki-age-gate__error[hidden],
.captwiki-age-gate__fail[hidden] {
	display: none;
}

.captwiki-age-gate__fail-title {
	margin: 0 0 12px;
	font-size: 22px;
	font-weight: 700;
	color: #b91c1c;
}

.captwiki-age-gate__fail-msg {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.6;
	color: #6b7280;
}

/* ── Editor preview — contained, never blocks the canvas ── */
.captwiki-age-gate.is-preview .captwiki-age-gate__overlay {
	position: relative;
	inset: auto;
	z-index: 1;
	min-height: 460px;
	border-radius: 12px;
}

body.captwiki-age-gate-open {
	overflow: hidden;
}

@keyframes captwiki-age-pop {
	from {
		opacity: 0;
		transform: translateY( 14px ) scale( 0.97 );
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media ( max-width: 480px ) {

	.captwiki-age-gate__body {
		padding: 24px 20px;
	}

	.captwiki-age-gate__btn {
		min-width: 0;
		flex: 1 1 auto;
	}
}

/* ── Reduced motion ────────────────────────────────────── */
@media ( prefers-reduced-motion: reduce ) {

	.captwiki-age-gate__panel,
	.captwiki-age-gate__btn {
		animation: none;
		transition: none;
	}
}
