/*!
 * jnews-child consent banner styles.
 * Self-contained, no external deps, respects prefers-reduced-motion.
 */

#jnc-consent-root {
	all: initial;
	font-family: inherit;
}

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

html.jnc-noscroll,
html.jnc-noscroll body {
	overflow: hidden !important;
}

/* ---------------- bottom bar ---------------- */

.jnc-banner {
	position: fixed;
	left: 12px;
	right: 12px;
	bottom: 12px;
	z-index: 2147483000;
	background: #ffffff;
	color: #1a1a1a;
	border-radius: 10px;
	box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.08);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 220ms ease, transform 220ms ease;
	will-change: opacity, transform;
}

.jnc-banner.jnc-open {
	opacity: 1;
	transform: none;
}

.jnc-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	padding: 18px 22px;
}

.jnc-copy {
	flex: 1 1 320px;
	min-width: 0;
}

.jnc-title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 700;
	color: inherit;
	letter-spacing: 0;
}

.jnc-body {
	margin: 0;
	color: #444;
	font-size: 13.5px;
	line-height: 1.55;
}

.jnc-link {
	color: #1e73be;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.jnc-link:hover,
.jnc-link:focus {
	color: #165a91;
}

.jnc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex-shrink: 0;
}

/* ---------------- buttons ---------------- */

.jnc-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: 6px;
	padding: 10px 18px;
	font: inherit;
	font-weight: 600;
	font-size: 13.5px;
	cursor: pointer;
	transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 80ms ease;
	line-height: 1.2;
}

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

.jnc-btn:focus-visible {
	outline: 2px solid #1e73be;
	outline-offset: 2px;
}

.jnc-btn-primary {
	background: #1e73be;
	color: #fff;
	border-color: #1e73be;
}

.jnc-btn-primary:hover,
.jnc-btn-primary:focus {
	background: #165a91;
	border-color: #165a91;
}

.jnc-btn-secondary {
	background: #f3f4f6;
	color: #1a1a1a;
	border-color: #e1e3e6;
}

.jnc-btn-secondary:hover,
.jnc-btn-secondary:focus {
	background: #e6e8eb;
}

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

.jnc-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	background: rgba(17, 24, 39, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 220ms ease;
}

.jnc-modal-overlay.jnc-open { opacity: 1; }

.jnc-modal {
	width: min(560px, 100%);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff;
	color: #1a1a1a;
	border-radius: 12px;
	padding: 28px 26px 22px;
	box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.45);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.55;
	position: relative;
	transform: translateY(20px) scale(0.98);
	transition: transform 220ms ease;
}

.jnc-modal-overlay.jnc-open .jnc-modal {
	transform: none;
}

.jnc-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: transparent;
	border: 0;
	font-size: 24px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 6px;
}

.jnc-modal-close:hover,
.jnc-modal-close:focus {
	background: #f3f4f6;
	color: #1a1a1a;
}

.jnc-modal-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
}

.jnc-modal-body {
	margin: 0 0 18px;
	color: #444;
}

.jnc-rows {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 20px;
	border-top: 1px solid #eceef1;
	padding-top: 16px;
}

.jnc-row { padding: 0; }

.jnc-row-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 4px;
}

.jnc-row-label {
	font-weight: 600;
	font-size: 14px;
}

.jnc-row-desc {
	margin: 0 0 0 54px;
	color: #6b7280;
	font-size: 13px;
}

.jnc-lock {
	color: #10b981;
	font-size: 13px;
	margin-left: 4px;
}

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

.jnc-switch {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 24px;
	flex-shrink: 0;
}

.jnc-switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.jnc-slider {
	position: absolute;
	inset: 0;
	background: #cbd2d9;
	border-radius: 999px;
	transition: background 180ms ease;
}

.jnc-slider::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 180ms ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.jnc-switch input:checked + .jnc-slider {
	background: #1e73be;
}

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

.jnc-switch input:disabled + .jnc-slider {
	background: #9ca3af;
	cursor: not-allowed;
	opacity: 0.7;
}

.jnc-switch input:focus-visible + .jnc-slider {
	box-shadow: 0 0 0 3px rgba(30, 115, 190, 0.35);
}

/* ---------------- modal actions ---------------- */

.jnc-modal-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
	padding-top: 14px;
	border-top: 1px solid #eceef1;
}

/* ---------------- floating reopen button ---------------- */

.jnc-float {
	position: fixed;
	left: 14px;
	bottom: 14px;
	z-index: 2147482999;
	background: #1a1a1a;
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 9px 14px 9px 11px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.45);
	opacity: 0.92;
	transition: opacity 160ms ease, transform 160ms ease;
}

.jnc-float:hover,
.jnc-float:focus {
	opacity: 1;
	transform: translateY(-1px);
}

.jnc-float-label { white-space: nowrap; }

/* ---------------- responsive ---------------- */

@media (max-width: 640px) {
	.jnc-inner {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
		padding: 16px 18px;
	}
	.jnc-actions {
		justify-content: stretch;
	}
	.jnc-actions .jnc-btn {
		flex: 1 1 auto;
	}
	.jnc-modal {
		padding: 22px 18px 18px;
	}
	.jnc-float-label {
		display: none;
	}
	.jnc-float {
		padding: 10px;
	}
}

/* ---------------- dark mode ---------------- */

@media (prefers-color-scheme: dark) {
	.jnc-banner,
	.jnc-modal {
		background: #1f2937;
		color: #f5f6f8;
	}
	.jnc-body,
	.jnc-modal-body,
	.jnc-row-desc {
		color: #cbd2d9;
	}
	.jnc-btn-secondary {
		background: #374151;
		color: #f5f6f8;
		border-color: #4b5563;
	}
	.jnc-btn-secondary:hover,
	.jnc-btn-secondary:focus {
		background: #434f62;
	}
	.jnc-rows,
	.jnc-modal-actions {
		border-color: #374151;
	}
	.jnc-modal-close {
		color: #cbd2d9;
	}
	.jnc-modal-close:hover,
	.jnc-modal-close:focus {
		background: #374151;
		color: #fff;
	}
	.jnc-slider {
		background: #4b5563;
	}
}

/* ---------------- reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
	.jnc-banner,
	.jnc-modal-overlay,
	.jnc-modal,
	.jnc-btn,
	.jnc-slider,
	.jnc-slider::before,
	.jnc-float {
		transition: none !important;
	}
}

/* ---------------- print ---------------- */

@media print {
	#jnc-consent-root,
	.jnc-float {
		display: none !important;
	}
}
