/**
 * OBF Cookie Consent — banner + preferences modal.
 * Modern-editorial styling from the OBF design system. Works on desktop & mobile.
 * Tokens are referenced with fallbacks so this is theme-independent.
 */

.obf-cc,
.obf-cc *,
.obf-cc *::before,
.obf-cc *::after {
	box-sizing: border-box;
}

.obf-cc[hidden] {
	display: none;
}

.obf-cc {
	--cc-accent: var(--obf-accent, #ef671f);
	--cc-surface: var(--obf-surface, #ffffff);
	--cc-ink: var(--obf-ink, #141414);
	--cc-muted: var(--obf-body-muted, #46433f);
	--cc-gray: var(--obf-gray-60, #666666);
	--cc-hairline: var(--obf-hairline, #efeeec);
	--cc-border-card: var(--obf-border-card, #dad8d6);
	--cc-separator: var(--obf-separator, #f3f1f0);
	--cc-row-hover: var(--obf-row-hover, #fbf4ef);
	--cc-border-warm: var(--obf-border-warm, #f0e0d2);
	--cc-off: var(--obf-gray-20, #cccccc);
	font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------------- Banner */
.obf-cc-banner {
	position: fixed;
	z-index: 2147483000;
	left: 24px;
	bottom: 24px;
	width: min(440px, calc(100vw - 48px));
	background: var(--cc-surface);
	border: 1px solid var(--cc-border-card);
	border-radius: 16px;
	box-shadow: 0 24px 60px -18px rgba(20, 12, 18, 0.32), 0 2px 8px rgba(20, 12, 18, 0.06);
	overflow: hidden;
	animation: obf-cc-rise 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes obf-cc-rise {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}

.obf-cc-bar {
	height: 3px;
	background: var(--cc-accent);
}

.obf-cc-banner__body {
	padding: 20px 22px 22px;
}

.obf-cc-head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.obf-cc-ico {
	display: inline-flex;
	flex: 0 0 auto;
}

.obf-cc-title {
	margin: 0;
	font: 800 18px/1.2 inherit;
	letter-spacing: -0.01em;
	color: var(--cc-ink);
}

.obf-cc-text {
	margin: 14px 0 0;
	font: 300 14px/1.62 inherit;
	color: var(--cc-muted);
}

.obf-cc-link {
	color: var(--cc-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.obf-cc-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 18px;
}

.obf-cc-actions-row {
	display: flex;
	gap: 10px;
}

/* ---------------------------------------------------------------- Buttons */
.obf-cc-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	width: 100%;
	border: none;
	border-radius: var(--obf-r-pill, 999px);
	cursor: pointer;
	font: 700 12px/1 inherit;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.obf-cc-btn:active {
	transform: translateY(1px);
}

.obf-cc-btn--solid {
	background: var(--cc-accent);
	color: var(--cc-surface);
}

.obf-cc-btn--solid:hover {
	background: var(--obf-accent-dark, #c2521a);
}

.obf-cc-btn--outline {
	flex: 1;
	background: transparent;
	box-shadow: inset 0 0 0 2px var(--cc-accent);
	color: var(--cc-accent);
	letter-spacing: 0.1em;
}

.obf-cc-btn--outline:hover {
	background: var(--cc-row-hover);
}

.obf-cc-btn--muted {
	flex: 1;
	background: var(--cc-separator);
	color: var(--cc-ink);
	letter-spacing: 0.1em;
}

.obf-cc-btn--muted:hover {
	background: #e9e6e4;
}

.obf-cc-btn--dark {
	flex: 1;
	background: var(--cc-ink);
	color: var(--cc-surface);
	letter-spacing: 0.1em;
}

.obf-cc-btn--dark:hover {
	background: #000;
}

/* ---------------------------------------------------------------- Modal */
.obf-cc-modal[hidden] {
	display: none;
}

.obf-cc-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.obf-cc-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 12, 18, 0.5);
	animation: obf-cc-fade 0.2s ease both;
}

@keyframes obf-cc-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.obf-cc-modal__card {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	background: var(--cc-surface);
	border: 1px solid var(--obf-border-input, #e2e0dd);
	border-radius: 24px;
	box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.4);
	overflow: hidden;
	animation: obf-cc-pop 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes obf-cc-pop {
	from { opacity: 0; transform: translateY(14px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.obf-cc-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px 14px;
	border-bottom: 1px solid var(--cc-hairline);
}

.obf-cc-modal__head h2 {
	margin: 0;
	font: 800 19px/1.15 inherit;
	letter-spacing: -0.01em;
	color: var(--cc-ink);
}

.obf-cc-close {
	background: none;
	border: none;
	padding: 6px;
	display: flex;
	cursor: pointer;
	color: var(--cc-ink);
	border-radius: 8px;
}

.obf-cc-close:hover {
	background: var(--cc-separator);
}

.obf-cc-modal__body {
	flex: 1;
	overflow-y: auto;
	padding: 4px 20px 8px;
	-webkit-overflow-scrolling: touch;
}

.obf-cc-modal__body .obf-cc-text {
	margin: 14px 0 2px;
	font-size: 14px;
	line-height: 1.6;
}

.obf-cc-cat {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 18px 0;
	border-top: 1px solid var(--cc-hairline);
}

.obf-cc-cat__info {
	flex: 1;
	min-width: 0;
}

.obf-cc-cat__name {
	font: 700 15px/1.3 inherit;
	color: var(--cc-ink);
}

.obf-cc-cat__desc {
	margin: 6px 0 0;
	font: 300 13px/1.55 inherit;
	color: var(--cc-gray);
}

.obf-cc-cat__ctrl {
	flex: 0 0 auto;
	padding-top: 2px;
}

.obf-cc-badge {
	display: inline-flex;
	align-items: center;
	height: 26px;
	padding: 0 11px;
	border-radius: var(--obf-r-pill, 999px);
	background: var(--cc-row-hover);
	border: 1px solid var(--cc-border-warm);
	font: 700 10px/1 inherit;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cc-accent);
}

/* Toggle switch */
.obf-cc-switch {
	position: relative;
	width: 46px;
	height: 26px;
	padding: 0;
	border: none;
	border-radius: var(--obf-r-pill, 999px);
	background: var(--cc-off);
	cursor: pointer;
	transition: background 0.15s ease;
	flex: 0 0 auto;
}

.obf-cc-switch[aria-checked="true"] {
	background: var(--cc-accent);
}

.obf-cc-switch__knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
	transition: left 0.15s ease;
}

.obf-cc-switch[aria-checked="true"] .obf-cc-switch__knob {
	left: 23px;
}

.obf-cc-modal__foot {
	padding: 14px 20px 18px;
	border-top: 1px solid var(--cc-hairline);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.obf-cc-modal__foot .obf-cc-btn {
	height: 46px;
}

.obf-cc-modal__foot .obf-cc-btn--solid {
	height: 48px;
}

/* ---------------------------------------------------------------- Mobile */
@media (max-width: 600px) {
	.obf-cc-banner {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.obf-cc-banner,
	.obf-cc-modal__card,
	.obf-cc-modal__overlay {
		animation: none;
	}
}
