/**
 * Age Restriction & Verification Frontend Styles
 */

:root {
	--cgar-modal-bg: #ffffff;
	--cgar-modal-text: #1f2937;
	--cgar-primary-btn-bg: #111827;
	--cgar-primary-btn-color: #ffffff;
	--cgar-reject-btn-bg: #f3f4f6;
	--cgar-reject-btn-color: #4b5563;
	--cgar-modal-max-width: 480px;
	--cgar-border-radius: 12px;
	--cgar-overlay-blur: 8px;
	--cgar-overlay-opacity: 0.85;
}

body.cgar-locked-scroll {
	overflow: hidden !important;
	touch-action: none;
}

/* Modal Overlay Wrapper */
.cgar-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 99999999;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 20px;
	visibility: visible;
	opacity: 1;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cgar-overlay.cgar-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* Backdrop */
.cgar-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(15, 23, 42, var(--cgar-overlay-opacity, 0.85));
	backdrop-filter: blur(var(--cgar-overlay-blur, 8px));
	-webkit-backdrop-filter: blur(var(--cgar-overlay-blur, 8px));
	z-index: 1;
}

/* Container & Card */
.cgar-modal-container {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: var(--cgar-modal-max-width, 480px);
	box-sizing: border-box;
}

.cgar-modal-card {
	background-color: var(--cgar-modal-bg, #ffffff);
	color: var(--cgar-modal-text, #1f2937);
	border-radius: var(--cgar-border-radius, 12px);
	padding: 36px 32px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
	position: relative;
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	transform-origin: center center;
}

/* Animations */
.cgar-anim-zoom_in .cgar-modal-card {
	animation: cgarZoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cgar-anim-fade .cgar-modal-card {
	animation: cgarFadeIn 0.35s ease forwards;
}

.cgar-anim-slide_down .cgar-modal-card {
	animation: cgarSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cgarZoomIn {
	from {
		opacity: 0;
		transform: scale(0.92);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes cgarFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes cgarSlideDown {
	from {
		opacity: 0;
		transform: translateY(-40px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Close button if allowed */
.cgar-close-btn {
	position: absolute;
	top: 14px;
	right: 14px;
	background: transparent;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: var(--cgar-modal-text, #1f2937);
	opacity: 0.6;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	transition: opacity 0.2s ease, background 0.2s ease;
}

.cgar-close-btn:hover,
.cgar-close-btn:focus {
	opacity: 1;
	background: rgba(0, 0, 0, 0.05);
	outline: none;
}

/* Header & Logos */
.cgar-brand-logo {
	margin-bottom: 16px;
}

.cgar-brand-logo img {
	max-height: 64px;
	max-width: 180px;
	height: auto;
	display: inline-block;
	object-fit: contain;
}

.cgar-default-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(59, 130, 246, 0.1);
	color: #2563eb;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
}

.cgar-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 10px 0;
	line-height: 1.3;
	color: inherit;
}

.cgar-description {
	font-size: 14px;
	line-height: 1.5;
	opacity: 0.85;
	margin-bottom: 24px;
}

.cgar-description p {
	margin: 0 0 8px 0;
}

.cgar-description p:last-child {
	margin-bottom: 0;
}

/* Form & Inputs */
.cgar-form-body {
	margin-bottom: 20px;
	text-align: left;
}

.cgar-dob-label {
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 8px;
	text-align: center;
}

.cgar-dob-selects {
	display: flex;
	gap: 10px;
	justify-content: center;
}

.cgar-dob-col {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.cgar-dob-col label {
	font-size: 11px;
	font-weight: 500;
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	opacity: 0.75;
}

.cgar-select,
.cgar-date-input {
	width: 100%;
	height: 42px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 0 10px;
	font-size: 14px;
	color: #1f2937;
	background-color: #f9fafb;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.cgar-select:focus,
.cgar-date-input:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
	outline: none;
	background-color: #ffffff;
}

/* Checkbox Style */
.cgar-checkbox-field {
	padding: 12px;
	background: rgba(0, 0, 0, 0.02);
	border-radius: 8px;
	border: 1px solid #e5e7eb;
}

.cgar-custom-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.4;
	user-select: none;
}

.cgar-custom-checkbox-label input[type="checkbox"] {
	margin-top: 3px;
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: #2563eb;
}

/* Actions */
.cgar-modal-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cgar-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 44px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: all 0.2s ease;
	position: relative;
	text-decoration: none;
}

.cgar-btn-primary {
	background-color: var(--cgar-primary-btn-bg, #111827);
	color: var(--cgar-primary-btn-color, #ffffff);
}

.cgar-btn-primary:hover {
	opacity: 0.92;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cgar-btn-secondary {
	background-color: var(--cgar-reject-btn-bg, #f3f4f6);
	color: var(--cgar-reject-btn-color, #4b5563);
}

.cgar-btn-secondary:hover {
	background-color: #e5e7eb;
}

.cgar-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: cgarSpin 0.7s linear infinite;
	margin-left: 8px;
}

@keyframes cgarSpin {
	to {
		transform: rotate(360deg);
	}
}

/* Error Box */
.cgar-error-box {
	background-color: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 13px;
	line-height: 1.4;
	margin-bottom: 16px;
	text-align: center;
	animation: cgarShake 0.4s ease;
}

@keyframes cgarShake {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-6px); }
	40%, 80% { transform: translateX(6px); }
}

/* Inline Widget Shortcode */
.cgar-inline-box {
	background: #f8fafc;
	border: 2px dashed #cbd5e1;
	border-radius: 12px;
	padding: 30px;
	text-align: center;
	margin: 24px 0;
}

.cgar-inline-icon {
	font-size: 32px;
	color: #64748b;
	margin-bottom: 12px;
}

.cgar-inline-content h3 {
	font-size: 20px;
	margin: 0 0 8px 0;
	color: #1e293b;
}

.cgar-inline-content p {
	font-size: 14px;
	color: #64748b;
	margin-bottom: 18px;
}

.cgar-inline-content .cgar-btn {
	display: inline-flex;
	width: auto;
	padding: 0 24px;
}

/* Responsive */
@media (max-width: 480px) {
	.cgar-modal-card {
		padding: 24px 18px;
	}
	.cgar-title {
		font-size: 19px;
	}
	.cgar-dob-selects {
		gap: 6px;
	}
	.cgar-select {
		padding: 0 4px;
		font-size: 13px;
	}
}
