/**
 * Cookie RGPD Manager — styles de la bannière.
 * Toutes les couleurs proviennent de variables CSS définies en inline (--crm-*).
 */

#crm-root,
#crm-root * {
	box-sizing: border-box;
}

#crm-root {
	position: fixed;
	z-index: 2147483000;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

#crm-root.crm-visible {
	opacity: 1;
}

#crm-root[hidden] {
	display: none;
}

/* Overlay assombrissant */
.crm-overlay {
	position: absolute;
	inset: 0;
	background: var(--crm-overlay);
	pointer-events: auto;
	backdrop-filter: blur(2px);
}

/* --- Conteneurs : bannière & préférences --- */
.crm-banner,
.crm-prefs-inner {
	pointer-events: auto;
	background: var(--crm-bg);
	color: var(--crm-text);
	border-radius: var(--crm-radius);
	box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.04);
	padding: 24px;
}

.crm-banner {
	position: absolute;
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: min(420px, calc(100% - 32px));
	animation: crm-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes crm-slide-up {
	from {
		transform: translateY(20px);
		opacity: 0;
	}
}

.crm-logo {
	max-height: 40px;
	width: auto;
}

.crm-title {
	margin: 0 0 4px;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--crm-text);
}

.crm-desc {
	margin: 0;
	font-size: 0.92rem;
	opacity: 0.85;
}

.crm-link {
	color: var(--crm-accent);
	text-decoration: underline;
	white-space: nowrap;
}

/* --- Boutons --- */
.crm-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.crm-btn {
	flex: 1 1 auto;
	min-width: 120px;
	padding: 11px 18px;
	border: 0;
	border-radius: calc(var(--crm-radius) * 0.6);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
	font-family: inherit;
}

.crm-btn:hover {
	transform: translateY(-1px);
	filter: brightness(1.05);
}

.crm-btn:active {
	transform: translateY(0);
}

.crm-btn-primary {
	background: var(--crm-accent);
	color: var(--crm-accent-text);
}

.crm-btn-secondary {
	background: var(--crm-secondary);
	color: var(--crm-secondary-text);
}

.crm-btn-ghost {
	background: transparent;
	color: var(--crm-text);
	box-shadow: inset 0 0 0 1.5px var(--crm-secondary);
}

/* --- Positions --- */
.crm-pos-bar-bottom .crm-banner {
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 100%;
	border-radius: 0;
	flex-direction: row;
	align-items: center;
	flex-wrap: wrap;
}

.crm-pos-bar-bottom .crm-content {
	flex: 1 1 340px;
}

.crm-pos-bar-bottom .crm-actions {
	flex: 0 0 auto;
}

.crm-pos-bar-bottom .crm-btn {
	flex: 0 0 auto;
}

.crm-pos-box-bottom-left .crm-banner {
	left: 20px;
	bottom: 20px;
}

.crm-pos-box-bottom-right .crm-banner {
	right: 20px;
	bottom: 20px;
}

.crm-pos-modal-center .crm-banner {
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(520px, calc(100% - 32px));
}

.crm-pos-modal-center .crm-banner {
	animation: crm-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes crm-pop {
	from {
		transform: translate(-50%, -46%);
		opacity: 0;
	}
}

/* --- Panneau de préférences --- */
.crm-prefs {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.crm-prefs[hidden] {
	display: none;
}

.crm-prefs-inner {
	width: min(560px, 100%);
	max-height: 85vh;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.crm-prefs-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.crm-close {
	background: none;
	border: 0;
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	color: var(--crm-text);
	opacity: 0.6;
	padding: 0 4px;
}

.crm-close:hover {
	opacity: 1;
}

.crm-prefs-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.crm-cat {
	padding: 14px 16px;
	border-radius: calc(var(--crm-radius) * 0.5);
	background: color-mix(in srgb, var(--crm-text) 5%, var(--crm-bg));
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--crm-text) 8%, transparent);
}

.crm-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	cursor: pointer;
}

.crm-cat-name {
	font-weight: 600;
}

.crm-cat-required {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--crm-accent);
	opacity: 0.9;
}

.crm-cat-desc {
	margin: 8px 0 0;
	font-size: 0.86rem;
	opacity: 0.78;
}

/* Interrupteur (switch) */
.crm-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex: 0 0 auto;
}

.crm-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.crm-slider {
	position: absolute;
	inset: 0;
	background: var(--crm-secondary);
	border-radius: 999px;
	transition: background 0.2s ease;
}

.crm-slider::before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.crm-switch input:checked + .crm-slider {
	background: var(--crm-accent);
}

.crm-switch input:checked + .crm-slider::before {
	transform: translateX(20px);
}

/* --- Bouton flottant de réouverture --- */
.crm-reopen {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 2147482000;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: var(--crm-bg);
	color: var(--crm-text);
	font-size: 1.4rem;
	cursor: pointer;
	box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
	transition: transform 0.15s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.crm-reopen[hidden] {
	display: none;
}

.crm-reopen:hover {
	transform: scale(1.08) rotate(-8deg);
}

/* --- Responsive --- */
@media (max-width: 600px) {
	.crm-pos-box-bottom-left .crm-banner,
	.crm-pos-box-bottom-right .crm-banner {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
	}

	.crm-pos-bar-bottom .crm-banner {
		flex-direction: column;
		align-items: stretch;
	}

	.crm-btn {
		flex: 1 1 100%;
	}
}

/* --- Placeholder des iframes bloquées --- */
.crm-embed-block {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	padding: 28px 24px;
	margin: 16px 0;
	border-radius: 14px;
	background: #f1f5f9;
	border: 1.5px dashed #cbd5e1;
	color: #1f2933;
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.crm-embed-inner {
	max-width: 420px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.crm-embed-icon {
	font-size: 1.8rem;
	margin: 0;
}

.crm-embed-title {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.45;
	opacity: 0.85;
}

.crm-embed-block .crm-btn {
	flex: 0 0 auto;
	min-width: 0;
	padding: 10px 22px;
}

@media (prefers-reduced-motion: reduce) {
	#crm-root,
	.crm-banner,
	.crm-btn,
	.crm-reopen {
		transition: none;
		animation: none;
	}
}
