/* ROGUE Cookie Consent — bannière front
   Variables injectées par PHP :
   --rcc-bg (fond + teinte du verre), --rcc-text (texte),
   --rcc-btn-bg / --rcc-btn-text (bouton Accepter, contraste auto),
   --rcc-btn-refuse-bg / --rcc-btn-refuse-text (bouton Refuser),
   --rcc-btn-border-color / --rcc-btn-border-width (bordures communes),
   --rcc-close-bg / --rcc-close-icon (bouton fermeture),
   --rcc-scrim-rgb / --rcc-scrim-opacity (overlay modale),
   --rcc-font (police choisie ; absente = héritage du thème). */

.rcc-root {
	--rcc-radius: 16px;
	--rcc-gap: 12px;
	--rcc-shadow: 0 8px 40px rgba(0, 0, 0, 0.16);
	--rcc-glass-shadow:
		0 10px 38px rgba(0, 0, 0, 0.14),
		0 2px 10px rgba(0, 0, 0, 0.06);
	--rcc-ease: cubic-bezier(0.22, 1, 0.36, 1);
	position: fixed;
	z-index: 999999;
	box-sizing: border-box;
}

.rcc-root[hidden] {
	display: none;
}

.rcc-root *,
.rcc-root *::before,
.rcc-root *::after {
	box-sizing: border-box;
}

/* ---- Conteneur ---- */
.rcc-banner {
	display: flex;
	position: relative;
	gap: 20px;
	padding: 18px 22px;
	border-radius: var(--rcc-radius);
	box-shadow: var(--rcc-shadow);
	color: var(--rcc-text);
	font-family: var(--rcc-font, inherit);
	line-height: 1.5;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.5s var(--rcc-ease), transform 0.5s var(--rcc-ease);
}

/* Layout : barre horizontale (centre) vs carte verticale (coins / modale) */
.rcc-banner--bar {
	flex-direction: row;
	align-items: center;
}

.rcc-banner--card {
	flex-direction: column;
	align-items: flex-start;
	gap: 18px;
	padding: 24px;
}

/* Fond uni */
.rcc-banner--solid {
	background: var(--rcc-bg);
	border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Liquid glass — translucide type iOS (ultra-thin material) */
.rcc-banner--glass {
	--rcc-radius: 20px;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: rgba(var(--rcc-bg-rgb), 0.12);
	-webkit-backdrop-filter: blur(52px) saturate(200%) brightness(1.06);
	backdrop-filter: blur(52px) saturate(200%) brightness(1.06);
	border: 0.5px solid rgba(255, 255, 255, 0.48);
	box-shadow:
		var(--rcc-glass-shadow),
		inset 0 1px 0 rgba(255, 255, 255, 0.72),
		inset 1px 0 0 rgba(255, 255, 255, 0.2),
		inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

.rcc-banner--glass::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	z-index: 0;
	background: linear-gradient(
		148deg,
		rgba(255, 255, 255, 0.46) 0%,
		rgba(255, 255, 255, 0.12) 30%,
		rgba(255, 255, 255, 0.02) 55%,
		rgba(255, 255, 255, 0.16) 100%
	);
}

.rcc-banner--glass::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	z-index: 0;
	box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.28);
}

.rcc-banner--glass > .rcc-close,
.rcc-banner--glass > .rcc-content,
.rcc-banner--glass > .rcc-actions {
	position: relative;
	z-index: 1;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.rcc-banner--glass {
		background: rgba(var(--rcc-bg-rgb), 0.88);
	}
}

.rcc-banner--glass .rcc-close {
	background-color: rgba(var(--rcc-close-bg-rgb, 255, 255, 255), 0.52) !important;
	-webkit-backdrop-filter: blur(18px) saturate(180%);
	backdrop-filter: blur(18px) saturate(180%);
	border: 0.5px solid rgba(255, 255, 255, 0.58) !important;
	box-shadow:
		0 2px 8px rgba(0, 0, 0, 0.08),
		inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

/* ---- Positions (classe posée par le JS sur .rcc-root) ---- */
.rcc-root.rcc-pos-bottom-center {
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	width: min(720px, calc(100% - 32px));
}

.rcc-root.rcc-pos-bottom-left {
	left: 24px;
	bottom: 24px;
	width: min(400px, calc(100% - 32px));
}

.rcc-root.rcc-pos-bottom-right {
	right: 24px;
	bottom: 24px;
	width: min(400px, calc(100% - 32px));
}

.rcc-root.rcc-pos-modal {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.rcc-root.rcc-pos-modal .rcc-banner {
	width: min(440px, 100%);
}

.rcc-scrim {
	position: fixed;
	inset: 0;
	background: rgba(var(--rcc-scrim-rgb, 0, 0, 0), var(--rcc-scrim-opacity, 0.42));
	opacity: 0;
	transition: opacity 0.4s var(--rcc-ease);
}

/* ---- État visible (ajouté par le JS) ---- */
.rcc-root.is-visible .rcc-banner {
	opacity: 1;
	transform: translateY(0);
}

.rcc-root.is-visible .rcc-scrim {
	opacity: 1;
}

/* ---- Contenu (titre + message) ---- */
.rcc-content {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 auto;
	min-width: 0;
}

.rcc-banner--has-close .rcc-content {
	padding-right: 40px;
}

.rcc-root .rcc-banner .rcc-title {
	margin: 0;
	padding: 0;
	font-family: var(--rcc-font, inherit);
	font-weight: 700;
	font-size: 1.2em;
	line-height: 1.25;
	color: var(--rcc-text);
}

/* ---- Croix de fermeture ---- */
.rcc-root .rcc-banner .rcc-close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	margin: 0;
	border: none !important;
	border-radius: 50% !important;
	background-color: var(--rcc-close-bg, #fff) !important;
	color: var(--rcc-close-icon, #595959) !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	cursor: pointer;
	font-size: 0;
	line-height: 0;
	min-width: 0;
	min-height: 0;
	text-align: center;
	transition: transform 0.15s var(--rcc-ease), box-shadow 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.rcc-root .rcc-banner .rcc-close svg {
	display: block;
	flex-shrink: 0;
}

.rcc-root .rcc-banner .rcc-close:hover {
	filter: brightness(0.92);
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
}

.rcc-root .rcc-banner .rcc-close:active {
	transform: scale(0.94);
}

.rcc-root .rcc-banner .rcc-close:focus-visible {
	outline: 2px solid var(--rcc-text);
	outline-offset: 2px;
}

/* ---- Texte (spécificité élevée pour battre les styles du thème) ---- */
.rcc-root .rcc-banner .rcc-message {
	margin: 0;
	font-family: var(--rcc-font, inherit);
	font-size: 0.95em;
	color: var(--rcc-text);
}

.rcc-root .rcc-banner .rcc-privacy-link {
	font-family: var(--rcc-font, inherit);
	color: var(--rcc-text);
	text-decoration: underline;
	text-underline-offset: 2px;
	opacity: 0.8;
	white-space: nowrap;
}

.rcc-root .rcc-banner .rcc-privacy-link:hover {
	opacity: 1;
}

/* ---- Actions ---- */
.rcc-actions {
	display: flex;
	align-items: center;
	gap: var(--rcc-gap);
	flex: 0 0 auto;
}

.rcc-banner--card .rcc-actions {
	width: 100%;
}

.rcc-banner--card .rcc-actions .rcc-btn {
	flex: 1 1 0;
	text-align: center;
}

/* ---- Boutons : reset défensif + styles forcés pour neutraliser le thème ---- */
.rcc-root .rcc-banner .rcc-btn {
	font-family: var(--rcc-font-btn, inherit);
	font-size: 0.92em;
	font-weight: 600;
	line-height: 1;
	margin: 0;
	padding: 12px 22px;
	border: var(--rcc-btn-border-width, 0) solid var(--rcc-btn-border-color, transparent) !important;
	border-radius: var(--rcc-btn-radius, 999px) !important;
	width: auto;
	min-height: 0;
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: transform 0.15s var(--rcc-ease), opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.rcc-root .rcc-banner .rcc-btn:active {
	transform: scale(0.97);
}

/* Accepter — bouton plein, mis en évidence */
.rcc-root .rcc-banner .rcc-btn--accept {
	background-color: var(--rcc-btn-bg) !important;
	color: var(--rcc-btn-text) !important;
	padding: 13px 26px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
}

.rcc-root .rcc-banner .rcc-btn--accept:hover {
	opacity: 0.9;
}

/* Refuser */
.rcc-root .rcc-banner .rcc-btn--refuse {
	background-color: var(--rcc-btn-refuse-bg, transparent) !important;
	color: var(--rcc-btn-refuse-text, var(--rcc-text)) !important;
}

.rcc-root .rcc-banner .rcc-btn--refuse--ghost {
	opacity: 0.85;
}

.rcc-root .rcc-banner .rcc-btn--refuse--ghost:hover {
	opacity: 1;
}

.rcc-root .rcc-banner .rcc-btn--refuse:not(.rcc-btn--refuse--ghost):hover {
	filter: brightness(0.96);
}

/* ---- Focus clavier ---- */
.rcc-root .rcc-banner .rcc-btn:focus-visible,
.rcc-root .rcc-banner .rcc-privacy-link:focus-visible {
	outline: 2px solid var(--rcc-text);
	outline-offset: 2px;
}

/* ---- Responsive : tout passe en pleine largeur en bas ---- */
@media (max-width: 600px) {
	.rcc-root.rcc-pos-bottom-center,
	.rcc-root.rcc-pos-bottom-left,
	.rcc-root.rcc-pos-bottom-right {
		left: 50%;
		right: auto;
		bottom: 12px;
		transform: translateX(-50%);
		width: calc(100% - 20px);
	}

	.rcc-banner--bar {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.rcc-banner .rcc-actions {
		justify-content: stretch;
	}

	.rcc-banner .rcc-btn {
		flex: 1 1 0;
		text-align: center;
		padding: 13px 16px;
	}
}

/* ---- Mouvement réduit ---- */
@media (prefers-reduced-motion: reduce) {
	.rcc-banner,
	.rcc-scrim {
		transition: opacity 0.2s linear;
		transform: none;
	}

	.rcc-root.is-visible .rcc-banner {
		transform: none;
	}
}
