/**
 * WPNest GDPR — frontend banner styles.
 *
 * Premium SaaS aesthetic — soft shadows, generous spacing, scale + fade
 * animations. Plain CSS, no preprocessor. Theme-agnostic — all colors and
 * fonts are hard-coded so themes that reset elements can't bleed into the
 * banner.
 *
 * Modes:
 *   .wpnest-gdpr-banner--bottom    sticky bottom bar
 *   .wpnest-gdpr-banner--floating  floating bottom-right popup
 *   .wpnest-gdpr-modal             granular preferences modal
 */

:root {
	--wpgdpr-bg: #ffffff;
	--wpgdpr-surface: #f8fafc;
	--wpgdpr-text: #0f172a;
	--wpgdpr-muted: #475569;
	--wpgdpr-subtle: #64748b;
	--wpgdpr-border: #e2e8f0;
	--wpgdpr-border-strong: #cbd5e1;
	--wpgdpr-accent: #4f46e5;
	--wpgdpr-accent-hover: #4338ca;
	--wpgdpr-accent-soft: #eef2ff;
	--wpgdpr-accent-ring: rgba(79, 70, 229, 0.18);
	--wpgdpr-success: #10b981;
	--wpgdpr-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
	--wpgdpr-shadow-md: 0 10px 30px -10px rgba(15, 23, 42, 0.15), 0 4px 12px -4px rgba(15, 23, 42, 0.08);
	--wpgdpr-shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, 0.28), 0 8px 20px -8px rgba(15, 23, 42, 0.12);
	--wpgdpr-radius-sm: 8px;
	--wpgdpr-radius-md: 12px;
	--wpgdpr-radius-lg: 16px;
	--wpgdpr-font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wpgdpr-max-width: 1100px;
}

.wpnest-gdpr-banner,
.wpnest-gdpr-banner *,
.wpnest-gdpr-modal,
.wpnest-gdpr-modal * {
	box-sizing: border-box;
	font-family: var(--wpgdpr-font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.wpnest-gdpr-no-scroll {
	overflow: hidden;
}

/* ===================================================================
 * Bottom bar
 * ================================================================ */

.wpnest-gdpr-banner--bottom {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 999999;
	background: var(--wpgdpr-bg);
	color: var(--wpgdpr-text);
	border: 1px solid var(--wpgdpr-border);
	border-radius: var(--wpgdpr-radius-lg);
	box-shadow: var(--wpgdpr-shadow-lg);
	padding: 20px 24px;
	animation: wpgdpr-slide-up 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes wpgdpr-slide-up {
	from { opacity: 0; transform: translateY(24px); }
	to   { opacity: 1; transform: translateY(0); }
}

.wpnest-gdpr-banner--bottom .wpnest-gdpr-banner__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	align-items: center;
	justify-content: space-between;
	max-width: var(--wpgdpr-max-width);
	margin: 0 auto;
}

.wpnest-gdpr-banner__brand {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--wpgdpr-accent-soft);
	color: var(--wpgdpr-accent);
}

.wpnest-gdpr-banner--bottom .wpnest-gdpr-banner__body {
	flex: 1 1 320px;
	min-width: 0;
}

.wpnest-gdpr-banner--bottom .wpnest-gdpr-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

/* ===================================================================
 * Floating popup
 * ================================================================ */

.wpnest-gdpr-banner--floating {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 999999;
	background: var(--wpgdpr-bg);
	color: var(--wpgdpr-text);
	border: 1px solid var(--wpgdpr-border);
	border-radius: var(--wpgdpr-radius-lg);
	box-shadow: var(--wpgdpr-shadow-lg);
	padding: 24px;
	width: min(380px, calc(100vw - 32px));
	animation: wpgdpr-slide-up 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wpnest-gdpr-banner--floating .wpnest-gdpr-banner__close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: transparent;
	border: 0;
	font-size: 22px;
	line-height: 1;
	color: var(--wpgdpr-subtle);
	cursor: pointer;
	padding: 6px;
	border-radius: 6px;
}
.wpnest-gdpr-banner--floating .wpnest-gdpr-banner__close:hover {
	background: var(--wpgdpr-surface);
	color: var(--wpgdpr-text);
}

.wpnest-gdpr-banner--floating .wpnest-gdpr-banner__actions--stack {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 16px;
}

/* ===================================================================
 * Banner typography
 * ================================================================ */

.wpnest-gdpr-banner__title {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--wpgdpr-text);
	letter-spacing: -0.01em;
}

.wpnest-gdpr-banner__text {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--wpgdpr-muted);
}

/* ===================================================================
 * Buttons
 * ================================================================ */

.wpnest-gdpr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 9px 18px;
	border-radius: 10px;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.005em;
	cursor: pointer;
	border: 1px solid transparent;
	background: transparent;
	color: var(--wpgdpr-text);
	transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
	text-decoration: none;
	-webkit-appearance: none;
	appearance: none;
}

.wpnest-gdpr-btn:focus-visible {
	outline: 0;
	box-shadow: 0 0 0 3px var(--wpgdpr-accent-ring);
}

.wpnest-gdpr-btn:active {
	transform: translateY(1px);
}

.wpnest-gdpr-btn--primary {
	background: var(--wpgdpr-accent);
	color: #ffffff;
	border-color: var(--wpgdpr-accent);
	box-shadow: var(--wpgdpr-shadow-sm);
}
.wpnest-gdpr-btn--primary:hover {
	background: var(--wpgdpr-accent-hover);
	border-color: var(--wpgdpr-accent-hover);
}

.wpnest-gdpr-btn--secondary {
	background: var(--wpgdpr-bg);
	color: var(--wpgdpr-text);
	border-color: var(--wpgdpr-border-strong);
}
.wpnest-gdpr-btn--secondary:hover {
	background: var(--wpgdpr-surface);
}

.wpnest-gdpr-btn--ghost {
	background: transparent;
	color: var(--wpgdpr-muted);
}
.wpnest-gdpr-btn--ghost:hover {
	color: var(--wpgdpr-text);
	background: var(--wpgdpr-surface);
}

/* ===================================================================
 * Modal
 * ================================================================ */

.wpnest-gdpr-modal[hidden] { display: none; }

.wpnest-gdpr-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.wpnest-gdpr-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	animation: wpgdpr-fade 200ms ease-out;
}

.wpnest-gdpr-modal__dialog {
	position: relative;
	width: min(560px, 100%);
	max-height: calc(100vh - 32px);
	overflow: hidden;
	background: var(--wpgdpr-bg);
	color: var(--wpgdpr-text);
	border-radius: var(--wpgdpr-radius-lg);
	box-shadow: var(--wpgdpr-shadow-lg);
	display: flex;
	flex-direction: column;
	animation: wpgdpr-scale-in 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes wpgdpr-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes wpgdpr-scale-in {
	from { opacity: 0; transform: scale(0.96) translateY(8px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

.wpnest-gdpr-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 22px 24px 16px;
	border-bottom: 1px solid var(--wpgdpr-border);
}

.wpnest-gdpr-modal__brand {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	flex: 1;
	min-width: 0;
}

.wpnest-gdpr-modal__brand-icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--wpgdpr-accent-soft);
	color: var(--wpgdpr-accent);
}

.wpnest-gdpr-modal__header h2 {
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.015em;
	color: var(--wpgdpr-text);
}

.wpnest-gdpr-modal__desc {
	margin: 0;
	color: var(--wpgdpr-muted);
	font-size: 13.5px;
	line-height: 1.55;
}

.wpnest-gdpr-modal__close {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: transparent;
	border: 0;
	border-radius: 8px;
	color: var(--wpgdpr-subtle);
	cursor: pointer;
	transition: background-color 120ms ease, color 120ms ease;
}
.wpnest-gdpr-modal__close:hover {
	background: var(--wpgdpr-surface);
	color: var(--wpgdpr-text);
}
.wpnest-gdpr-modal__close:focus-visible {
	outline: 0;
	box-shadow: 0 0 0 3px var(--wpgdpr-accent-ring);
}

.wpnest-gdpr-modal__form {
	flex: 1;
	overflow-y: auto;
	padding: 8px 8px 0;
}

.wpnest-gdpr-modal__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
	padding: 16px 24px 20px;
	border-top: 1px solid var(--wpgdpr-border);
	background: var(--wpgdpr-surface);
}

/* ===================================================================
 * Category row
 * ================================================================ */

.wpnest-gdpr-category {
	display: flex;
	gap: 14px;
	padding: 14px 16px;
	margin: 4px 8px;
	border-radius: 12px;
	transition: background-color 120ms ease;
}

.wpnest-gdpr-category:hover {
	background: var(--wpgdpr-surface);
}

.wpnest-gdpr-category__icon {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--wpgdpr-accent-soft);
	color: var(--wpgdpr-accent);
}

.wpnest-gdpr-category--necessary   .wpnest-gdpr-category__icon { background: #ecfdf5; color: #047857; }
.wpnest-gdpr-category--analytics   .wpnest-gdpr-category__icon { background: #eff6ff; color: #1d4ed8; }
.wpnest-gdpr-category--marketing   .wpnest-gdpr-category__icon { background: #fef3c7; color: #b45309; }
.wpnest-gdpr-category--preferences .wpnest-gdpr-category__icon { background: #f3e8ff; color: #6d28d9; }

.wpnest-gdpr-category__body {
	flex: 1;
	min-width: 0;
}

.wpnest-gdpr-category__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.wpnest-gdpr-category__label {
	font-size: 14.5px;
	font-weight: 600;
	color: var(--wpgdpr-text);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	letter-spacing: -0.005em;
}

.wpnest-gdpr-category__badge {
	display: inline-block;
	padding: 2px 8px;
	background: var(--wpgdpr-surface);
	color: var(--wpgdpr-subtle);
	font-size: 10.5px;
	font-weight: 600;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border: 1px solid var(--wpgdpr-border);
}

.wpnest-gdpr-category__desc {
	margin: 6px 0 0;
	color: var(--wpgdpr-muted);
	font-size: 13px;
	line-height: 1.55;
}

/* ===================================================================
 * Toggle switch
 * ================================================================ */

.wpnest-gdpr-toggle {
	position: relative;
	display: inline-flex;
	width: 40px;
	height: 22px;
	flex-shrink: 0;
}

.wpnest-gdpr-toggle input {
	position: absolute;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 2;
}

.wpnest-gdpr-toggle input:disabled {
	cursor: not-allowed;
}

.wpnest-gdpr-toggle__track {
	position: absolute;
	inset: 0;
	background: var(--wpgdpr-border-strong);
	border-radius: 999px;
	transition: background-color 200ms ease;
}

.wpnest-gdpr-toggle__track::after {
	content: "";
	position: absolute;
	left: 2px;
	top: 2px;
	width: 18px;
	height: 18px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
	transition: left 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wpnest-gdpr-toggle input:checked + .wpnest-gdpr-toggle__track {
	background: var(--wpgdpr-accent);
}

.wpnest-gdpr-toggle input:checked + .wpnest-gdpr-toggle__track::after {
	left: 20px;
}

.wpnest-gdpr-toggle input:focus-visible + .wpnest-gdpr-toggle__track {
	box-shadow: 0 0 0 3px var(--wpgdpr-accent-ring);
}

.wpnest-gdpr-toggle input:disabled + .wpnest-gdpr-toggle__track {
	background: var(--wpgdpr-success);
	opacity: 0.45;
}

/* ===================================================================
 * Footer link — circular FAB for returning visitors
 * ================================================================ */

.wpnest-gdpr-footer-link {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 999998;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	margin: 0;
	border-radius: 50%;
	background: var(--wpgdpr-bg);
	border: 1px solid var(--wpgdpr-border);
	color: var(--wpgdpr-accent);
	cursor: pointer;
	box-shadow: var(--wpgdpr-shadow-md);
	transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1),
	            background-color 160ms ease,
	            border-color 160ms ease,
	            color 160ms ease,
	            box-shadow 160ms ease;
	-webkit-appearance: none;
	appearance: none;
}

.wpnest-gdpr-footer-link:hover {
	background: var(--wpgdpr-accent);
	border-color: var(--wpgdpr-accent);
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: var(--wpgdpr-shadow-lg);
}

.wpnest-gdpr-footer-link:active {
	transform: translateY(0);
}

.wpnest-gdpr-footer-link:focus-visible {
	outline: 0;
	box-shadow: var(--wpgdpr-shadow-lg), 0 0 0 3px var(--wpgdpr-accent-ring);
}

.wpnest-gdpr-footer-link svg {
	display: block;
}

/* Screen-reader-only label inside the circular button. */
.wpnest-gdpr-footer-link__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ===================================================================
 * Responsive tweaks
 * ================================================================ */

@media ( max-width: 720px ) {
	.wpnest-gdpr-banner--bottom .wpnest-gdpr-banner__inner {
		flex-direction: column;
		align-items: stretch;
	}
	.wpnest-gdpr-banner--bottom .wpnest-gdpr-banner__brand {
		align-self: flex-start;
	}
	.wpnest-gdpr-banner--bottom .wpnest-gdpr-banner__actions {
		justify-content: stretch;
	}
	.wpnest-gdpr-banner--bottom .wpnest-gdpr-btn,
	.wpnest-gdpr-banner--floating .wpnest-gdpr-btn {
		flex: 1 1 100%;
	}
	.wpnest-gdpr-modal__footer .wpnest-gdpr-btn {
		flex: 1 1 100%;
	}
	.wpnest-gdpr-modal__header {
		padding: 20px 20px 14px;
	}
	.wpnest-gdpr-modal__footer {
		padding: 14px 20px 18px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.wpnest-gdpr-banner--bottom,
	.wpnest-gdpr-banner--floating,
	.wpnest-gdpr-modal__backdrop,
	.wpnest-gdpr-modal__dialog,
	.wpnest-gdpr-btn,
	.wpnest-gdpr-toggle__track,
	.wpnest-gdpr-toggle__track::after,
	.wpnest-gdpr-category,
	.wpnest-gdpr-footer-link {
		animation: none !important;
		transition: none !important;
	}
}

/* ===================================================================
 * Dark mode (respects user preference)
 * ================================================================ */

@media ( prefers-color-scheme: dark ) {
	:root {
		--wpgdpr-bg: #0f172a;
		--wpgdpr-surface: #1e293b;
		--wpgdpr-text: #f8fafc;
		--wpgdpr-muted: #cbd5e1;
		--wpgdpr-subtle: #94a3b8;
		--wpgdpr-border: #334155;
		--wpgdpr-border-strong: #475569;
		--wpgdpr-accent-soft: rgba(99, 102, 241, 0.18);
		--wpgdpr-shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 4px 12px -4px rgba(0, 0, 0, 0.3);
		--wpgdpr-shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.7), 0 8px 20px -8px rgba(0, 0, 0, 0.4);
	}
	.wpnest-gdpr-category--necessary   .wpnest-gdpr-category__icon { background: rgba(16, 185, 129, 0.15); color: #34d399; }
	.wpnest-gdpr-category--analytics   .wpnest-gdpr-category__icon { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
	.wpnest-gdpr-category--marketing   .wpnest-gdpr-category__icon { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
	.wpnest-gdpr-category--preferences .wpnest-gdpr-category__icon { background: rgba(168, 85, 247, 0.18); color: #c084fc; }
}
