/**
 * Big Block Consent — front-end banner + preferences modal.
 * Colors are supplied at runtime via CSS custom properties set inline.
 */

.bbc-root,
.bbc-modal,
.bbc-reopen {
	--bbc-bg: #1e293b;
	--bbc-text: #f8fafc;
	--bbc-primary: #22c55e;
	--bbc-secondary: #475569;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

.bbc-root *,
.bbc-modal * {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

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

.bbc-banner {
	position: fixed;
	z-index: 999999;
	background: var(--bbc-bg);
	color: var(--bbc-text);
	padding: 20px 24px;
	box-shadow: 0 -2px 24px rgba( 0, 0, 0, 0.25 );
	display: flex;
	gap: 20px;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}

.bbc-pos-bottom-bar .bbc-banner {
	left: 0;
	right: 0;
	bottom: 0;
	border-radius: 0;
}

.bbc-pos-bottom-left .bbc-banner {
	left: 20px;
	bottom: 20px;
	max-width: 420px;
	border-radius: 12px;
	flex-direction: column;
	align-items: flex-start;
}

.bbc-pos-center-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 0, 0, 0, 0.5 );
}

.bbc-pos-center-modal .bbc-banner {
	position: static;
	max-width: 520px;
	width: calc( 100% - 40px );
	border-radius: 12px;
	flex-direction: column;
	align-items: flex-start;
}

.bbc-banner__content {
	flex: 1 1 380px;
	min-width: 0;
}

.bbc-banner__headline {
	margin: 0 0 6px;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--bbc-text);
}

.bbc-banner__body {
	margin: 0;
	color: var(--bbc-text);
	opacity: 0.9;
	font-size: 0.9rem;
}

.bbc-banner__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

/* --------------------------------------------------------------------- */
/* Buttons                                                               */
/* --------------------------------------------------------------------- */

.bbc-btn {
	font: inherit;
	cursor: pointer;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 10px 18px;
	font-weight: 600;
	line-height: 1;
	transition: filter 0.15s ease, background 0.15s ease;
}

.bbc-btn:focus-visible {
	outline: 3px solid var(--bbc-primary);
	outline-offset: 2px;
}

.bbc-btn--primary {
	background: var(--bbc-primary);
	color: #fff;
}

.bbc-btn--primary:hover {
	filter: brightness( 1.08 );
}

.bbc-btn--secondary {
	background: transparent;
	color: var(--bbc-text);
	border-color: var(--bbc-secondary);
}

.bbc-btn--secondary:hover {
	background: rgba( 255, 255, 255, 0.08 );
}

.bbc-btn--link {
	background: transparent;
	color: var(--bbc-text);
	border: none;
	text-decoration: underline;
	padding: 10px 6px;
	opacity: 0.9;
}

.bbc-btn--link:hover {
	opacity: 1;
}

/* --------------------------------------------------------------------- */
/* Preferences modal                                                     */
/* --------------------------------------------------------------------- */

.bbc-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bbc-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
}

.bbc-modal__dialog {
	position: relative;
	background: var(--bbc-bg);
	color: var(--bbc-text);
	width: calc( 100% - 40px );
	max-width: 560px;
	max-height: calc( 100vh - 40px );
	overflow-y: auto;
	border-radius: 14px;
	padding: 28px;
	box-shadow: 0 12px 48px rgba( 0, 0, 0, 0.4 );
}

.bbc-modal__close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: transparent;
	border: none;
	color: var(--bbc-text);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
	padding: 4px 8px;
}

.bbc-modal__close:hover {
	opacity: 1;
}

.bbc-modal__title {
	margin: 0 0 18px;
	font-size: 1.25rem;
	font-weight: 700;
}

.bbc-modal__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 22px;
}

/* --------------------------------------------------------------------- */
/* Preference rows + toggle switch                                       */
/* --------------------------------------------------------------------- */

.bbc-prefs__row {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	justify-content: space-between;
	padding: 14px 0;
	border-bottom: 1px solid rgba( 255, 255, 255, 0.12 );
}

.bbc-prefs__label label {
	font-weight: 600;
	display: block;
	margin-bottom: 2px;
}

.bbc-prefs__desc {
	margin: 0;
	font-size: 0.82rem;
	opacity: 0.75;
}

.bbc-switch {
	position: relative;
	flex: 0 0 auto;
	width: 46px;
	height: 26px;
}

.bbc-switch__input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 2;
}

.bbc-switch__input:disabled {
	cursor: not-allowed;
}

.bbc-switch__track {
	position: absolute;
	inset: 0;
	background: var(--bbc-secondary);
	border-radius: 999px;
	transition: background 0.15s ease;
}

.bbc-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.bbc-switch__input:checked + .bbc-switch__track {
	background: var(--bbc-primary);
}

.bbc-switch__input:checked + .bbc-switch__track::after {
	transform: translateX( 20px );
}

.bbc-switch__input:focus-visible + .bbc-switch__track {
	outline: 3px solid var(--bbc-primary);
	outline-offset: 2px;
}

.bbc-switch__input:disabled + .bbc-switch__track {
	opacity: 0.6;
}

/* --------------------------------------------------------------------- */
/* Reopen button                                                         */
/* --------------------------------------------------------------------- */

.bbc-reopen {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 999998;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: none;
	background: var(--bbc-bg);
	color: var(--bbc-text);
	font-size: 1.2rem;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.3 );
}

.bbc-reopen:focus-visible {
	outline: 3px solid var(--bbc-primary);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------- */
/* Responsive + motion                                                   */
/* --------------------------------------------------------------------- */

@media ( max-width: 600px ) {
	.bbc-banner {
		flex-direction: column;
		align-items: stretch;
		padding: 16px;
	}

	.bbc-pos-bottom-left .bbc-banner {
		left: 0;
		right: 0;
		bottom: 0;
		max-width: none;
		border-radius: 0;
	}

	.bbc-banner__actions .bbc-btn {
		flex: 1 1 auto;
		text-align: center;
	}
}

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