.root {
	font-family: var(--font-family);
	box-sizing: border-box;
	display: block;
	font-size: var(--font-size-base);
	line-height: var(--line-height-base);
	min-height: var(--line-height-base);
	padding: 0 0 0 calc(var(--grid-base) * 3);
	position: relative;
}

.input {
	height: 100%;
	left: 0;
	margin: 0;
	opacity: 0;
	position: absolute;
	top: 0;
	width: 100%;
}

.inputWrapper {
	composes: checkIcon icon from './icon.m.css';
	left: 0;
	position: absolute;
	top: calc(var(--grid-base) / 2);
}

.inputWrapper::before,
.inputWrapper::after {
	display: block;
	height: calc(var(--grid-base) * 2);
	width: calc(var(--grid-base) * 2);
}

.inputWrapper::after {
	background-color: var(--color-background);
	border: var(--border-width) solid var(--color-border-strong);
	content: '';
}

.inputWrapper::before {
	color: var(--color-border-strong);
	font-size: var(--font-size-small);
	left: 0;
	line-height: calc(var(--grid-base) * 2);
	position: absolute;
	text-align: center;
	top: 0;
	transform: scale(0);
	transition: transform var(--transition-duration) var(--transition-easing);
	width: 100%;
}

/* checked style */
.checked .inputWrapper::before {
	transform: scale(1);
}

.focused .inputWrapper::before {
	color: var(--color-highlight);
}

.focused .inputWrapper::after {
	border: var(--border-width-emphasized) solid var(--color-highlight);
	box-shadow: var(--box-shadow-dimensions-small) var(--color-box-shadow-highlight);
}

.focused .onLabel,
.focused .offLabel {
	color: var(--color-highlight);
}

/* disabled and readonly styles */
.disabled .inputWrapper::after,
.readonly .inputWrapper::after {
	background-color: var(--color-background-faded);
	border-color: var(--color-border);
}

/* invalid style */
.invalid .inputWrapper::after {
	border-color: var(--color-error);
}
.invalid .inputWrapper::before {
	color: var(--color-error);
}

/* valid style */
.valid .inputWrapper::after {
	border-color: var(--color-success);
}
.valid .inputWrapper::before {
	color: var(--color-success);
}
