/*
Copyright (C) 2016 Nauta Tecnològica, SCP - All Rights Reserved.
Unauthorized copying, publishing, commercial usage and/or distribution of this file,
via any medium, is strictly prohibited without the express permission of the owner.
*/
/* 
    Created on : 05/11/2016, 13:52:02
    Author     : Jordi Santacana <jordistc@nautalogica.com>
*/

/*@import "bootstrap/forms";*/

.field-error, 
.text-error {
	color: $text-error-color;
}

@mixin form-control-extra {
	@include box-shadow(none);

	&:focus {
		@include box-shadow(none);
	}

	&[disabled],
    &[readonly],
    fieldset[disabled] & {

        /*cursor: not-allowed;*/
		/*pointer-events: none;*/
		background-color: $input-bg-disabled;
		&:focus {
			border-color: $input-border;
		}
    }
}

.form-control {
	@include form-control-extra;
}

.input-group-lg > .form-control,
.input-group-lg > .input-group-addon,
.input-group-lg > .input-group-btn > .btn {
	height: $input-height-large;
}
.input-group-sm > .form-control,
.input-group-sm > .input-group-addon,
.input-group-sm > .input-group-btn > .btn {
	height: $input-height-small;
}

.form-control-sm {
	height: $input-height-small;
}

.has-success {
	.form-control {
		@include box-shadow(none);

		&:focus {
			@include box-shadow(none);
		}
	}
}
.has-warning {
	.form-control {
		@include box-shadow(none);

		&:focus {
			@include box-shadow(none);
		}
	}
}
.has-error {
	.form-control {
		@include box-shadow(none);

		&:focus {
			@include box-shadow(none);
		}
	}
}

select {
	&:focus,
		&::-moz-focus-inner {
		outline: 0 !important;
	}

	&:-moz-focusring {
		color: transparent !important;
		text-shadow: 0 0 0 #000 !important;
	}

	option {
		outline: 0 none !important;
		&:focus,
			&::-moz-focus-inner {
			outline: 0 none !important;
		}
	}
}

/*.input-group-addon {
	border-radius: 0;
	background-color: $brand-primary;
	border-color: #097e00;
	color: #fff;
}*/

form {
	dl {
		margin: 5px 0 10px;

		dt label {
			font-weight: 600;
			font-size: 0.9em;
			margin-bottom: 2px;
		}

		dd {
			input,
			select,
			textarea {
				display: block;
				width: 100%;
				/*@include form-control;*/
				@extend .form-control;
				@include form-control-extra;

				&.input-lg {
					height: $input-height-large;
				}
				
				&.input-sm {
					height: $input-height-small;
				}
			}
			
			.input-group {
				input,
				select {
					border-top-right-radius: 0 !important;
					border-bottom-right-radius: 0 !important;
				}
			}

			.bootstrap-select {
				.form-control {
					border-radius: $input-border-radius !important;
				}
			}

/*			.input-group-addon {
				border-radius: $input-border-radius !important;
			}*/

/*			.input-group-btn .btn {
				border-radius: $input-border-radius !important;
			}*/
		}

		&.inline {
			display: inline-block;
			margin-right: 15px;
			vertical-align: top;
			@include clearfix();

			&:last-child { 
				margin-right: 0; 
			}
		}
	}

	> .inline-body {
		display: inline-block;
		margin-right: 15px;
		margin-bottom: 10px;
		vertical-align: bottom;
		@include clearfix();

		dl, 
		.form-button {
			display: inline-block;
			margin-right: 15px;
			margin-bottom: 20px;
			vertical-align: top;
			
			&:last-child { 
				margin-right: 0; 
			}
		}
		
		dl {
			&.has-error {
				margin-bottom: 0;
			}
		}
	}

	.inline-body + .inline-footer {
		display: inline-block;
		margin-left: 15px;
		margin-bottom: 10px;
		vertical-align: bottom;
		@include clearfix();
	}

	.form-body + .form-footer {
		margin-top: 20px; 
	}

	.form-footer > .form-submit {
		text-align: right;
	}
}