/**
 * Snyggsajt Cookie Banner — default styling.
 *
 * All colors flow through CSS custom properties so the admin's styling
 * options (set as inline vars by banner.js) win without extra CSS.
 */

.scb-banner,
.scb-modal-wrap,
.scb-reopen {
	--scb-primary: #333ac4;
	--scb-accent: #fc7ee7;
	--scb-bg: #ffffff;
	--scb-text: #1f2430;
	--scb-muted: #5b6472;
	--scb-border: rgba(31, 36, 48, 0.12);
	--scb-radius: 999px;
	--scb-shadow: 0 8px 40px rgba(15, 18, 34, 0.18);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--scb-text);
	box-sizing: border-box;
}

.scb-banner *,
.scb-modal-wrap *,
.scb-banner *::before,
.scb-modal-wrap *::before {
	box-sizing: inherit;
}

.scb-theme-dark {
	--scb-bg: #191c26;
	--scb-text: #f2f4f8;
	--scb-muted: #a8b0bf;
	--scb-border: rgba(242, 244, 248, 0.14);
}

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

.scb-banner {
	position: fixed;
	z-index: 999999;
	background: var(--scb-bg);
	box-shadow: var(--scb-shadow);
	animation: scb-slide-up 0.35s ease;
}

@keyframes scb-slide-up {
	from { transform: translateY(24px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.scb-banner { animation: none; }
}

.scb-pos-bottom {
	left: 0;
	right: 0;
	bottom: 0;
	border-top: 1px solid var(--scb-border);
}

.scb-pos-bottom-left,
.scb-pos-bottom-right {
	bottom: 20px;
	max-width: 420px;
	border-radius: 18px;
	border: 1px solid var(--scb-border);
}

.scb-pos-bottom-left { left: 20px; }
.scb-pos-bottom-right { right: 20px; }

.scb-banner-inner {
	padding: 20px 24px;
	max-width: 1100px;
	margin: 0 auto;
}

.scb-title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
}

.scb-message {
	margin: 0 0 14px;
	color: var(--scb-muted);
}

.scb-privacy-link {
	color: var(--scb-primary);
	text-decoration: underline;
}

.scb-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.scb-pos-bottom .scb-actions {
	justify-content: flex-end;
}

/* Buttons */

.scb-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 10px 22px;
	border-radius: var(--scb-radius);
	transition: filter 0.15s ease, background 0.15s ease;
}

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

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

.scb-btn-primary:hover { filter: brightness(1.12); }

.scb-btn-secondary {
	background: transparent;
	color: var(--scb-text);
	border: 2px solid var(--scb-border);
}

.scb-btn-secondary:hover { border-color: var(--scb-primary); color: var(--scb-primary); }

.scb-btn-ghost {
	background: transparent;
	color: var(--scb-muted);
	text-decoration: underline;
	padding-left: 8px;
	padding-right: 8px;
}

.scb-btn-ghost:hover { color: var(--scb-primary); }

.scb-btn-accent {
	background: linear-gradient(90deg, var(--scb-accent), var(--scb-primary));
}

/* Branding credit */

.scb-branding-row {
	margin-top: 10px;
}

.scb-pos-bottom .scb-branding-row {
	text-align: right;
}

.scb-branding {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11.5px;
	color: var(--scb-muted);
	text-decoration: none;
}

.scb-branding:hover {
	color: var(--scb-primary);
}

.scb-brand-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--scb-accent), var(--scb-primary));
	flex: 0 0 auto;
}

.scb-brand-name {
	font-weight: 700;
}

.scb-modal-branding {
	text-align: center;
	padding: 0 22px 14px;
	margin-top: 0;
}

/* Overlay */

.scb-overlay {
	position: fixed;
	inset: 0;
	background: rgba(10, 12, 20, 0.55);
	z-index: 999998;
}

/* ------------------------------------------------------------------ *
 * Modal
 * ------------------------------------------------------------------ */

.scb-modal-wrap {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.scb-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 12, 20, 0.55);
}

.scb-modal {
	position: relative;
	background: var(--scb-bg);
	border-radius: 18px;
	box-shadow: var(--scb-shadow);
	width: 100%;
	max-width: 560px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
}

.scb-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px 10px;
}

.scb-modal-close {
	appearance: none;
	background: transparent;
	border: 0;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--scb-muted);
	padding: 2px 8px;
	border-radius: 8px;
}

.scb-modal-close:hover { color: var(--scb-text); }

.scb-modal-body {
	padding: 6px 22px;
	overflow-y: auto;
}

.scb-modal-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	padding: 14px 22px 20px;
	border-top: 1px solid var(--scb-border);
}

/* Category rows */

.scb-cat {
	padding: 12px 0;
	border-bottom: 1px solid var(--scb-border);
}

.scb-cat:last-child { border-bottom: 0; }

.scb-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.scb-cat-name { font-weight: 700; }

.scb-cat-desc {
	margin: 6px 0 0;
	color: var(--scb-muted);
	font-size: 14px;
}

.scb-modal-privacy {
	margin: 12px 0 6px;
	font-size: 13px;
}

/* Toggle switch */

.scb-switch {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 26px;
	flex: 0 0 auto;
}

.scb-switch input {
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	position: absolute;
	inset: 0;
	cursor: pointer;
}

.scb-slider {
	position: absolute;
	inset: 0;
	background: var(--scb-border);
	border-radius: 999px;
	transition: background 0.15s ease;
	pointer-events: none;
}

.scb-slider::before {
	content: "";
	position: absolute;
	width: 20px;
	height: 20px;
	left: 3px;
	top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.scb-switch input:checked + .scb-slider {
	background: var(--scb-accent);
}

.scb-switch input:checked + .scb-slider::before {
	transform: translateX(20px);
}

.scb-switch input:disabled + .scb-slider {
	background: var(--scb-primary);
	opacity: 0.55;
}

.scb-switch input:focus-visible + .scb-slider {
	outline: 3px solid var(--scb-accent);
	outline-offset: 2px;
}

/* Cookie declaration table */

.scb-cat-details { margin-top: 8px; }

.scb-cat-details summary {
	cursor: pointer;
	color: var(--scb-primary);
	font-size: 13px;
}

.scb-cookie-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12.5px;
	margin-top: 8px;
}

.scb-cookie-table th,
.scb-cookie-table td {
	text-align: left;
	padding: 5px 8px;
	border-bottom: 1px solid var(--scb-border);
	vertical-align: top;
}

.scb-cookie-table th {
	color: var(--scb-muted);
	font-weight: 600;
}

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

.scb-reopen {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 999997;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid var(--scb-border);
	background: var(--scb-bg);
	box-shadow: var(--scb-shadow);
	font-size: 22px;
	cursor: pointer;
	transition: transform 0.15s ease;
}

.scb-reopen:hover { transform: scale(1.08); }

/* ------------------------------------------------------------------ *
 * Blocked embeds
 * ------------------------------------------------------------------ */

iframe.scb-blocked-embed {
	opacity: 0.15;
	filter: grayscale(1);
	pointer-events: none;
}

.scb-embed-notice {
	background: #f2f3f8;
	border: 1px dashed rgba(31, 36, 48, 0.25);
	border-radius: 12px;
	padding: 16px;
	margin: 8px 0;
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	color: #1f2430;
}

.scb-embed-notice .scb-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 8px 18px;
	border-radius: 999px;
	background: #333ac4;
	color: #fff;
}

/* Sentinel: banner.js polls this custom property to know the stylesheet is
   active before handing inline critical positioning back to CSS. */
.scb-css-probe { --scb-css-loaded: 1; }

/* Mobile */

@media (max-width: 600px) {
	.scb-pos-bottom-left,
	.scb-pos-bottom-right {
		left: 10px;
		right: 10px;
		bottom: 10px;
		max-width: none;
	}

	.scb-actions .scb-btn {
		flex: 1 1 auto;
		text-align: center;
	}

	.scb-modal { max-height: 92vh; }
}
