/*
 * CookieGate — third-party forms consent guard block (B6 / 2.4.1 item 4; isolated in 2.5.0).
 * Developed & maintained by: Vijaya Kumar L, Lead Application Engineering, CIEL HR.
 *
 * Loaded BOTH inside the Shadow DOM host (isolated mode — the default, injected via <link> into the
 * open shadow root) AND in the light DOM (inherit mode, or the fallback when Shadow DOM is missing).
 * The block is always wrapped in `.ckg-scope`:
 *   - In the shadow, theme/plugin CSS can't reach in at all; only font-family + font-size are inherited
 *     from the form (via `:host{font:inherit}` set inline by the mounter). The `.ckg-scope` rule resets
 *     the other inherited typography props so a theme can't leak them across the shadow boundary.
 *   - In the light DOM, the same `.ckg-scope` + per-element rules use !important to fight the theme, and
 *     the fallback wrapper `.ckg-fg-reset` applies `all: revert` first. Verified across Astra, Hello
 *     Elementor, Kadence, GeneratePress, OceanWP, Blocksy, Neve, Twenty Twenty-Four / Twenty Twenty-Five.
 * Colours use CSS custom properties with literal fallbacks so a page with no banner (no #ckg-tokens)
 * still renders correctly, and a page that sets --ckg-primary matches the site brand.
 */

/* Shadow-host base (ignored in the light DOM). */
:host { all: initial; display: block; font: inherit; color: inherit; }

/* Fallback (Shadow DOM unavailable): revert the wrapper to UA defaults so a hostile theme's author
 * rules targeting our wrapper are dropped; our class rules below (with !important) then re-style. */
.ckg-fg-reset { all: revert; display: block; }

/* The scope wrapper: inherit ONLY font-family + font-size from the form; reset every other inherited
 * typography property so nothing leaks into the block (belt-and-braces in the shadow; essential in the
 * light DOM). */
.ckg-scope {
	box-sizing: border-box !important;
	display: block !important;
	font-family: inherit !important;
	font-size: inherit !important;
	font-weight: 400 !important;
	font-style: normal !important;
	line-height: 1.5 !important;
	color: var(--ckg-text, #0a1931) !important;
	text-align: left !important;
	letter-spacing: normal !important;
	word-spacing: normal !important;
	text-transform: none !important;
	text-indent: 0 !important;
	white-space: normal !important;
	text-shadow: none !important;
}
.ckg-scope[dir="rtl"] { text-align: right !important; }
.ckg-scope * { box-sizing: border-box !important; }

.ckg-fg {
	box-sizing: border-box !important;
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	margin: 16px 0 !important;
	padding: 16px !important;
	border: 1px solid var(--ckg-primary, #0363fc) !important;
	border-radius: 8px !important;
	background: var(--ckg-primary-tint, rgba(3, 99, 252, .06)) !important;
	font-family: inherit !important;
	font-size: inherit !important;
	line-height: 1.5 !important;
	font-weight: 400 !important;
	color: var(--ckg-text, #0a1931) !important;
	text-align: left !important;
	overflow-wrap: anywhere !important;
	word-break: break-word !important;
}
/* wpautop (CF7) can wrap/adjacent our slot with <p>/<br> that inherit theme paragraph margins —
 * neutralise any that land inside the block. */
.ckg-fg p, .ckg-fg br { margin: 0 !important; padding: 0 !important; }
.ckg-fg br { line-height: 0 !important; }
.ckg-fg .ckg-fg-hidden.ckg-fg-hidden { display: none !important; }

.ckg-fg .ckg-fg-head {
	display: flex !important;
	align-items: flex-start !important;
	gap: 8px !important;
	margin: 0 !important;
}
.ckg-fg .ckg-fg-lock {
	flex: 0 0 auto !important;
	display: inline-flex !important;
	margin-top: 2px !important;
	color: var(--ckg-primary, #0363fc) !important;
}
.ckg-fg .ckg-fg-lock svg { width: 18px !important; height: 18px !important; display: block !important; }

.ckg-fg .ckg-fg-notice {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	font-size: .9em !important;
	line-height: 1.5 !important;
	font-weight: 400 !important;
	color: var(--ckg-text, #0a1931) !important;
	overflow-wrap: anywhere !important;
}
.ckg-fg .ckg-fg-notice strong { font-weight: 700 !important; }
/* The Privacy link must read exactly like the notice (themes love to bump <a> size/weight). */
.ckg-fg .ckg-fg-notice a {
	color: var(--ckg-primary-ink, #0250cc) !important;
	text-decoration: underline !important;
	font-size: inherit !important;
	font-weight: 400 !important;
	line-height: inherit !important;
	font-family: inherit !important;
	letter-spacing: inherit !important;
	text-transform: none !important;
	overflow-wrap: anywhere !important;
	word-break: break-word !important;
}

.ckg-fg .ckg-fg-label {
	display: flex !important;
	align-items: flex-start !important;
	gap: 8px !important;
	margin: 12px 0 0 !important;
	padding: 0 !important;
	min-width: 0 !important;
	font-size: .9em !important;
	line-height: 1.5 !important;
	font-weight: 400 !important;
	color: var(--ckg-text, #0a1931) !important;
	cursor: pointer !important;
}
.ckg-fg .ckg-fg-label > span { flex: 1 1 auto !important; min-width: 0 !important; font-size: inherit !important; line-height: 1.5 !important; font-weight: 400 !important; overflow-wrap: anywhere !important; }
.ckg-fg .ckg-fg-cb {
	flex: 0 0 auto !important;
	width: 18px !important;
	height: 18px !important;
	margin: 2px 0 0 !important;
	padding: 0 !important;
	accent-color: var(--ckg-primary, #0363fc) !important;
	cursor: pointer !important;
	vertical-align: top !important;
}

.ckg-fg .ckg-fg-err {
	margin: 6px 0 0 !important;
	font-size: .86em !important;
	line-height: 1.5 !important;
	font-weight: 500 !important;
	color: #c62828 !important;
}
.ckg-fg .ckg-fg-u18 {
	/* "I am under 18" reads as a clear link directly under the consent label, left-aligned with the
	 * label TEXT (checkbox 18px + gap 8px), 6px below it, always underlined in the primary link ink.
	 * appearance:none + word-break:normal keep it on ONE line (see 2.4.5): a native <button> sizes to
	 * its content and the old overflow-wrap:anywhere wrapped the short label onto ~3 lines. */
	-webkit-appearance: none !important;
	appearance: none !important;
	display: inline-block !important;
	margin: 6px 0 0 26px !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	font: inherit !important;
	font-family: inherit !important;
	font-size: .82em !important;
	line-height: 1.4 !important;
	font-weight: 400 !important;
	letter-spacing: normal !important;
	color: var(--ckg-primary-ink, #0250cc) !important;
	text-decoration: underline !important;
	text-underline-offset: 2px !important;
	text-transform: none !important;
	text-align: left !important;
	white-space: normal !important;
	overflow-wrap: normal !important;
	word-break: normal !important;
	cursor: pointer !important;
	width: auto !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	vertical-align: baseline !important;
}
.ckg-fg .ckg-fg-u18:hover { color: var(--ckg-primary, #0363fc) !important; text-decoration: underline !important; }
.ckg-fg .ckg-fg-u18:focus-visible { outline: 2px solid var(--ckg-primary, #0363fc) !important; outline-offset: 2px !important; border-radius: 2px !important; }
.ckg-scope[dir="rtl"] .ckg-fg .ckg-fg-u18, .ckg-scope[dir="rtl"] .ckg-fg .ckg-fg-minor { margin: 6px 26px 0 0 !important; }
.ckg-fg .ckg-fg-minor {
	margin: 6px 0 0 26px !important;
	font-size: .82em !important;
	line-height: 1.4 !important;
	font-weight: 500 !important;
	color: #8a5600 !important;
}

/* ---------------------------------------------------------------------------
 * Server-rendered no-JS fallback (2.5.1). `.ckg-fg-ssr` holds the signed marker + this plain,
 * light-DOM consent block so a visitor with JavaScript off (or if our script errors) can still
 * consent. When JS runs it REPLACES `.ckg-fg-plain` with the isolated Shadow DOM block. These rules
 * live in the global stylesheet (light DOM) and use !important so a theme can't deform the fallback.
 * --------------------------------------------------------------------------- */
.ckg-fg-ssr { display: block !important; }
.ckg-fg-plain {
	box-sizing: border-box !important;
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 16px 0 !important;
	padding: 16px !important;
	border: 1px solid var(--ckg-primary, #0363fc) !important;
	border-radius: 8px !important;
	background: var(--ckg-primary-tint, rgba(3, 99, 252, .06)) !important;
	font-size: 13.5px !important;
	line-height: 1.5 !important;
	color: var(--ckg-text, #0a1931) !important;
	text-align: left !important;
}
.ckg-fg-plain * { box-sizing: border-box !important; }
.ckg-fg-plain .ckg-fg-plain-notice {
	margin: 0 0 10px !important;
	padding: 0 !important;
	font-size: 13px !important;
	line-height: 1.5 !important;
	color: var(--ckg-text, #0a1931) !important;
}
.ckg-fg-plain .ckg-fg-plain-notice strong { font-weight: 700 !important; }
.ckg-fg-plain .ckg-fg-plain-notice a {
	color: var(--ckg-primary-ink, #0250cc) !important;
	text-decoration: underline !important;
	font-size: inherit !important;
}
.ckg-fg-plain .ckg-fg-plain-label {
	display: flex !important;
	align-items: flex-start !important;
	gap: 8px !important;
	margin: 0 !important;
	font-size: 13px !important;
	line-height: 1.5 !important;
	color: var(--ckg-text, #0a1931) !important;
	cursor: pointer !important;
}
.ckg-fg-plain .ckg-fg-plain-cb {
	flex: 0 0 auto !important;
	width: 18px !important;
	height: 18px !important;
	margin: 1px 0 0 !important;
	accent-color: var(--ckg-primary, #0363fc) !important;
	cursor: pointer !important;
}
.ckg-fg-plain .ckg-fg-plain-u18 {
	display: inline-block !important;
	margin: 6px 0 0 26px !important;
	font-size: 12.5px !important;
	line-height: 1.4 !important;
	color: var(--ckg-primary-ink, #0250cc) !important;
	text-decoration: underline !important;
	text-underline-offset: 2px !important;
}
