/* Bannière consentement — discret, coin bas-gauche (sans overlay plein écran) */
.emotta-cookie-consent {
	position: fixed;
	left: max(0.75rem, env(safe-area-inset-left, 0px));
	bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
	right: auto;
	top: auto;
	z-index: 200000;
	width: min(22rem, calc(100vw - 1.5rem));
	max-width: 100%;
	pointer-events: none;
}

.emotta-cookie-consent[hidden] {
	display: none !important;
}

.emotta-cookie-consent__backdrop {
	display: none;
}

.emotta-cookie-consent__panel {
	position: relative;
	pointer-events: auto;
	width: 100%;
	max-height: min(85vh, 30rem);
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: 0.875rem;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(15, 15, 22, 0.94);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow:
		0 4px 6px -1px rgba(0, 0, 0, 0.2),
		0 12px 24px -8px rgba(0, 0, 0, 0.45);
	color: #e2e8f0;
	padding: 1rem 1rem 0.875rem;
}

html[data-emotta-theme='light'] .emotta-cookie-consent__panel {
	background: rgba(255, 255, 255, 0.96);
	border-color: rgba(15, 23, 42, 0.1);
	color: #1e293b;
	box-shadow:
		0 4px 6px -1px rgba(15, 23, 42, 0.08),
		0 12px 24px -8px rgba(15, 23, 42, 0.12);
}

.emotta-cookie-consent__title {
	margin: 0 0 0.5rem;
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #f8fafc;
}

html[data-emotta-theme='light'] .emotta-cookie-consent__title {
	color: #0f172a;
}

.emotta-cookie-consent__text {
	margin: 0 0 0.75rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: rgba(226, 232, 240, 0.88);
}

.emotta-cookie-consent__legal {
	margin: 0 0 0.75rem;
	font-size: 0.75rem;
}

.emotta-cookie-consent__legal-link {
	color: #a78bfa;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.emotta-cookie-consent__legal-link:hover,
.emotta-cookie-consent__legal-link:focus-visible {
	color: #c4b5fd;
}

html[data-emotta-theme='light'] .emotta-cookie-consent__legal-link {
	color: #6d28d9;
}

html[data-emotta-theme='light'] .emotta-cookie-consent__legal-link:hover,
html[data-emotta-theme='light'] .emotta-cookie-consent__legal-link:focus-visible {
	color: #5b21b6;
}

html[data-emotta-theme='light'] .emotta-cookie-consent__text {
	color: rgba(30, 41, 59, 0.9);
}

.emotta-cookie-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	align-items: center;
	justify-content: flex-start;
}

.emotta-cookie-consent__actions--prefs {
	margin-top: 0.5rem;
}

.emotta-cookie-consent__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.45rem 0.75rem;
	border-radius: 9999px;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.emotta-cookie-consent__btn--primary {
	background: linear-gradient(105deg, #7c3aed 0%, #2563eb 100%);
	color: #fff;
	border-color: transparent;
}

.emotta-cookie-consent__btn--primary:hover,
.emotta-cookie-consent__btn--primary:focus-visible {
	filter: brightness(1.06);
}

.emotta-cookie-consent__btn--secondary {
	background: rgba(124, 58, 237, 0.15);
	color: #c4b5fd;
	border-color: rgba(124, 58, 237, 0.35);
}

html[data-emotta-theme='light'] .emotta-cookie-consent__btn--secondary {
	color: #5b21b6;
	background: rgba(124, 58, 237, 0.1);
	border-color: rgba(91, 33, 182, 0.25);
}

.emotta-cookie-consent__btn--ghost {
	background: transparent;
	color: rgba(226, 232, 240, 0.85);
	border-color: rgba(255, 255, 255, 0.2);
}

html[data-emotta-theme='light'] .emotta-cookie-consent__btn--ghost {
	color: #475569;
	border-color: rgba(15, 23, 42, 0.2);
}

.emotta-cookie-consent__btn--ghost:hover,
.emotta-cookie-consent__btn--ghost:focus-visible {
	background: rgba(255, 255, 255, 0.06);
}

html[data-emotta-theme='light'] .emotta-cookie-consent__btn--ghost:hover,
html[data-emotta-theme='light'] .emotta-cookie-consent__btn--ghost:focus-visible {
	background: rgba(15, 23, 42, 0.06);
}

.emotta-cookie-consent__categories {
	list-style: none;
	margin: 0 0 0.75rem;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.emotta-cookie-consent__cat {
	margin: 0;
	padding: 0.75rem 0 0;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-emotta-theme='light'] .emotta-cookie-consent__cat {
	border-top-color: rgba(15, 23, 42, 0.08);
}

.emotta-cookie-consent__cat:first-child {
	border-top: 0;
	padding-top: 0;
}

.emotta-cookie-consent__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.emotta-cookie-consent__cat-name {
	font-weight: 600;
	font-size: 0.8125rem;
	color: #f1f5f9;
}

html[data-emotta-theme='light'] .emotta-cookie-consent__cat-name {
	color: #0f172a;
}

.emotta-cookie-consent__badge {
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.2rem 0.5rem;
	border-radius: 9999px;
	background: rgba(52, 211, 153, 0.15);
	color: #6ee7b7;
	border: 1px solid rgba(52, 211, 153, 0.35);
}

.emotta-cookie-consent__cat-desc {
	margin: 0.25rem 0 0;
	font-size: 0.75rem;
	line-height: 1.45;
	color: rgba(148, 163, 184, 0.95);
}

html[data-emotta-theme='light'] .emotta-cookie-consent__cat-desc {
	color: rgba(71, 85, 105, 0.95);
}

/* Interrupteur (checkbox stylée) */
.emotta-cookie-consent__toggle {
	appearance: none;
	width: 2.75rem;
	height: 1.5rem;
	border-radius: 9999px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.2);
	cursor: pointer;
	position: relative;
	flex-shrink: 0;
	transition: background 0.2s ease, border-color 0.2s ease;
}

html[data-emotta-theme='light'] .emotta-cookie-consent__toggle {
	background: rgba(15, 23, 42, 0.08);
	border-color: rgba(15, 23, 42, 0.2);
}

.emotta-cookie-consent__toggle::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 0.2rem;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	background: #fff;
	transform: translateY(-50%);
	transition: transform 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.emotta-cookie-consent__toggle:checked {
	background: linear-gradient(105deg, #7c3aed 0%, #2563eb 100%);
	border-color: transparent;
}

.emotta-cookie-consent__toggle:checked::after {
	transform: translate(1.15rem, -50%);
}

.emotta-cookie-consent__switch-label {
	cursor: pointer;
	flex: 1;
	min-width: 0;
}

@media (max-width: 380px) {
	.emotta-cookie-consent {
		left: max(0.5rem, env(safe-area-inset-left, 0px));
		bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
		width: calc(100vw - 1rem);
	}
	.emotta-cookie-consent__actions {
		flex-direction: column;
		align-items: stretch;
	}
	.emotta-cookie-consent__btn {
		width: 100%;
	}
}
