/* ============================================================================
 * Bitrix's genuine switcher component stylesheet.
 *
 * Vendored VERBATIM from the portal source at
 *   <webroot>/bitrix/js/ui/switcher/src/css/style.css
 * It contains no url()s, so it drops in unmodified. Do not edit this file —
 * app-level adjustments belong in app-b24.css so this stays a clean copy that
 * can be re-vendored.
 *
 * WHY THE CLASSIC SWITCHER AND NOT BITRIX'S NEWER "AIR" ONE:
 * Bitrix ships two switcher designs. The AIR one (switcher/src/css/air.css) is
 * the compact textless pill seen in current Bitrix screens — but it resolves
 * its colour from `--ui-color-design-filled-bg` -> `--ui-color-accent-main-primary`
 * = **#0075FF**, and it needs the separate 160KB `design-tokens/air/` stylesheet
 * which this Bitrix version doesn't load by default. This app is built on the
 * CLASSIC design system throughout (buttons, forms, labels, grid), whose primary
 * is **#2fc6f6**. Pulling in AIR would render a switcher in a visibly different
 * blue from every other control on the page, and add 160KB to do it.
 * This file uses `var(--ui-color-primary)` and therefore matches the app exactly.
 *
 * NOTE the component's JS (ui.switcher.bundle.js) is a BX-core extension an
 * external marketplace app cannot run, so the on/off behaviour is supplied by
 * the app instead — see `.jfx-switch` in app-b24.css, which drives the state
 * from a real <input type="checkbox"> with pure CSS and no JS at all.
 *
 * KNOWN DANGLING REFERENCE (Bitrix's own, left as-is): the ON/OFF labels ask for
 * `var(--ui-font-family-open-sans)`, which is NOT defined in this Bitrix
 * version's design tokens. An undefined var with no fallback makes the property
 * invalid at computed-value time, so font-family simply inherits — which is the
 * behaviour we want anyway. app-b24.css defines it explicitly rather than rely
 * on that.
 * ========================================================================= */
.ui-switcher {
	position: relative;
	display: inline-block;
	height: 22px;
	width: 53px;
	border-radius: 32px;
	overflow: hidden;
	box-sizing: border-box;
	cursor: pointer;
	z-index: 4;
	user-select: none;
}

.ui-switcher-enabled,
.ui-switcher-disabled {
	display: inline-block;
	position: absolute;
	left: 0;
	width: 100%;
	height: 100%;
	color: rgba(var(--ui-color-on-primary-rgb), var(--ui-opacity-40));
	font-size: var(--ui-font-size-6xs);
	line-height: 22px;
	font-family: var(--ui-font-family-open-sans);
	font-weight: var(--ui-font-weight-bold, 700);
	text-transform: uppercase;
	vertical-align: middle;
	transition: opacity .2s ease-out;
	overflow: hidden;
	box-sizing: border-box;
	z-index: 1;
}

.ui-switcher-enabled {
	padding: 0 25px 0 0;
	background-color: var(--ui-color-primary);
	text-align: right;
	z-index: 2;
}

.ui-switcher-disabled {
	padding: 0 0 0 22px;
	background-color: var(--ui-color-base-15);
	color: var(--ui-color-base-40);
}

.ui-switcher-cursor {
	position: absolute;
	top: 50%;
	left: 0;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--ui-color-background-primary);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .09);
	transform: translate(33px, -50%);
	transition: transform .2s ease-out;
	z-index: 3;
}

.ui-switcher-cursor svg {
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	margin: auto;
	height: inherit;
	width: inherit;
	-webkit-animation: rotate 1s linear infinite;
	animation: rotate 1s linear infinite;
	-webkit-transform-origin: center center;
	transform-origin: center center;
}

.ui-switcher-cursor svg circle {
	stroke: #ccc;
	stroke-dasharray: 60, 200;
	stroke-dashoffset: 0;
	animation: dash 1.5s linear infinite;
	stroke-linecap: round;
}

/* region ---STATES--- */

/* SIZE */
.ui-switcher-size-xs.ui-switcher {
	width: 25px;
	height: 13px;
}

.ui-switcher-size-xs .ui-switcher-cursor {
	/*top: 2px;*/
	width: 9px;
	height: 9px;
}

.ui-switcher-size-xs .ui-switcher-enabled,
.ui-switcher-size-xs .ui-switcher-disabled {
	padding: 0;
	font-size: 0;
}

.ui-switcher-size-xs .ui-switcher-cursor {
	transform: translate(12px, -50%);
}

.ui-switcher-size-sm.ui-switcher {
	width: 43px;
	height: 17px;
}

.ui-switcher-size-sm .ui-switcher-cursor {
	width: 11px;
	height: 11px;
}

.ui-switcher-size-sm .ui-switcher-enabled,
.ui-switcher-size-sm .ui-switcher-disabled {
	font-size: var(--ui-font-size-7xs);
	line-height: 17px;
	font-family: var(--ui-font-family-open-sans);
	font-weight: var(--ui-font-weight-bold, 700);
}

.ui-switcher-size-sm .ui-switcher-enabled {
	padding: 0 21px 0 0;
}

.ui-switcher-size-sm .ui-switcher-disabled {
	padding: 0 0 0 17px;
}

.ui-switcher-size-sm .ui-switcher-cursor {
	transform: translate(27px, -50%);
}

/* COLORS */

.ui-switcher-color-green .ui-switcher-enabled {
	background-color: #bbed22;
	text-align: right;
	color: rgba(var(--ui-color-text-secondary-rgb), var(--ui-opacity-30));
}

.ui-switcher-off .ui-switcher-cursor {
	transform: translate(4px, -50%);
}

.ui-switcher-off .ui-switcher-disabled {
	opacity: 1;
}

.ui-switcher-off .ui-switcher-enabled {
	opacity: 0;
}

.ui-switcher-lock {
	opacity: .4;
	cursor: not-allowed;
}
/* endregion */
