.form-horizontal .form-group {
    position: relative;
    z-index: 1;
    margin-left: 0;
    margin-right: 0;
}

input:active, input:focus {
	outline: 0;
	box-shadow: none !important;
}

.form-control {
	box-shadow: none;
	border: 0;
	border-bottom: @form-control-border;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding: 0;
	border-radius: 0;
	background-color: transparent;

	&:active {
		border-bottom-color: #b4b4b4;
	}

	&:focus {
		border-bottom-color: #b4b4b4;
		box-shadow: none;
	}

	&.auto-size {
		padding-top: 6px;
	}
}

.form-group .fg-line label {
	font-weight: normal;
	font-size: 14px;
}

.input-group-addon {
	//border-width: 0 0 1px;
	border: none;
	background: none;
	font-size: 13px;
	line-height: 2;
}

.input-group {
	.input-group-addon {
		vertical-align: bottom;
		padding: 0;

		.md {
			line-height: 100%;
		}
	}

	&:not(.input-group-lg):not(.input-group-sm) {
		.input-group-addon {
			&.last {
				padding-left: 10px;
			}

			.md {
				font-size: 23px;
			}
		}
	}

	&.input-group-lg {
		.input-group-addon {
			&:not(.last) {
				padding-right: 15px;
			}

			&.last {
				padding-left: 15px;
			}

			.md {
				font-size: 30px;
			}
		}
	}

	&.input-group-sm {
		.input-group-addon {
			&:not(.last) {
				padding-right: 5px;
			}

			&.last {
				padding-left: 5px;
			}

			.md {
				font-size: 18px;
			}
		}
	}

	>[class*=col-] {
		padding: 0;
	}

	.fg-line {
		padding: 0 10px;

		&:after {
			left: 10px;
		}

		&.fg-toggled:after {
			margin-left: 10px;
			width: ~"calc(100% - 20px)";
		}
	}
}

//fg-line
html:not(.ie9) .select:not(.fg-line):before {
	right: 0;
}

html:not(.ie9) .select.fg-line:before {
	right: 10px;
}

.fg-line {
	position: relative;
	vertical-align: top;

	&:not(.form-group) {
		display: inline-block;
		width: 100%;
	}
	
	.form-control[readonly] {
		background-color: inherit;
	}

	.form-control {
		resize: none;

		&:not(:disabled) {
			color: @body-color;
		}

		&:disabled {
			color: #9d9d9d;
			background: 0 0;
		}
	}

	&:not(.disabled):after, &:not(.readonly):after {
		position: absolute;
		z-index: 3;
		bottom: 0;
		left: 0;
		height: 2px;
		width: 0;
		content: "";
		-webkit-transition: all;
		-moz-transition: all;
		-o-transition: all;
		transition: all;
		-webkit-transition-duration: 300ms;
		transition-duration: 300ms;
	}

	&:not([class*=has-]):after {
		background: @fg-line-color;
	}

	&.input-toggled:after {
		width: 100%;
	}

	&.readonly .form-control {
		color: #9d9d9d;
		background: 0 0;
	}

	&.fg-toggled:after {
		width: 100%;
	}

	&.has-success:after {
		background: @material-success;
	}

	&.has-warning:after {
		background: #ffc107;
	}

	&.has-error:after {
		background: @material-danger;
	}
}

.has-success .fg-line:after {
	background: @material-success;
}

.has-warning .fg-line:after {
	background: #ffc107
}

.has-error .fg-line:after {
	background: @material-danger;
}

//fg-float
.fg-float {
	margin-top: 2px;
	position: relative;

	.form-control {
		position: relative;
		background: 0 0;
		z-index: 1;

		&::-moz-placeholder {
			color: @placeholder-color;
			opacity: 1;
		}

		&:-ms-input-placeholder {
			color: @placeholder-color;
		}

		&::-webkit-input-placeholder {
			color: @placeholder-color;
		}
	}

	.fg-label {
		-webkit-transition: all;
		-moz-transition: all;
		-o-transition: all;
		transition: all;
		-webkit-transition-duration: 200ms;
		transition-duration: 200ms;
		position: absolute;
		top: 10px;
		font-weight: 400;
		color: #959595;
		pointer-events: none;
		z-index: 0;
		left: 0;
		margin-left: 25px;
	}

	.input-lg+.fg-label {
		font-size: 17px;
	}

	.input-sm+.fg-label {
		font-size: 11px;
	}

	.fg-toggled+.fg-label {
		top: -15px;
		font-size: 11px;
	}
}

//checkbox & radio
.checkbox label, .radio label  {
	padding-left: 30px;
	position: relative;
}

.checkbox input, .radio input {
    top: 0;
    left: 0;
    margin-left: 0!important;
    z-index: 1;
    cursor: pointer;
    opacity: 0;
    filter: alpha(opacity=0);
    margin-top: 0;
}

.checkbox .input-helper:before, .radio .input-helper:before, .checkbox .input-helper:after, .radio .input-helper:after {
    -webkit-transition: all;
    -moz-transition: all;
    -o-transition: all;
    transition: all;
    -webkit-transition-duration: 250ms;
    transition-duration: 250ms;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
    position: absolute;
    content: "";
}

.checkbox .input-helper:before, .radio .input-helper:before {
    left: 0;
    border: 1px solid #ccc;
}

.checkbox.disabled, .radio.disabled {
    opacity: .6;
    filter: alpha(opacity=60);
}

.checkbox input {
    width: 17px;
    height: 17px;
}

.checkbox input:checked+.input-helper:before {
    -webkit-transform: scale(0);
    -ms-transform: scale(0);
    -o-transform: scale(0);
    transform: scale(0);
}

.checkbox input:checked+.input-helper:after {
    -webkit-transform: scale(1) rotate(-50deg);
    -ms-transform: scale(1) rotate(-50deg);
    -o-transform: scale(1) rotate(-50deg);
    transform: scale(1) rotate(-50deg);
    opacity: 1;
    filter: alpha(opacity=100);
}

.checkbox .input-helper:before {
    top: 0;
    width: 17px;
    height: 17px;
}

.checkbox .input-helper:after {
    opacity: 0;
    filter: alpha(opacity=0);
    -webkit-transform: scale(0) rotate(80deg);
    -ms-transform: scale(0) rotate(80deg);
    -o-transform: scale(0) rotate(80deg);
    transform: scale(0) rotate(80deg);
    width: 22px;
    height: 9px;
    border-bottom: 2px solid @checkbox-check-color;
    border-left: 2px solid @checkbox-check-color;
    border-bottom-left-radius: 3px;
    left: -1px;
    top: 1px;
}

.has-error .checkbox .input-helper:before {
    border-color: #f99d97;
}

.has-error .checkbox .input-helper:after {
    border-bottom-color: #f77066;
    border-left-color: #f77066;
}

.has-success .checkbox .input-helper:before {
    border-color: #92cf94;
}

.has-success .checkbox .input-helper:after {
    border-bottom-color: #6ec071;
    border-left-color: #6ec071;
}

.has-warning .checkbox .input-helper:before {
    border-color: #ffdb6d;
}

.has-warning .checkbox .input-helper:after {
    border-bottom-color: #ffce3a;
    border-left-color: #ffce3a;
}

.radio input {
    width: 19px;
    height: 19px;
}

.radio input:checked+.input-helper:after {
    -webkit-transform: scale(1);
    -ms-transform: scale(1);
    -o-transform: scale(1);
    transform: scale(1);
}

.radio .input-helper:before {
	top: -1px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
}

.radio .input-helper:after {
	width: 11px;
	height: 11px;
	background: #009688;
	border-radius: 50%;
	top: 3px;
	left: 4px;
	-webkit-transform: scale(0);
	-ms-transform: scale(0);
	-o-transform: scale(0);
	transform: scale(0);
}

.checkbox-inline, .radio-inline {
	vertical-align: top;
	margin-top: 0;
	padding-left: 25px;
}

.toggle-switch {
	display: inline-block;
	vertical-align: top;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;

	.ts-label {
		display: inline-block;
		margin: 0 20px 0 0;
		vertical-align: top;
		-webkit-transition: color .56s cubic-bezier(0.4, 0, .2, 1);
		transition: color .56s cubic-bezier(0.4, 0, .2, 1);
	}

	.ts-helper {
		display: inline-block;
		position: relative;
		width: 40px;
		height: 16px;
		border-radius: 8px;
		background: rgba(0, 0, 0, .26);
		-webkit-transition: background .28s cubic-bezier(0.4, 0, .2, 1);
		transition: background .28s cubic-bezier(0.4, 0, .2, 1);
		vertical-align: middle;
		cursor: pointer;

		&:before {
			content: '';
			position: absolute;
			top: -4px;
			left: -4px;
			width: 24px;
			height: 24px;
			background: #fafafa;
			box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
			border-radius: 50%;
			webkit-transition: left .28s cubic-bezier(0.4, 0, .2, 1), background .28s cubic-bezier(0.4, 0, .2, 1), box-shadow .28s cubic-bezier(0.4, 0, .2, 1);
			transition: left .28s cubic-bezier(0.4, 0, .2, 1), background .28s cubic-bezier(0.4, 0, .2, 1), box-shadow .28s cubic-bezier(0.4, 0, .2, 1);
		}
	}

	&:not(.disabled) .ts-helper:active:before {
		box-shadow: 0 2px 8px rgba(0, 0, 0, .28), 0 0 0 20px rgba(128, 128, 128, .1);
	}

	input {
		position: absolute;
		z-index: 1;
		width: 46px;
		margin: 0 0 0 -4px;
		height: 24px;
		opacity: 0;
		filter: alpha(opacity=0);
		cursor: pointer;

		&:checked+.ts-helper:before {
			left: 20px
		}
	}

	&:not([data-ts-color]) input:not(:disabled):checked+.ts-helper {
		background: rgba(33, 150, 243, .5);

		&:before {
			background: @material-primary;
		}

		&:active:before {
			box-shadow: 0 2px 8px rgba(0, 0, 0, .28), 0 0 0 20px rgba(33, 150, 243, .2)
		}
	}

	&.disabled {
		opacity: .6;
		filter: alpha(opacity=60)
	}
}

.form-group .fg-line label {
	font-weight: normal;
	font-size: 14px;
}


//topic-select
[component="category/topic"] {
	
	.checkbox label  {
		padding-left: 0;
		position: relative;
	}
	
	.checkbox .select {
	    top: 0;
	    left: 0;
	    margin-left: 0!important;
	    z-index: 1;
	    opacity: 0;
	    filter: alpha(opacity=0);
	    margin-top: 0;
	}
	
	.checkbox .input-helper:before, .checkbox .input-helper:after {
	    -webkit-transition: all;
	    -moz-transition: all;
	    -o-transition: all;
	    transition: all;
	    -webkit-transition-duration: 250ms;
	    transition-duration: 250ms;
	    -webkit-backface-visibility: hidden;
	    -moz-backface-visibility: hidden;
	    backface-visibility: hidden;
	    position: absolute;
	    content: "";
	}
	
	.checkbox .input-helper:before {
	    left: 0;
	    border: 1px solid #ccc;
	}
	
	.checkbox.disabled {
	    opacity: .6;
	    filter: alpha(opacity=60);
	}
	
	.checkbox .select {
	    width: 17px;
	    height: 17px;
	}
	
	&.selected {
		.checkbox .input-helper:before {
		    -webkit-transform: scale(0);
		    -ms-transform: scale(0);
		    -o-transform: scale(0);
		    transform: scale(0);
		}
		
		.checkbox .input-helper:after {
		    -webkit-transform: scale(1) rotate(-50deg);
		    -ms-transform: scale(1) rotate(-50deg);
		    -o-transform: scale(1) rotate(-50deg);
		    transform: scale(1) rotate(-50deg);
		    opacity: 1;
		    filter: alpha(opacity=100);
		}
	}
	
	.checkbox .input-helper:before {
	    top: 0;
	    width: 17px;
	    height: 17px;
	}
	
	.checkbox .input-helper:after {
	    opacity: 0;
	    filter: alpha(opacity=0);
	    -webkit-transform: scale(0) rotate(80deg);
	    -ms-transform: scale(0) rotate(80deg);
	    -o-transform: scale(0) rotate(80deg);
	    transform: scale(0) rotate(80deg);
	    width: 22px;
	    height: 9px;
	    border-bottom: 2px solid @checkbox-check-color;
	    border-left: 2px solid @checkbox-check-color;
	    border-bottom-left-radius: 3px;
	    left: -1px;
	    top: 1px;
	}
}

select.form-control option {
	color: @body-color;
	background-color: @body-bg-color;
}