/* Cookie banner and switches (roadmap #19). The three buttons look the same: refusing is as easy
   as accepting. */

.consent-banner {
	position: fixed;
	right: 16px;
	bottom: 16px;
	left: 16px;
	z-index: 9999;
	max-width: 960px;
	margin: 0 auto;
	background: var(--color-surface);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.consent-banner[hidden] {
	display: none;
}

.consent-banner__inner {
	display: flex;
	align-items: flex-end;
	gap: 24px;
	padding: 20px 24px;
}

.consent-banner__text {
	flex: 1;
	min-width: 0;
	font-size: 14px;
	line-height: 1.5;
}

.consent-banner__text p {
	margin: 0;
}

.consent-banner__title {
	margin-bottom: 4px !important;
	font-size: 17px;
	font-weight: 600;
}

.consent-banner__links {
	display: flex;
	gap: 16px;
	margin-top: 8px !important;
}

.consent-banner__links a {
	color: var(--color-text);
}

.consent-banner__custom {
	display: grid;
	gap: 8px;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--color-border);
}

.consent-banner__custom[hidden] {
	display: none;
}

.consent-banner__actions {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	flex: none;
	width: 420px;
}

.consent-btn {
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--color-dark);
	border-radius: var(--radius);
	background: var(--color-dark);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
	transition: opacity var(--transition);
}

.consent-btn:hover {
	opacity: 0.85;
}

.consent-btn[data-consent="save"] {
	grid-column: 1 / -1;
	border-color: var(--color-primary);
	background: var(--color-primary);
}

.consent-btn[hidden] {
	display: none;
}

/* Switch */

.consent-switch {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	cursor: pointer;
}

.consent-switch__text {
	display: grid;
	gap: 2px;
	font-size: 15px;
	line-height: 1.45;
}

.consent-switch__text span {
	color: var(--color-text-muted);
	font-size: 14px;
}

.consent-switch input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.consent-switch__track {
	position: relative;
	flex: none;
	width: 44px;
	height: 24px;
	border-radius: 12px;
	background: #c9c9c9;
	transition: background var(--transition);
}

.consent-switch__track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform var(--transition);
}

.consent-switch input:checked + .consent-switch__track {
	background: var(--color-primary);
}

.consent-switch input:checked + .consent-switch__track::after {
	transform: translateX(20px);
}

.consent-switch input:disabled + .consent-switch__track {
	opacity: 0.5;
}

.consent-switch input:focus-visible + .consent-switch__track {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}

.consent-switch--small .consent-switch__text {
	font-size: 14px;
}

@media (max-width: 860px) {
	.consent-banner {
		right: 0;
		bottom: 0;
		left: 0;
	}

	.consent-banner__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		padding: 16px;
	}

	.consent-banner__actions {
		width: auto;
	}
}
