/* Conexiala Data Compliance — frontend. Colores desde Configuración (--cxd-*). */

.cxd,
.cxd-prefs--inline,
.cxd-blocked-embed {
	--cxd-bg: #ffffff;
	--cxd-fg: #1d2327;
	--cxd-accent: #1e4fd6;
	--cxd-accent-fg: #ffffff;
	--cxd-radius: 10px;
	--cxd-shadow: 0 8px 30px rgba( 0, 0, 0, 0.18 );
}

.cxd *,
.cxd-prefs--inline *,
.cxd-blocked-embed * {
	box-sizing: border-box;
}

.cxd [hidden] {
	display: none !important;
}

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

.cxd-banner {
	position: fixed;
	z-index: 2147483000;
	bottom: 16px;
	left: 16px;
	right: 16px;
	max-width: 960px;
	margin: 0 auto;
	padding: 20px 24px;
	background: var( --cxd-bg );
	color: var( --cxd-fg );
	border-radius: var( --cxd-radius );
	box-shadow: var( --cxd-shadow );
	font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.cxd--bottom-left .cxd-banner,
.cxd--bottom-right .cxd-banner {
	max-width: 420px;
	margin: 0;
}

.cxd--bottom-left .cxd-banner { right: auto; }
.cxd--bottom-right .cxd-banner { left: auto; }

.cxd-banner__title,
.cxd-prefs__title {
	margin: 0 0 6px;
	font-size: 18px;
	line-height: 1.3;
	color: inherit;
}

.cxd-banner__body {
	margin: 0 0 14px;
}

.cxd-banner__link {
	color: inherit;
	text-decoration: underline;
}

.cxd-banner__actions,
.cxd-prefs__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
}

/* Botones: el mismo peso visual para aceptar, rechazar y configurar. */
.cxd-btn {
	flex: 1 1 auto;
	min-height: 44px;
	padding: 10px 18px;
	border: 2px solid var( --cxd-accent );
	border-radius: 8px;
	background: var( --cxd-accent );
	color: var( --cxd-accent-fg );
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.cxd-btn:hover {
	filter: brightness( 1.1 );
}

.cxd-btn--secondary {
	background: transparent;
	color: var( --cxd-fg );
	border-color: currentColor;
}

.cxd-btn:focus-visible,
.cxd-switch:focus-visible,
.cxd-floating:focus-visible,
.cxd-banner__link:focus-visible,
.cxd-blocked-embed__allow:focus-visible {
	outline: 3px solid var( --cxd-accent );
	outline-offset: 3px;
}

.cxd-status:empty {
	display: none;
}

.cxd-status {
	margin: 0 0 10px;
	font-weight: 600;
}

/* Diálogo y panel ---------------------------------------------------------- */

.cxd-dialog {
	width: min( 560px, calc( 100vw - 32px ) );
	max-height: calc( 100vh - 32px );
	padding: 24px;
	border: 0;
	border-radius: var( --cxd-radius );
	background: var( --cxd-bg );
	color: var( --cxd-fg );
	box-shadow: var( --cxd-shadow );
	font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.cxd-dialog::backdrop {
	background: rgba( 0, 0, 0, 0.5 );
}

.cxd-prefs--inline {
	max-width: 640px;
	font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	padding: 24px;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: var( --cxd-radius );
	background: var( --cxd-bg );
	color: var( --cxd-fg );
}

.cxd-prefs__intro {
	margin: 0 0 12px;
	font-size: inherit;
}

.cxd-prefs__list {
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.cxd-purpose {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
	border-top: 1px solid rgba( 127, 127, 127, 0.3 );
}

.cxd-purpose__name {
	margin: 0;
	font-size: 16px;
	color: inherit;
}

.cxd-purpose__desc {
	margin: 2px 0 0;
	font-size: 14px;
	opacity: 0.85;
}

.cxd-purpose__always {
	flex: none;
	font-size: 14px;
	font-weight: 600;
}

/* Interruptor: estado por forma y por texto, no sólo por color. */
.cxd-switch {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 4px;
	border: 0;
	background: none;
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}

.cxd-switch__track {
	position: relative;
	width: 44px;
	height: 24px;
	border: 2px solid currentColor;
	border-radius: 12px;
}

.cxd-switch__track::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: currentColor;
	transition: transform 0.15s;
}

.cxd-switch[aria-checked="true"] .cxd-switch__track {
	background: var( --cxd-accent );
	border-color: var( --cxd-accent );
}

.cxd-switch[aria-checked="true"] .cxd-switch__track::after {
	transform: translateX( 20px );
	background: var( --cxd-accent-fg );
}

.cxd-switch__label {
	min-width: 6.5em;
	text-align: left;
}

/* Botón flotante ----------------------------------------------------------- */

.cxd-floating {
	position: fixed;
	z-index: 2147482999;
	left: 16px;
	bottom: 16px;
	min-height: 40px;
	padding: 8px 14px;
	border: 0;
	border-radius: 20px;
	background: var( --cxd-bg );
	color: var( --cxd-fg );
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.25 );
	font: 600 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	cursor: pointer;
}

/* Iframes bloqueados --------------------------------------------------------- */

.cxd-blocked-embed {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	min-height: 200px;
	margin: 0 0 1em;
	padding: 24px;
	background: #f0f0f1;
	color: #1d2327;
	border-radius: 8px;
	text-align: center;
}

.cxd-blocked-embed__text {
	margin: 0;
	max-width: 36em;
}

.cxd-blocked-embed__allow {
	min-height: 44px;
	padding: 10px 18px;
	border: 0;
	border-radius: 8px;
	background: #1e4fd6;
	color: #ffffff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

@media ( max-width: 600px ) {
	.cxd-banner {
		left: 8px;
		right: 8px;
		bottom: 8px;
		padding: 16px;
	}

	.cxd-banner__actions .cxd-btn {
		flex-basis: 100%;
	}

	.cxd-purpose {
		flex-wrap: wrap;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.cxd-switch__track::after {
		transition: none;
	}
}

/* Crédito ------------------------------------------------------------------ */

.cxd-credit {
	margin: 12px 0 0;
	font-size: 12px;
	line-height: 1.4;
	text-align: right;
	opacity: 0.75;
}

.cxd .cxd-credit a {
	color: inherit;
	text-decoration: none;
}

.cxd .cxd-credit a:hover,
.cxd .cxd-credit a:focus-visible {
	text-decoration: underline;
	opacity: 1;
}
