/**
 * CuboMax Consent — layout only; text colors inherit from the active theme.
 * Modal surfaces always use a white background.
 * Prefix: cbmx-consent-
 */

.cbmx-consent-root {
	box-sizing: border-box;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	background-color: transparent;
	z-index: 99999;
}

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

.cbmx-consent-root[hidden] {
	display: none !important;
}

.cbmx-consent-btn {
	appearance: none;
	border: 1px solid currentColor;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.9em;
	padding: 0.55rem 0.9rem;
	cursor: pointer;
	border-radius: 2px;
	text-decoration: none;
	line-height: 1.2;
}

.cbmx-consent-btn:hover,
.cbmx-consent-btn:focus-visible {
	outline: none;
	opacity: 0.85;
}

.cbmx-consent-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.cbmx-consent-btn--primary {
	font-weight: 600;
	background-color: CanvasText;
	border-color: CanvasText;
	color: Canvas;
}

.cbmx-consent-btn--primary:hover,
.cbmx-consent-btn--primary:focus-visible {
	opacity: 0.88;
}

.cbmx-consent-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	z-index: 100000;
}

.cbmx-consent-overlay[hidden] {
	display: none !important;
}

.cbmx-consent-modal {
	position: relative;
	display: block;
	width: min(32rem, 100%);
	max-height: min(90vh, 50rem);
	overflow: auto;
	/* Opaque white surface — do not inherit from the dimming overlay. */
	background-color: #d8d8d8;
	color: CanvasText;
	border: 1px solid currentColor;
	border-radius: 4px;
	padding: 1.35rem 1.5rem 1.5rem;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
	line-height: 1.45;
	text-align: left;
}

.cbmx-consent-modal[hidden] {
	display: none !important;
}

.cbmx-consent-modal__title {
	display: block;
	margin: 0 0 1.1rem;
	padding: 0;
	font-size: 1.2em;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
}

.cbmx-consent-notice__desc {
	display: block;
	margin: 0 0 1.35rem;
	padding: 0;
	font-size: 0.95em;
	color: inherit;
	opacity: 0.85;
	line-height: 1.45;
}

.cbmx-consent-notice__desc a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	opacity: 1;
}

.cbmx-consent-notice__actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.55rem;
}

.cbmx-consent-notice__actions .cbmx-consent-btn {
	width: 100%;
	min-height: 2.75rem;
	text-align: center;
}

.cbmx-consent-cat {
	display: block;
	border-top: 1px solid currentColor;
	padding: 1rem 0;
	margin: 0;
	clear: both;
	overflow: visible;
}

.cbmx-consent-cat:last-of-type {
	border-bottom: 1px solid currentColor;
	margin-bottom: 1.25rem;
}

.cbmx-consent-cat__row {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.25rem;
	width: 100%;
}

.cbmx-consent-cat__text {
	flex: 1 1 auto;
	min-width: 0;
	display: block;
}

.cbmx-consent-cat__label {
	display: block;
	margin: 0;
	padding: 0;
	font-weight: 600;
	font-size: 0.98em;
	line-height: 1.35;
	color: inherit;
}

.cbmx-consent-cat__desc {
	display: block;
	margin: 0.35rem 0 0;
	padding: 0;
	font-size: 0.88em;
	line-height: 1.4;
	color: inherit;
	opacity: 0.75;
}

.cbmx-consent-switch {
	position: relative;
	display: inline-block;
	flex: 0 0 2.75rem;
	width: 2.75rem;
	height: 1.55rem;
	margin: 0.15rem 0 0;
	padding: 0;
	cursor: pointer;
}

.cbmx-consent-switch input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
	z-index: 1;
}

.cbmx-consent-switch input:disabled {
	cursor: not-allowed;
}

.cbmx-consent-switch__track {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 999px;
	background: transparent;
	border: 1px solid currentColor;
	opacity: 0.45;
	transition: opacity 0.15s ease;
	box-sizing: border-box;
}

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

.cbmx-consent-switch input:checked + .cbmx-consent-switch__track {
	opacity: 1;
}

.cbmx-consent-switch input:checked + .cbmx-consent-switch__track::after {
	transform: translateX(1.15rem);
}

.cbmx-consent-switch input:focus-visible + .cbmx-consent-switch__track {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	opacity: 1;
}

.cbmx-consent-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	justify-content: stretch;
	margin-top: 0.25rem;
}

.cbmx-consent-modal__actions .cbmx-consent-btn {
	flex: 1 1 auto;
	min-height: 2.75rem;
	text-align: center;
}
