/* Cookie Consent Asso — styles front-end.
   Tout est préfixé .cca- et scopé sous #cca-root pour ne pas casser le thème.
   Personnalisez facilement via les variables ci-dessous. */

#cca-root {
	--cca-bg: #ffffff;
	--cca-fg: #1f2933;
	--cca-muted: #5c6773;
	--cca-border: #e4e7eb;
	--cca-primary: #2f6f4f;        /* vert sobre, change selon votre charte */
	--cca-primary-fg: #ffffff;
	--cca-radius: 12px;
	--cca-shadow: 0 8px 30px rgba(0, 0, 0, .18);
	--cca-z: 999999;
	font-family: inherit;
	color: var(--cca-fg);
}

#cca-root *, #cca-root *::before, #cca-root *::after { box-sizing: border-box; }

/* ---------- Bandeau ---------- */
.cca-banner {
	position: fixed;
	z-index: var(--cca-z);
	left: 0; right: 0; bottom: 0;
	background: var(--cca-bg);
	border-top: 1px solid var(--cca-border);
	box-shadow: var(--cca-shadow);
	padding: 18px 20px;
	animation: cca-up .25s ease-out;
}
.cca-pos-bottom-left .cca-banner,
.cca-pos-bottom-right .cca-banner {
	left: auto; right: auto;
	max-width: 420px;
	margin: 16px;
	border: 1px solid var(--cca-border);
	border-radius: var(--cca-radius);
}
.cca-pos-bottom-left .cca-banner { left: 0; bottom: 0; }
.cca-pos-bottom-right .cca-banner { right: 0; bottom: 0; }

.cca-banner-in {
	max-width: 1100px;
	margin: 0 auto;
	display: flex;
	gap: 22px;
	align-items: center;
	flex-wrap: wrap;
}
.cca-pos-bottom-left .cca-banner-in,
.cca-pos-bottom-right .cca-banner-in { display: block; }

.cca-text { flex: 1 1 420px; }
.cca-title { font-size: 1.05rem; margin: 0 0 6px; font-weight: 700; }
.cca-msg { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--cca-muted); }
.cca-link { color: var(--cca-primary); text-decoration: underline; }

.cca-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cca-pos-bottom-left .cca-actions,
.cca-pos-bottom-right .cca-actions { margin-top: 14px; }

/* ---------- Boutons ---------- */
.cca-btn {
	font: inherit;
	font-size: .88rem;
	font-weight: 600;
	cursor: pointer;
	border-radius: 8px;
	padding: 10px 16px;
	border: 1px solid var(--cca-border);
	background: #f3f5f7;
	color: var(--cca-fg);
	transition: filter .15s ease, background .15s ease;
}
.cca-btn:hover { filter: brightness(.97); }
.cca-btn-ghost { background: transparent; }
.cca-btn-primary { background: var(--cca-primary); border-color: var(--cca-primary); color: var(--cca-primary-fg); }

/* ---------- Bouton flottant "Gérer les cookies" ---------- */
.cca-manage {
	position: fixed;
	left: 16px; bottom: 16px;
	z-index: calc(var(--cca-z) - 1);
	font: inherit;
	font-size: .8rem;
	background: var(--cca-bg);
	color: var(--cca-fg);
	border: 1px solid var(--cca-border);
	border-radius: 30px;
	padding: 8px 14px;
	box-shadow: 0 2px 10px rgba(0,0,0,.12);
	cursor: pointer;
}
.cca-manage:hover { filter: brightness(.97); }

/* ---------- Modal de préférences ---------- */
.cca-modal {
	position: fixed; inset: 0;
	z-index: calc(var(--cca-z) + 1);
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
}
.cca-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.cca-modal-box {
	position: relative;
	background: var(--cca-bg);
	border-radius: var(--cca-radius);
	box-shadow: var(--cca-shadow);
	max-width: 640px; width: 100%;
	max-height: 85vh; overflow-y: auto;
	padding: 26px;
	animation: cca-up .2s ease-out;
}
.cca-close {
	position: absolute; top: 10px; right: 12px;
	background: none; border: none; font-size: 1.6rem; line-height: 1;
	cursor: pointer; color: var(--cca-muted);
}

.cca-cat { border: 1px solid var(--cca-border); border-radius: 10px; padding: 14px; margin: 14px 0; }
.cca-cat-head { display: flex; gap: 14px; align-items: flex-start; }
.cca-cat-title { display: block; font-size: .95rem; }
.cca-cat-desc { display: block; font-size: .82rem; color: var(--cca-muted); margin-top: 3px; }
.cca-always { font-style: normal; font-size: .72rem; color: var(--cca-primary); margin-left: 6px; }

.cca-actions-modal { margin-top: 18px; justify-content: flex-end; }

/* ---------- Interrupteur ---------- */
.cca-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.cca-switch input { opacity: 0; width: 0; height: 0; }
.cca-slider {
	position: absolute; inset: 0; cursor: pointer;
	background: #cfd4da; border-radius: 24px; transition: background .2s;
}
.cca-slider::before {
	content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
	background: #fff; border-radius: 50%; transition: transform .2s;
}
.cca-switch input:checked + .cca-slider { background: var(--cca-primary); }
.cca-switch input:checked + .cca-slider::before { transform: translateX(20px); }
.cca-switch input:disabled + .cca-slider { opacity: .6; cursor: not-allowed; }

/* ---------- Table des cookies ---------- */
.cca-details { margin-top: 10px; }
.cca-details summary { cursor: pointer; font-size: .82rem; color: var(--cca-primary); }
.cca-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .78rem; }
.cca-table th, .cca-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--cca-border); vertical-align: top; }
.cca-table th { color: var(--cca-muted); font-weight: 600; }
.cca-table code { font-size: .76rem; }

/* ---------- Placeholder iframe ---------- */
.cca-ph {
	border: 1px dashed var(--cca-border);
	border-radius: 10px;
	padding: 24px;
	text-align: center;
	background: #f7f8f9;
	color: var(--cca-muted);
	font-size: .88rem;
}
.cca-ph p { margin: 0 0 12px; }

@keyframes cca-up { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
	.cca-banner-in { display: block; }
	.cca-actions { margin-top: 14px; }
	.cca-btn { flex: 1 1 auto; text-align: center; }
}

/* ---------- Respect du thème sombre éventuel (optionnel) ---------- */
@media (prefers-color-scheme: dark) {
	#cca-root {
		--cca-bg: #1e242b;
		--cca-fg: #e6e9ec;
		--cca-muted: #9aa4af;
		--cca-border: #333b44;
	}
	.cca-btn { background: #2a313a; }
	.cca-ph { background: #232931; }
	.cca-slider { background: #4a525c; }
}
