/**
 * Flavor Cookie Consent - Frontend styles v3
 *
 * Two axis class system:
 *   .fcc-layout-{bar|popup|sidebar|floating} + .fcc-pos-{position}
 * Every visual token is a CSS custom property so the custom theme
 * and site CSS can override safely. Dark theme via [data-fcc-theme].
 *
 * Author: Binaire 01 | https://www.binaire01.fr | hi@binaire01.fr
 */

#fcc-root {
	--fcc-bg: #ffffff;
	--fcc-text: #2b2b33;
	--fcc-muted: #6b7078;
	--fcc-link: #0f6fae;
	--fcc-accept-bg: #1f7a3d;
	--fcc-accept-text: #ffffff;
	--fcc-reject-bg: #5a5f66;
	--fcc-reject-text: #ffffff;
	--fcc-settings-bg: #eef0f2;
	--fcc-settings-text: #2b2b33;
	--fcc-toggle-on: #1f7a3d;
	--fcc-toggle-off: #c6c9cd;
	--fcc-overlay: rgba(15, 17, 20, 0.55);
	--fcc-border: rgba(0, 0, 0, 0.08);
	--fcc-radius: 10px;
	--fcc-font-size: 14px;
	--fcc-shadow: 0 12px 40px rgba(10, 12, 16, 0.18);
	--fcc-z: 999990;
	font-size: var(--fcc-font-size);
	line-height: 1.5;
	color: var(--fcc-text);
	-webkit-font-smoothing: antialiased;
}

#fcc-root[data-fcc-theme="dark"] {
	--fcc-bg: #191b1f;
	--fcc-text: #e8eaed;
	--fcc-muted: #9aa0a6;
	--fcc-link: #6fb6e8;
	--fcc-settings-bg: #2a2d33;
	--fcc-settings-text: #e8eaed;
	--fcc-border: rgba(255, 255, 255, 0.1);
	--fcc-overlay: rgba(0, 0, 0, 0.65);
	--fcc-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

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

.fcc-hidden { display: none !important; }

.fcc-visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	clip: rect(0 0 0 0); overflow: hidden;
}

/* Overlay ----------------------------------------------------------- */

.fcc-overlay {
	position: fixed;
	inset: 0;
	background: var(--fcc-overlay);
	backdrop-filter: blur(2px);
	z-index: var(--fcc-z);
	opacity: 0;
	transition: opacity 0.3s ease;
}
.fcc-overlay.fcc-visible { opacity: 1; }

/* Banner core ------------------------------------------------------- */

.fcc-banner {
	position: fixed;
	z-index: calc(var(--fcc-z) + 2);
	background: var(--fcc-bg);
	color: var(--fcc-text);
	box-shadow: var(--fcc-shadow);
	opacity: 0;
	transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.fcc-banner.fcc-visible { opacity: 1; transform: none; }

.fcc-banner-content { padding: 20px 24px; }

.fcc-banner-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}
.fcc-banner-title {
	margin: 0 0 6px;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
	color: var(--fcc-text);
}
.fcc-banner-close {
	flex: 0 0 auto;
	width: 30px; height: 30px;
	border: 1px solid var(--fcc-border);
	border-radius: 50%;
	background: transparent;
	color: var(--fcc-muted);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}
.fcc-banner-close:hover { background: var(--fcc-settings-bg); color: var(--fcc-text); }

.fcc-banner-logo { max-height: 34px; margin-bottom: 10px; display: block; }
.fcc-banner-text { margin: 0 0 10px; color: var(--fcc-text); }
.fcc-banner-links { margin: 0 0 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.fcc-banner-links a { color: var(--fcc-link); text-decoration: underline; }
.fcc-banner-withdraw { margin: 12px 0 0; font-size: 0.85em; color: var(--fcc-muted); }

/* Buttons: identical size and weight, only color differs.
   This enforces the AEPD strict parity between accept and reject. */

.fcc-banner-actions,
.fcc-panel-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: stretch;
}
.fcc-btn {
	flex: 1 1 150px;
	min-height: 44px;
	padding: 10px 18px;
	border: 0;
	border-radius: var(--fcc-radius);
	font-size: 1em;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	cursor: pointer;
	text-align: center;
	transition: filter 0.2s ease, transform 0.1s ease;
}
.fcc-btn:hover { filter: brightness(1.08); }
.fcc-btn:active { transform: scale(0.98); }
.fcc-btn-accept { background: var(--fcc-accept-bg); color: var(--fcc-accept-text); }
.fcc-btn-reject { background: var(--fcc-reject-bg); color: var(--fcc-reject-text); }
.fcc-btn-save { background: var(--fcc-accept-bg); color: var(--fcc-accept-text); }
.fcc-btn-settings { background: var(--fcc-settings-bg); color: var(--fcc-settings-text); border: 1px solid var(--fcc-border); }

#fcc-root button:focus-visible,
#fcc-root a:focus-visible,
#fcc-root input:focus-visible + .fcc-toggle-slider {
	outline: 3px solid var(--fcc-link);
	outline-offset: 2px;
}

/* Layout: bar ------------------------------------------------------- */

.fcc-layout-bar {
	left: 0; right: 0;
	max-height: 90vh;
	overflow: auto;
	transform: translateY(30px);
}
.fcc-layout-bar.fcc-pos-bottom { bottom: 0; border-top: 1px solid var(--fcc-border); }
.fcc-layout-bar.fcc-pos-top { top: 0; transform: translateY(-30px); border-bottom: 1px solid var(--fcc-border); }

@media (min-width: 900px) {
	.fcc-layout-bar .fcc-banner-content {
		max-width: 1200px;
		margin: 0 auto;
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"head actions"
			"text actions"
			"links actions"
			"withdraw actions";
		column-gap: 32px;
		align-items: center;
	}
	.fcc-layout-bar .fcc-banner-head { grid-area: head; }
	.fcc-layout-bar .fcc-banner-text { grid-area: text; }
	.fcc-layout-bar .fcc-banner-links { grid-area: links; }
	.fcc-layout-bar .fcc-banner-withdraw { grid-area: withdraw; }
	.fcc-layout-bar .fcc-banner-actions { grid-area: actions; flex-direction: column; min-width: 240px; }
	.fcc-layout-bar .fcc-btn { flex: 0 0 auto; }
}

/* Layout: popup ----------------------------------------------------- */

.fcc-layout-popup {
	left: 50%;
	top: 50%;
	width: min(560px, calc(100vw - 32px));
	max-height: 86vh;
	overflow: auto;
	border-radius: calc(var(--fcc-radius) + 4px);
	transform: translate(-50%, -46%) scale(0.96);
}
.fcc-layout-popup.fcc-visible { transform: translate(-50%, -50%) scale(1); }

/* Layout: sidebar --------------------------------------------------- */

.fcc-layout-sidebar {
	top: 0; bottom: 0;
	width: min(420px, 92vw);
	overflow: auto;
}
.fcc-layout-sidebar.fcc-pos-bottom-left,
.fcc-layout-sidebar.fcc-pos-bottom,
.fcc-layout-sidebar.fcc-pos-top { left: 0; transform: translateX(-40px); }
.fcc-layout-sidebar.fcc-pos-bottom-right,
.fcc-layout-sidebar.fcc-pos-center { right: 0; transform: translateX(40px); }
.fcc-layout-sidebar .fcc-banner-actions { flex-direction: column; }
.fcc-layout-sidebar .fcc-btn { flex: 0 0 auto; }

/* Layout: floating card --------------------------------------------- */

.fcc-layout-floating {
	width: min(400px, calc(100vw - 32px));
	max-height: 80vh;
	overflow: auto;
	border-radius: calc(var(--fcc-radius) + 4px);
	border: 1px solid var(--fcc-border);
	transform: translateY(24px);
}
.fcc-layout-floating.fcc-pos-bottom-left { left: 16px; bottom: 16px; }
.fcc-layout-floating.fcc-pos-bottom-right,
.fcc-layout-floating.fcc-pos-bottom { right: 16px; bottom: 16px; }
.fcc-layout-floating.fcc-pos-top { right: 16px; top: 16px; }
.fcc-layout-floating.fcc-pos-center { left: 16px; bottom: 16px; }
.fcc-layout-floating .fcc-banner-actions { flex-direction: column; }
.fcc-layout-floating .fcc-btn { flex: 0 0 auto; }

/* Preferences panel ------------------------------------------------- */

.fcc-panel {
	position: fixed;
	left: 50%;
	top: 50%;
	z-index: calc(var(--fcc-z) + 3);
	width: min(680px, calc(100vw - 32px));
	max-height: 88vh;
	background: var(--fcc-bg);
	color: var(--fcc-text);
	border-radius: calc(var(--fcc-radius) + 4px);
	box-shadow: var(--fcc-shadow);
	opacity: 0;
	transform: translate(-50%, -46%) scale(0.97);
	transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
	display: flex;
}
.fcc-panel.fcc-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.fcc-panel-inner { display: flex; flex-direction: column; width: 100%; max-height: 88vh; }

.fcc-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	border-bottom: 1px solid var(--fcc-border);
}
.fcc-panel-title { margin: 0; font-size: 1.15em; font-weight: 700; color: var(--fcc-text); }
.fcc-panel-close {
	width: 32px; height: 32px;
	border: 1px solid var(--fcc-border);
	border-radius: 50%;
	background: transparent;
	color: var(--fcc-muted);
	font-size: 18px;
	cursor: pointer;
	transition: background 0.2s ease;
}
.fcc-panel-close:hover { background: var(--fcc-settings-bg); color: var(--fcc-text); }

.fcc-panel-body { padding: 16px 24px; overflow: auto; flex: 1 1 auto; }
.fcc-panel-actions { padding: 16px 24px; border-top: 1px solid var(--fcc-border); }

/* Category cards ---------------------------------------------------- */

.fcc-category {
	border: 1px solid var(--fcc-border);
	border-radius: var(--fcc-radius);
	padding: 14px 16px;
	margin-bottom: 12px;
	background: var(--fcc-bg);
}
.fcc-category-head { display: flex; align-items: center; gap: 12px; }
.fcc-category-label { font-size: 1em; }
.fcc-required-badge {
	margin-left: auto;
	font-size: 0.78em;
	font-weight: 600;
	color: var(--fcc-accept-bg);
	background: color-mix(in srgb, var(--fcc-accept-bg) 12%, transparent);
	border: 1px solid color-mix(in srgb, var(--fcc-accept-bg) 30%, transparent);
	padding: 2px 10px;
	border-radius: 999px;
	white-space: nowrap;
}
.fcc-category-desc { margin: 8px 0 0 52px; color: var(--fcc-muted); font-size: 0.92em; }

/* Toggle switch ----------------------------------------------------- */

.fcc-toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.fcc-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.fcc-toggle-slider {
	position: absolute; inset: 0;
	background: var(--fcc-toggle-off);
	border-radius: 999px;
	transition: background 0.25s ease;
	pointer-events: none;
}
.fcc-toggle-slider::before {
	content: "";
	position: absolute;
	top: 2px; left: 2px;
	width: 18px; height: 18px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fcc-toggle input:checked + .fcc-toggle-slider { background: var(--fcc-toggle-on); }
.fcc-toggle input:checked + .fcc-toggle-slider::before { transform: translateX(18px); }
.fcc-toggle input:disabled + .fcc-toggle-slider { opacity: 0.55; cursor: not-allowed; }
.fcc-toggle-small { width: 34px; height: 19px; }
.fcc-toggle-small .fcc-toggle-slider::before { width: 15px; height: 15px; }
.fcc-toggle-small input:checked + .fcc-toggle-slider::before { transform: translateX(15px); }

/* Services inside a category ---------------------------------------- */

.fcc-service-list { margin: 12px 0 0 52px; border-top: 1px dashed var(--fcc-border); padding-top: 10px; }
.fcc-service-list-label {
	margin: 0 0 6px;
	font-size: 0.78em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--fcc-muted);
}
.fcc-service { padding: 6px 0; }
.fcc-service-head { display: flex; align-items: center; gap: 10px; }
.fcc-service-label { font-size: 0.95em; }
.fcc-service-details {
	margin-left: auto;
	width: 26px; height: 26px;
	border: 1px solid var(--fcc-border);
	border-radius: 6px;
	background: transparent;
	color: var(--fcc-muted);
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
}
.fcc-service-details:hover { background: var(--fcc-settings-bg); color: var(--fcc-text); }
.fcc-service-desc { margin: 4px 0 0 44px; font-size: 0.85em; color: var(--fcc-muted); }

.fcc-cookie-table {
	width: calc(100% - 44px);
	margin: 8px 0 4px 44px;
	border-collapse: collapse;
	font-size: 0.82em;
}
.fcc-cookie-table th,
.fcc-cookie-table td {
	text-align: left;
	padding: 5px 8px;
	border-bottom: 1px solid var(--fcc-border);
	color: var(--fcc-text);
}
.fcc-cookie-table th { color: var(--fcc-muted); font-weight: 600; }

/* Float button ------------------------------------------------------ */

.fcc-float {
	position: fixed;
	bottom: 16px;
	z-index: calc(var(--fcc-z) + 1);
	width: 48px; height: 48px;
	border: 1px solid var(--fcc-border);
	border-radius: 50%;
	background: var(--fcc-bg);
	box-shadow: 0 4px 16px rgba(10, 12, 16, 0.2);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: transform 0.2s ease;
}
.fcc-float:hover { transform: scale(1.08); }
.fcc-float-bottom-left { left: 16px; }
.fcc-float-bottom-right { right: 16px; }

/* Do Not Sell link (US) --------------------------------------------- */

.fcc-dnss {
	position: fixed;
	bottom: 6px;
	left: 50%;
	transform: translateX(-50%);
	z-index: var(--fcc-z);
	font-size: 12px;
	color: var(--fcc-muted);
	background: var(--fcc-bg);
	border: 1px solid var(--fcc-border);
	border-radius: 999px;
	padding: 4px 14px;
	text-decoration: none;
	opacity: 0.9;
}
.fcc-dnss:hover { opacity: 1; color: var(--fcc-link); }
.fcc-dnss-trigger { color: inherit; text-decoration: underline; cursor: pointer; }

/* Blocked content placeholders -------------------------------------- */

.fcc-placeholder {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 220px;
	aspect-ratio: 16 / 9;
	max-width: 100%;
	padding: 24px;
	background: var(--fcc-settings-bg, #eef0f2);
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 10px;
	text-align: center;
	color: #2b2b33;
	font-size: 14px;
	line-height: 1.5;
}
.fcc-placeholder-icon { font-size: 30px; }
.fcc-placeholder-text { margin: 0; max-width: 420px; }
.fcc-placeholder-btn {
	border: 0;
	border-radius: 8px;
	background: #1f7a3d;
	color: #ffffff;
	font-weight: 600;
	font-size: 14px;
	padding: 10px 20px;
	cursor: pointer;
}
.fcc-placeholder-btn:hover { filter: brightness(1.08); }
.fcc-restored-frame { max-width: 100%; }

/* Toast ------------------------------------------------------------- */

.fcc-toast {
	position: fixed;
	bottom: 76px;
	left: 50%;
	transform: translate(-50%, 12px);
	z-index: calc(var(--fcc-z) + 4);
	background: var(--fcc-text);
	color: var(--fcc-bg);
	padding: 10px 20px;
	border-radius: 999px;
	font-size: 13px;
	box-shadow: var(--fcc-shadow);
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	max-width: calc(100vw - 32px);
}
.fcc-toast.fcc-visible { opacity: 1; transform: translate(-50%, 0); }

/* Cookie policy shortcode table ------------------------------------- */

.fcc-policy-table { width: 100%; border-collapse: collapse; margin: 12px 0 24px; }
.fcc-policy-table th,
.fcc-policy-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid rgba(0, 0, 0, 0.12); }
.fcc-open-prefs {
	border: 0;
	border-radius: 8px;
	background: #1f7a3d;
	color: #ffffff;
	font-weight: 600;
	padding: 10px 20px;
	cursor: pointer;
}

/* Mobile ------------------------------------------------------------ */

@media (max-width: 600px) {
	.fcc-banner-content { padding: 16px; }
	.fcc-banner-actions { flex-direction: column; }
	.fcc-btn { flex: 0 0 auto; width: 100%; }
	.fcc-category-desc,
	.fcc-service-list { margin-left: 0; }
	.fcc-cookie-table { width: 100%; margin-left: 0; }
	.fcc-service-desc { margin-left: 0; }
	.fcc-panel { width: calc(100vw - 16px); max-height: 92vh; }
}

/* Reduced motion ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	#fcc-root * { transition: none !important; animation: none !important; }
}
