/* ==========================================================================
   ChipLOGIC 2026 — Dedicated Plugin Styling & Compatibility
   Covers: BMW Mileage Tool, ECU Tools, KT OTP Registrar, LPC Flash OTP,
           Ultimate Member, GTranslate, and Complianz GDPR.
   ========================================================================== */

/* 1. BMW F-Series EEPROM HEX <-> Mileage Converter ([bmw_mileage_tool]) */
.bmw-tool {
	background: linear-gradient(145deg, #1D1D24 0%, #141418 100%);
	border: 1px solid var(--cl-border-strong);
	border-left: 3px solid var(--cl-accent);
	border-radius: var(--cl-radius-lg);
	padding: clamp(22px, 3vw, 32px);
	margin: 24px 0;
	box-shadow: var(--cl-shadow-sm);
}

.bmw-tool h2 {
	margin: 0 0 8px;
	font-family: var(--cl-font-display);
	font-size: 1.35rem;
	color: var(--cl-ink);
}

.bmw-tool > p {
	margin: 0 0 20px;
	font-size: 0.92rem;
	color: var(--cl-ink-muted);
}

.bmw-tool form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	align-items: end;
}

.bmw-tool label {
	display: block;
	font-family: var(--cl-font-mono);
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--cl-ink-secondary);
	margin-bottom: 6px;
}

.bmw-tool input[type="text"] {
	font-family: var(--cl-font-mono);
	font-size: 1rem;
	letter-spacing: 0.06em;
	background: #0D0D11;
	color: var(--cl-ink);
	border: 1px solid var(--cl-border-strong);
	border-radius: var(--cl-radius-md);
	padding: 12px 14px;
	width: 100%;
}

.bmw-tool button[type="submit"] {
	grid-column: 1 / -1;
	justify-self: start;
	min-width: 160px;
	background: var(--cl-accent);
	color: #FFFFFF;
	border: 1px solid var(--cl-accent);
	border-radius: var(--cl-radius-md);
	padding: 12px 26px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
}

.bmw-tool button[type="submit"]:hover {
	background: var(--cl-accent-hover);
	box-shadow: 0 8px 24px var(--cl-accent-glow);
}

.bmw-tool-result {
	margin-top: 22px;
	padding: 16px 20px;
	background: #0E0E12;
	border: 1px solid var(--cl-accent-border);
	border-radius: var(--cl-radius-md);
	font-family: var(--cl-font-mono);
	color: var(--cl-ink);
}

.bmw-tool-result .error {
	color: #FF6B78;
	margin: 0;
}

@media (max-width: 640px) {
	.bmw-tool form {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* 2. ECU Tools Shortcodes ([ecu_recent_algos], [ecu_recent_files]) */
.ecu-recent-algos,
.ecu-recent-files {
	background: #141418;
	border: 1px solid var(--cl-border-strong);
	border-top: 2px solid var(--cl-accent);
	border-radius: var(--cl-radius-md);
	padding: 20px 22px;
	margin: 20px 0;
	font-family: var(--cl-font-mono);
}

.ecu-recent-algos h3,
.ecu-recent-files h3 {
	margin: 0 0 14px !important;
	font-family: var(--cl-font-display);
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--cl-ink);
}

.ecu-recent-algos ul,
.ecu-recent-files ul {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

.ecu-recent-algos li,
.ecu-recent-files li {
	padding: 10px 0 !important;
	border-bottom: 1px solid var(--cl-border) !important;
	font-size: 0.84rem !important;
	color: var(--cl-ink-secondary);
}

.ecu-recent-algos li:last-child,
.ecu-recent-files li:last-child {
	border-bottom: 0 !important;
}

.ecu-recent-algos .date,
.ecu-recent-files .datetime {
	color: var(--cl-ink-muted) !important;
}

.ecu-recent-algos .brand-ecu,
.ecu-recent-files .brand {
	color: var(--cl-accent) !important;
	font-weight: 600;
}

.ecu-recent-files .ecu {
	color: #34D399 !important;
}

.ecu-recent-algos .name,
.ecu-recent-files .algorithm {
	color: var(--cl-ink) !important;
}

/* 3. KT OTP Registrar & CHIPLOGIC LPC Flash OTP / ENCBOARD
 * The updated plugin stylesheets natively consume our --cl-* and --kt-otp-* tokens
 * without needing !important overrides. Keep minimal scope defaults here.
 */
body.chiplogic-theme .kt-otp-scope {
	--kt-otp-text: #E4E4EA;
	--kt-otp-link: #FFFFFF;
	--kt-otp-link-hover: var(--cl-accent);
	--kt-otp-btn-bg: var(--cl-accent);
	--kt-otp-btn-hover-bg: var(--cl-accent-hover);
	--kt-otp-btn-text: #FFFFFF;
	--kt-otp-btn-hover-text: #FFFFFF;
}

/* 4. Ultimate Member (Login, Register, Account, Profile) */
.um {
	color: var(--cl-ink-secondary) !important;
}

.um-form {
	max-width: 560px;
	margin-inline: auto;
}

.um .um-field-label label {
	color: var(--cl-ink) !important;
	font-weight: 500;
}

.um .um-form input[type="text"],
.um .um-form input[type="password"],
.um .um-form input[type="email"],
.um .um-form input[type="number"],
.um .um-form select,
.um .um-form textarea {
	background: #0E0E12 !important;
	color: var(--cl-ink) !important;
	border: 1px solid var(--cl-border-strong) !important;
	border-radius: var(--cl-radius-md) !important;
}

.um .um-form input:focus,
.um .um-form textarea:focus {
	border-color: var(--cl-accent) !important;
	box-shadow: 0 0 0 3px var(--cl-accent-dim) !important;
}

.um input[type="submit"].um-button,
.um a.um-button {
	background: var(--cl-accent) !important;
	color: #FFFFFF !important;
	border-radius: var(--cl-radius-md) !important;
	border: 0 !important;
	font-weight: 600 !important;
}

.um input[type="submit"].um-button:hover,
.um a.um-button:hover {
	background: var(--cl-accent-hover) !important;
}

.um a.um-button.um-alt {
	background: #23232B !important;
	color: var(--cl-ink) !important;
	border: 1px solid var(--cl-border-strong) !important;
}

.um a.um-button.um-alt:hover {
	background: #2C2C36 !important;
	border-color: var(--cl-accent) !important;
}

.um-profile-nav,
.um-account-side li a {
	background: #17171D !important;
	color: var(--cl-ink-secondary) !important;
}

.um-account-side li a.current,
.um-account-side li a:hover {
	background: var(--cl-accent) !important;
	color: #FFFFFF !important;
}

/* 5. GTranslate Header & Drawer Slot */
.cl-gtranslate-slot,
.cl-drawer__lang {
	position: relative;
	display: inline-flex;
	align-items: center;
	overflow: visible;
	z-index: 950;
}

.cl-drawer__lang {
	width: 100%;
	margin-top: 10px;
}

.cl-gtranslate-slot .gtranslate_wrapper,
.cl-gtranslate-slot .gt_switcher_wrapper,
.cl-drawer__lang .gtranslate_wrapper,
.cl-drawer__lang .gt_switcher_wrapper {
	position: relative !important;
	display: inline-flex;
	align-items: center;
	overflow: visible !important;
}

.cl-drawer__lang .gtranslate_wrapper,
.cl-drawer__lang .gt_switcher_wrapper,
.cl-drawer__lang .gt_switcher {
	width: 100% !important;
}

.cl-gtranslate-slot select,
.cl-gtranslate-slot .gt_selector,
.cl-drawer__lang select,
.cl-drawer__lang .gt_selector {
	background: rgba(255, 255, 255, 0.04) !important;
	color: var(--cl-ink) !important;
	border: 1px solid var(--cl-border-strong) !important;
	border-radius: var(--cl-radius-md) !important;
	padding: 7px 10px !important;
	font-family: var(--cl-font-mono);
	font-size: 0.8rem !important;
	cursor: pointer;
}

.cl-gtranslate-slot select:hover,
.cl-gtranslate-slot select:focus,
.cl-drawer__lang select:hover,
.cl-drawer__lang select:focus {
	border-color: var(--cl-accent) !important;
}

/* Fix GTranslate dwf.js ("Nice dropdown with flags"):
   By default dwf.js sets .gt_switcher { overflow: hidden } and .gt_option { position: relative },
   which makes the list expand up & down in-flow inside the flex navbar and clip languages. */
.cl-gtranslate-slot .gt_switcher,
.cl-drawer__lang .gt_switcher {
	position: relative !important;
	overflow: visible !important;
	line-height: 1.35 !important;
	font-family: var(--cl-font-sans) !important;
}

.cl-gtranslate-slot .gt_switcher .gt_selected,
.cl-drawer__lang .gt_switcher .gt_selected {
	position: relative !important;
	z-index: 2 !important;
	background: transparent !important;
	border-radius: var(--cl-radius-md) !important;
}

.cl-gtranslate-slot .gt_switcher .gt_selected a,
.cl-drawer__lang .gt_switcher .gt_selected a {
	display: flex !important;
	align-items: center !important;
	gap: 6px;
	width: auto !important;
	min-width: 148px;
	background: #18181E !important;
	color: var(--cl-ink) !important;
	border: 1px solid var(--cl-border-strong) !important;
	border-radius: var(--cl-radius-md) !important;
	padding: 7px 30px 7px 10px !important;
	line-height: 1.25 !important;
	white-space: nowrap !important;
	box-sizing: border-box !important;
}

.cl-drawer__lang .gt_switcher .gt_selected a {
	width: 100% !important;
}

.cl-gtranslate-slot .gt_switcher .gt_selected a:hover,
.cl-drawer__lang .gt_switcher .gt_selected a:hover {
	background: #202028 !important;
	border-color: var(--cl-accent) !important;
}

.cl-gtranslate-slot .gt_switcher .gt_selected a:after,
.cl-drawer__lang .gt_switcher .gt_selected a:after {
	top: 50% !important;
	margin-top: -8px !important;
}

.cl-gtranslate-slot .gt_switcher .gt_selected a img,
.cl-gtranslate-slot .gt_switcher .gt_option a img,
.cl-drawer__lang .gt_switcher .gt_selected a img,
.cl-drawer__lang .gt_switcher .gt_option a img {
	flex-shrink: 0;
	opacity: 1 !important;
	border-radius: 2px;
}

/* Desktop header: drop cleanly DOWNWARD out of flow */
.cl-gtranslate-slot .gt_switcher .gt_option {
	position: absolute !important;
	top: calc(100% + 6px) !important;
	bottom: auto !important;
	left: 0 !important;
	right: auto !important;
	z-index: 9999 !important;
	width: max-content !important;
	min-width: 100% !important;
	background: rgba(20, 20, 26, 0.98) !important;
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--cl-border-strong) !important;
	border-radius: var(--cl-radius-md) !important;
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65) !important;
	padding: 4px 0 !important;
	box-sizing: border-box !important;
	transition: none !important;
}

/* Mobile drawer footer: open UPWARD so it never clips off bottom of screen */
.cl-drawer__lang .gt_switcher .gt_option {
	position: absolute !important;
	bottom: calc(100% + 6px) !important;
	top: auto !important;
	left: 0 !important;
	right: 0 !important;
	z-index: 9999 !important;
	width: 100% !important;
	background: rgba(20, 20, 26, 0.98) !important;
	border: 1px solid var(--cl-border-strong) !important;
	border-radius: var(--cl-radius-md) !important;
	box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.65) !important;
	padding: 4px 0 !important;
	box-sizing: border-box !important;
	transition: none !important;
}

/* Override dwf.js hardcoded 198px height so no languages are cropped */
.cl-gtranslate-slot .gt_switcher:has(.gt_selected a.open) .gt_option,
.cl-drawer__lang .gt_switcher:has(.gt_selected a.open) .gt_option {
	height: auto !important;
	max-height: min(340px, calc(100vh - var(--cl-header-h) - 28px)) !important;
	overflow-y: auto !important;
	overflow-x: hidden !important;
}

.cl-gtranslate-slot .gt_switcher:not(:has(.gt_selected a.open)) .gt_option,
.cl-drawer__lang .gt_switcher:not(:has(.gt_selected a.open)) .gt_option {
	display: none !important;
	height: 0 !important;
}

.cl-gtranslate-slot .gt_switcher .gt_option a,
.cl-drawer__lang .gt_switcher .gt_option a {
	display: flex !important;
	align-items: center !important;
	gap: 8px;
	width: 100% !important;
	padding: 8px 12px !important;
	line-height: 1.3 !important;
	white-space: nowrap !important;
	color: var(--cl-ink-secondary) !important;
	box-sizing: border-box !important;
}

.cl-gtranslate-slot .gt_switcher .gt_option a:hover,
.cl-drawer__lang .gt_switcher .gt_option a:hover {
	background: var(--cl-accent-dim) !important;
	color: var(--cl-ink) !important;
}

.cl-gtranslate-slot .gt_switcher .gt_option::-webkit-scrollbar,
.cl-drawer__lang .gt_switcher .gt_option::-webkit-scrollbar {
	width: 6px;
}

.cl-gtranslate-slot .gt_switcher .gt_option::-webkit-scrollbar-track,
.cl-drawer__lang .gt_switcher .gt_option::-webkit-scrollbar-track {
	background: #141418;
}

.cl-gtranslate-slot .gt_switcher .gt_option::-webkit-scrollbar-thumb,
.cl-drawer__lang .gt_switcher .gt_option::-webkit-scrollbar-thumb {
	background: #333340;
	border-radius: 3px;
}

/* Also handle GTranslate Float widget if selected inside header slot */
.cl-gtranslate-slot .gt_float_switcher {
	position: relative !important;
	overflow: visible !important;
	background: #18181E !important;
	border: 1px solid var(--cl-border-strong) !important;
	border-radius: var(--cl-radius-md) !important;
}

.cl-gtranslate-slot .gt_float_switcher .gt_options {
	position: absolute !important;
	top: calc(100% + 6px) !important;
	bottom: auto !important;
	left: 0 !important;
	z-index: 9999 !important;
	min-width: 100% !important;
	max-height: min(340px, calc(100vh - var(--cl-header-h) - 28px)) !important;
	background: rgba(20, 20, 26, 0.98) !important;
	border: 1px solid var(--cl-border-strong) !important;
	border-radius: var(--cl-radius-md) !important;
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65) !important;
}

/* 6. Complianz GDPR Dark Engineering Theme Override */
.cmplz-cookiebanner {
	background: #15151A !important;
	color: var(--cl-ink-secondary) !important;
	border: 1px solid var(--cl-border-strong) !important;
	border-top: 2px solid var(--cl-accent) !important;
	border-radius: var(--cl-radius-lg) !important;
	box-shadow: var(--cl-shadow-lg) !important;
}

.cmplz-cookiebanner .cmplz-title,
.cmplz-cookiebanner .cmplz-message {
	color: var(--cl-ink) !important;
}

.cmplz-cookiebanner .cmplz-btn.cmplz-accept {
	background: var(--cl-accent) !important;
	border-color: var(--cl-accent) !important;
	color: #FFFFFF !important;
}

.cmplz-cookiebanner .cmplz-btn.cmplz-deny,
.cmplz-cookiebanner .cmplz-btn.cmplz-view-preferences {
	background: #22222A !important;
	border-color: var(--cl-border-strong) !important;
	color: var(--cl-ink) !important;
}
