/**
 * GCM Cookie Consent - Banner styles
 * Design moderne, optimisé pour la conversion, conforme CNIL
 */

:root {
	--gcm-cc-primary: #2563eb;
	--gcm-cc-accent: #10b981;
	--gcm-cc-bg: #ffffff;
	--gcm-cc-text: #1f2937;
	--gcm-cc-text-muted: #6b7280;
	--gcm-cc-border: #e5e7eb;
	--gcm-cc-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.25), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
	--gcm-cc-radius: 16px;
}

/* Hidden state */
.gcm-cc-hidden { display: none !important; }

/* === BANNER BASE === */
.gcm-cc-banner {
	position: fixed;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--gcm-cc-text);
	box-sizing: border-box;
	animation: gcm-cc-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.gcm-cc-banner *,
.gcm-cc-banner *::before,
.gcm-cc-banner *::after { box-sizing: border-box; }

/* Overlay (uniquement pour position centrale) */
.gcm-cc-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: -1;
	animation: gcm-cc-fade-in 0.3s ease;
}

.gcm-cc-inner {
	background: var(--gcm-cc-bg);
	border-radius: var(--gcm-cc-radius);
	box-shadow: var(--gcm-cc-shadow);
	padding: 24px 28px;
	position: relative;
	border: 1px solid var(--gcm-cc-border);
}

/* Bouton fermer (= refuser) */
.gcm-cc-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: none;
	background: #f3f4f6;
	color: #6b7280;
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: all 0.15s;
}
.gcm-cc-close:hover { background: #e5e7eb; color: #111827; }

/* === POSITIONS === */
.gcm-cc-pos-bottom {
	bottom: 0;
	left: 0;
	right: 0;
	padding: 16px;
}
.gcm-cc-pos-bottom .gcm-cc-inner {
	max-width: 1100px;
	margin: 0 auto;
}

.gcm-cc-pos-bottom-left {
	bottom: 16px;
	left: 16px;
	max-width: 440px;
}
.gcm-cc-pos-bottom-right {
	bottom: 16px;
	right: 16px;
	max-width: 440px;
}

.gcm-cc-pos-center {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.gcm-cc-pos-center .gcm-cc-overlay { display: block; }
.gcm-cc-pos-center .gcm-cc-inner {
	max-width: 540px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
}

/* === CONTENT === */
.gcm-cc-title {
	font-size: 19px;
	font-weight: 700;
	margin: 0 0 10px;
	color: var(--gcm-cc-text);
	line-height: 1.3;
	padding-right: 36px;
}
.gcm-cc-text {
	font-size: 14.5px;
	line-height: 1.55;
	margin: 0 0 14px;
	color: var(--gcm-cc-text-muted);
}

/* Bénéfices : ligne d'accroche positive */
.gcm-cc-benefits {
	background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.02));
	border: 1px solid rgba(16, 185, 129, 0.2);
	color: var(--gcm-cc-accent);
	font-size: 13.5px;
	font-weight: 500;
	padding: 10px 14px;
	border-radius: 10px;
	margin: 0 0 14px;
	letter-spacing: 0.01em;
}

.gcm-cc-privacy {
	margin: 0 0 16px;
	font-size: 12.5px;
}
.gcm-cc-privacy a {
	color: var(--gcm-cc-text-muted);
	text-decoration: none;
	border-bottom: 1px dashed var(--gcm-cc-text-muted);
	transition: all 0.15s;
}
.gcm-cc-privacy a:hover {
	color: var(--gcm-cc-primary);
	border-bottom-color: var(--gcm-cc-primary);
}

/* === BOUTONS === */
.gcm-cc-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: stretch;
}

.gcm-cc-btn {
	flex: 1 1 auto;
	min-width: 110px;
	padding: 12px 20px;
	border: 2px solid transparent;
	border-radius: 10px;
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
	text-align: center;
	line-height: 1.3;
}

/* Refuser : sobre mais bien visible (équivalence CNIL) */
.gcm-cc-btn-secondary {
	background: #fff;
	color: var(--gcm-cc-text);
	border-color: var(--gcm-cc-border);
}
.gcm-cc-btn-secondary:hover {
	background: #f9fafb;
	border-color: #d1d5db;
}

/* Personnaliser : link-style */
.gcm-cc-btn-tertiary {
	background: transparent;
	color: var(--gcm-cc-text-muted);
	border-color: transparent;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.gcm-cc-btn-tertiary:hover {
	color: var(--gcm-cc-primary);
}

/* Accepter : CTA principal */
.gcm-cc-btn-primary {
	background: var(--gcm-cc-primary);
	color: #fff;
	border-color: var(--gcm-cc-primary);
	box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.4);
}
.gcm-cc-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px -2px rgba(37, 99, 235, 0.55);
	filter: brightness(1.05);
}
.gcm-cc-btn-primary:active {
	transform: translateY(0);
}

/* Highlight Accept : plus grand pour augmenter le taux d'acceptation */
.gcm-cc-banner.gcm-cc-highlight .gcm-cc-btn-primary {
	flex: 2 1 auto;
	font-size: 15.5px;
	padding: 14px 24px;
}
.gcm-cc-banner.gcm-cc-highlight .gcm-cc-btn-primary::before {
	content: "✓ ";
	font-weight: 700;
}

/* === LAYOUT BANNIÈRE BAS === */
.gcm-cc-pos-bottom .gcm-cc-inner {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 28px;
	align-items: center;
}
.gcm-cc-pos-bottom .gcm-cc-content { min-width: 0; }
.gcm-cc-pos-bottom .gcm-cc-actions {
	flex-direction: column;
	align-items: stretch;
	min-width: 280px;
}
.gcm-cc-pos-bottom[data-view="customize"] .gcm-cc-inner,
.gcm-cc-pos-bottom .gcm-cc-customize { grid-column: 1 / -1; }

/* === VUE CUSTOMIZE === */
.gcm-cc-customize {
	margin-top: 4px;
}
.gcm-cc-customize h3 {
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 700;
}

.gcm-cc-category {
	border: 1px solid var(--gcm-cc-border);
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 10px;
	background: #fafafa;
}
.gcm-cc-cat-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	cursor: pointer;
}
.gcm-cc-cat-name {
	font-weight: 600;
	font-size: 14.5px;
	color: var(--gcm-cc-text);
}
.gcm-cc-cat-required {
	background: var(--gcm-cc-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.gcm-cc-cat-desc {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--gcm-cc-text-muted);
	line-height: 1.5;
}

/* Toggle switch */
.gcm-cc-toggle {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 24px;
	flex-shrink: 0;
}
.gcm-cc-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}
.gcm-cc-toggle-slider {
	position: absolute;
	inset: 0;
	background: #d1d5db;
	border-radius: 24px;
	cursor: pointer;
	transition: 0.25s;
}
.gcm-cc-toggle-slider::before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	transition: 0.25s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.gcm-cc-toggle input:checked + .gcm-cc-toggle-slider {
	background: var(--gcm-cc-primary);
}
.gcm-cc-toggle input:checked + .gcm-cc-toggle-slider::before {
	transform: translateX(18px);
}

/* === BOUTON RÉOUVERTURE === */
.gcm-cc-reopen {
	position: fixed;
	bottom: 16px;
	left: 16px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--gcm-cc-border);
	background: #fff;
	color: var(--gcm-cc-text-muted);
	cursor: pointer;
	z-index: 99998;
	box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	opacity: 0.85;
}
.gcm-cc-reopen:hover {
	opacity: 1;
	color: var(--gcm-cc-primary);
	transform: scale(1.08);
}

/* === ANIMATIONS === */
@keyframes gcm-cc-slide-up {
	from { transform: translateY(40px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}
@keyframes gcm-cc-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
	.gcm-cc-pos-bottom { padding: 8px; }
	.gcm-cc-pos-bottom .gcm-cc-inner {
		grid-template-columns: 1fr;
		padding: 20px;
		gap: 16px;
	}
	.gcm-cc-pos-bottom .gcm-cc-actions {
		min-width: 0;
		flex-direction: column;
	}
	.gcm-cc-pos-bottom-left,
	.gcm-cc-pos-bottom-right {
		left: 8px;
		right: 8px;
		bottom: 8px;
		max-width: none;
	}
	.gcm-cc-title { font-size: 17px; padding-right: 32px; }
	.gcm-cc-text { font-size: 14px; }
	.gcm-cc-actions { flex-direction: column; }
	.gcm-cc-btn { width: 100%; }
	.gcm-cc-banner.gcm-cc-highlight .gcm-cc-btn-primary { flex: 1 1 auto; }
}

/* === DARK MODE (auto) === */
@media (prefers-color-scheme: dark) {
	.gcm-cc-banner:not(.gcm-cc-light) {
		--gcm-cc-bg: #1f2937;
		--gcm-cc-text: #f3f4f6;
		--gcm-cc-text-muted: #9ca3af;
		--gcm-cc-border: #374151;
	}
	.gcm-cc-banner:not(.gcm-cc-light) .gcm-cc-close {
		background: #374151;
		color: #d1d5db;
	}
	.gcm-cc-banner:not(.gcm-cc-light) .gcm-cc-btn-secondary {
		background: #374151;
		color: #f3f4f6;
		border-color: #4b5563;
	}
	.gcm-cc-banner:not(.gcm-cc-light) .gcm-cc-category {
		background: #111827;
		border-color: #374151;
	}
	.gcm-cc-reopen {
		background: #1f2937;
		border-color: #374151;
		color: #9ca3af;
	}
}
