/**
 * SkillPlan Cookie Plugin: banner styles.
 * Themeable via CSS custom properties set inline on #spc-root:
 *   --spc-bg, --spc-text, --spc-accent, --spc-accent-text
 */

#spc-root {
	--spc-radius: 10px;
	--spc-muted: color-mix(in srgb, var(--spc-text) 70%, transparent);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

/* ---------- Theme isolation ----------
 * The banner must look like the consent UI, not like the theme: neutral
 * system font, no theme button/link branding. The #id prefix outranks any
 * non-!important theme selector; plugin styles that the reset would clobber
 * are re-asserted with the same prefix right below.
 */

#spc-root,
.spc-placeholder,
.spc-footer-dns {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

#spc-root button,
#spc-root input,
#spc-root a,
#spc-root h2,
#spc-root p,
#spc-root label {
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	background-image: none;
	box-shadow: none;
}

#spc-root a {
	color: inherit;
}

/* Re-assertions (the reset above outranks the plain class rules below). */
#spc-root .spc-banner__message a { color: var(--spc-text); }
#spc-root .spc-cat__locked { text-transform: uppercase; letter-spacing: 0.4px; }
#spc-root .spc-revisit { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }

#spc-root *,
#spc-root *::before,
#spc-root *::after {
	box-sizing: border-box;
}

#spc-root [hidden] {
	display: none !important;
}

.spc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

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

.spc-banner {
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 99998;
	background: var(--spc-bg);
	color: var(--spc-text);
	box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.25);
	animation: spc-slide-up 0.35s ease;
}

@keyframes spc-slide-up {
	from { transform: translateY(100%); }
	to   { transform: translateY(0); }
}

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

.spc-banner__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 18px 24px;
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
}

.spc-banner__text { flex: 1 1 420px; }

.spc-banner__heading {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 700;
}

.spc-banner__message {
	margin: 0;
	color: var(--spc-muted);
	font-size: 14px;
}

.spc-banner__message a {
	color: var(--spc-text);
	text-decoration: underline;
}

.spc-banner__gpc,
.spc-prefs__gpc {
	margin: 8px 0 0;
	font-size: 13px;
	padding: 6px 10px;
	border-radius: 6px;
	background: color-mix(in srgb, var(--spc-accent) 18%, transparent);
	border: 1px solid color-mix(in srgb, var(--spc-accent) 45%, transparent);
}

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

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

.spc-btn {
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 18px;
	border-radius: var(--spc-radius);
	border: 1.5px solid transparent;
	cursor: pointer;
	transition: filter 0.15s ease, background 0.15s ease;
}

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

.spc-btn--primary {
	background: var(--spc-accent);
	color: var(--spc-accent-text);
}

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

.spc-btn--ghost {
	background: transparent;
	color: var(--spc-text);
	border-color: color-mix(in srgb, var(--spc-text) 40%, transparent);
}

.spc-btn--ghost:hover {
	background: color-mix(in srgb, var(--spc-text) 10%, transparent);
}

.spc-btn--link {
	background: none;
	border: none;
	color: var(--spc-muted);
	text-decoration: underline;
	padding: 10px 4px;
	font-weight: 500;
}

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

.spc-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.spc-prefs {
	background: var(--spc-bg);
	color: var(--spc-text);
	width: 100%;
	max-width: 560px;
	max-height: min(85vh, 720px);
	border-radius: 14px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.spc-prefs__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px 12px;
}

.spc-prefs__header h2 {
	margin: 0;
	font-size: 18px;
	color: var(--spc-text);
}

.spc-prefs__close {
	background: none;
	border: none;
	color: var(--spc-muted);
	font-size: 18px;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 8px;
}

.spc-prefs__close:hover { background: color-mix(in srgb, var(--spc-text) 10%, transparent); }
.spc-prefs__close:focus-visible { outline: 3px solid var(--spc-accent); }

.spc-prefs__body {
	padding: 0 22px;
	overflow-y: auto;
	flex: 1;
}

.spc-prefs__intro {
	margin: 0 0 14px;
	font-size: 14px;
	color: var(--spc-muted);
}

.spc-cat {
	border: 1px solid color-mix(in srgb, var(--spc-text) 18%, transparent);
	border-radius: var(--spc-radius);
	margin-bottom: 10px;
	overflow: hidden;
}

.spc-cat--highlight {
	border-color: var(--spc-accent);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--spc-accent) 40%, transparent);
}

.spc-cat__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
}

.spc-cat__expand {
	display: flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: none;
	color: var(--spc-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	padding: 4px;
	border-radius: 6px;
	text-align: left;
	flex: 1;
}

.spc-cat__expand:focus-visible { outline: 3px solid var(--spc-accent); }

.spc-cat__chevron {
	display: inline-block;
	transition: transform 0.15s ease;
	color: var(--spc-muted);
}

.spc-cat__expand[aria-expanded="true"] .spc-cat__chevron {
	transform: rotate(90deg);
}

.spc-cat__locked {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--spc-accent);
	white-space: nowrap;
}

.spc-cat__detail {
	padding: 0 14px 14px 34px;
	font-size: 13px;
	color: var(--spc-muted);
}

.spc-cat__detail p { margin: 0 0 6px; }

/* ---------- Toggle switch ---------- */

.spc-switch {
	position: relative;
	display: inline-block;
	flex-shrink: 0;
}

.spc-switch input {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: pointer;
}

.spc-switch__track {
	display: block;
	width: 46px;
	height: 26px;
	border-radius: 13px;
	background: color-mix(in srgb, var(--spc-text) 25%, transparent);
	transition: background 0.15s ease;
	pointer-events: none;
}

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

.spc-switch input:checked + .spc-switch__track {
	background: var(--spc-accent);
}

.spc-switch input:checked + .spc-switch__track::after {
	transform: translateX(20px);
}

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

.spc-switch input:disabled + .spc-switch__track {
	opacity: 0.5;
}

.spc-prefs__footer {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	padding: 14px 22px 18px;
	border-top: 1px solid color-mix(in srgb, var(--spc-text) 15%, transparent);
}

.spc-prefs__spacer { flex: 1; }

/* ---------- Revisit button ---------- */

.spc-revisit {
	position: fixed;
	bottom: 18px;
	left: 18px;
	z-index: 99997;
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--spc-bg);
	color: var(--spc-text);
	border: 1px solid color-mix(in srgb, var(--spc-text) 25%, transparent);
	border-radius: 999px;
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.spc-revisit:hover { filter: brightness(1.1); }
.spc-revisit:focus-visible { outline: 3px solid var(--spc-accent); outline-offset: 2px; }

.spc-revisit__label { display: none; }
.spc-revisit:hover .spc-revisit__label,
.spc-revisit:focus-visible .spc-revisit__label { display: inline; }

/* ---------- Iframe placeholder ---------- */

.spc-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: #1d2327;
	color: #f0f0f1;
	border-radius: 8px;
	padding: 32px 20px;
	text-align: center;
	min-height: 220px;
	font-size: 14px;
}

.spc-placeholder p { margin: 0; max-width: 40ch; }

.spc-placeholder button {
	font: inherit;
	font-weight: 600;
	padding: 10px 18px;
	border-radius: 8px;
	border: none;
	background: var(--spc-ph-accent, #3858e9);
	color: #fff;
	cursor: pointer;
	/* Theme isolation: placeholders render inside content, outside the root. */
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	background-image: none;
	box-shadow: none;
}

.spc-placeholder button:hover { filter: brightness(1.12); }
.spc-placeholder button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- Footer DNS link ---------- */

.spc-footer-dns {
	text-align: center;
	padding: 10px;
	font-size: 12px;
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
	.spc-banner__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		padding: 16px;
	}

	.spc-banner__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.spc-banner__actions .spc-btn--primary {
		grid-column: 1 / -1;
		order: -1;
	}

	.spc-prefs { max-height: 92vh; }

	.spc-prefs__footer .spc-btn { flex: 1 1 45%; }
}

/* Cookie policy / table styles live in policy.css (own handle, loaded
   independently of the banner — see Frontend\PolicyAssets). */
