/******************************************************************
Site Name:
Author:

Stylesheet: Responsive Gravity Forms Styles

Usage: Uncheck box in Gravity Forms Settings to "Not" Output default CSS.
Do not enable option "Enable enhanced user interface" on dropdowns - we're using Select2 rather than Chosen.

Last reviewed with plugin Version 2.0.2.

******************************************************************/

// Import Other Styles
@import "ready_classes";
@import "submission_and_errors";
@import "other_fields";
@import "credit_cards";

//
// GForm Wrapper
//

.gform_wrapper {
	overflow: inherit;
	margin: 1em auto;
	width: 100%;

	&:focus {
		outline: 0;
	}
}

//
// REQUIRED
//

.gfield_required {
	color: $color__alert-red;
	font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
	margin-left: 4px;
}

//
// INPUTS
//

textarea.small {
	height: 80px;
}

textarea.medium {
	height: 150px;
}

textarea.large {
	height: 250px;
}

//
// RADIO & CHECKBOXES
//

ul.gfield_checkbox,
ul.gfield_radio {
	margin: 0.5em 0 -0.5em;

	li {
		position: relative;
		width: 100%;
		display: inline-flex;
		align-items: center;
		margin-bottom: 0.5em;

		label {
			margin-bottom: 0;
		}

		input[type="text"] {
			width: auto;
		}
	}
}

ul.gfield_checkbox {
	li {
		input[type="checkbox"] {
			margin-left: 5px;
			margin-right: 10px;
		}
	}
}

ul.gfield_radio {
	li {
		input[type="radio"] {
			margin-left: 5px;
			margin-right: 10px;
		}
	}
}

//
// HOVER & FOCUS
//

.field_hover {
	border: 1px dashed #2175A9;
	cursor: pointer;
}

.field_selected {
	background-color: #DFEFFF;
	border: 1px solid #C2D7EF;
}

//
// CUSTOM FIELDS
//

.ginput_complex {
	overflow: hidden;

	.field_name_first,
	.field_name_last {
		width: 100%;
	}

	.ginput_left,
	.ginput_right,
	.ginput_full {
		min-height: 43px;
		display: block;
		overflow: hidden;
		margin-bottom: 0.5em;
	}

	.ginput_left,
	.ginput_right {
		width: 100%;
	}

	input[type="text"],
	input[type="url"],
	input[type="email"],
	input[type="tel"],
	input[type="number"],
	input[type="password"],
	select,
	.select2-container {
		width: 100%;
	}
}

//
// HEADER
//

.gform_heading {
	width: 100%;
	margin-bottom: 2em;
}

//
// BODY
//

.gform_body {}

//
// FOOTER
//

.gform_footer {
	margin: 1.5em 0 1em 0;
	clear: both;
}

//
// TITLES & DESCRIPTIONS
//

h2.gsection_title {
	margin: 0;
	padding: 0;
	letter-spacing: normal;
}

h2.gsection_title,
h3.gform_title {
	font-weight: bold;
	font-size: 1.3em;
}

h3.gform_title {
	letter-spacing: normal;
	margin: 10px 0 6px 0;
}

span.gform_description {
	font-weight: normal;
}

h2.gsection_title,
.gsection_description,
h3.gform_title {
	width: 100%;
}

.gform_wrapper .description,
.gfield_description,
.gsection_description,
.gform_wrapper .instruction {
	font-size: 0.85em;
	line-height: 1.5em;
	clear: both;
	letter-spacing: normal;
}

.gform_wrapper {
	.field_description_above {
		.description,
		.gfield_description,
		.gsection_description {
			padding: 4px 0 8px 0;
		}
	}

	.field_description_below {
		.description,
		.gfield_description,
		.gsection_description {
			padding: 4px 0 0 0;
		}
	}
}

.gfield_date_year + .gfield_description {
	padding: 0;
}

.left_label .gsection .gsection_description,
.right_label .gsection .gsection_description {
	margin-left: 0;
	padding-top: 4px;
	padding-left: 0;
	line-height: 1.5em;
}

//
// LISTS
//

form {
	ul {
		margin: 0;
		list-style-type: none;

		li {
			margin-left: 0;
			list-style-type: none;
			list-style-image: none;
			list-style: none;
			overflow: visible;

			&.gfield {
				clear: both;
				margin-bottom: 1em;
			}
		}
	}
}

ul.gfield_radio li,
ul.gfield_checkbox li {
	overflow: hidden;
}

form ul.right_label li,
form ul.left_label li {
	margin-bottom: 14px;
}

form ul.right_label li ul.gfield_radio li,
form ul.left_label li ul.gfield_radio li,
form ul.right_label li ul.gfield_checkbox li,
form ul.left_label li ul.gfield_checkbox li {
	margin-bottom: 10px;
}

form {
	ul li:before,
	ul li:after,
	ul.gform_fields {
		padding: 0;
		margin: 0;
		overflow: visible;
	}

	.inline {
		display: inline !important;
	}
}

//
// LABELS
//

ul.gfield_radio,
ul.gfield_checkbox {
	label {
		font-weight: normal;
	}
}

.ginput_complex {
	span {
		input:focus + label,
		select:focus + label,
		textarea:focus + label,
		.select2-container--focus ~ label {
			font-weight: bold;
		}
	}
}

.gform_wrapper {
	.form_sublabel_below {
		.ginput_complex label,
		.gfield_time_hour label,
		.gfield_time_minute label,
		.gfield_date_month label,
		.gfield_date_day label,
		.gfield_date_year label,
		.instruction {
			margin: 3px 0 0;
		}

		.ginput_complex + .description,
		.ginput_complex + .gfield_description,
		.ginput_complex + .gsection_description {
			margin-top: 0.3em;
		}
	}

	.form_sublabel_above {
		.ginput_complex label,
		.gfield_time_hour label,
		.gfield_time_minute label,
		.gfield_date_month label,
		.gfield_date_day label,
		.gfield_date_year label,
		.instruction {
			margin: 0 0 3px;
		}
	}
}

.ginput_complex label,
.gfield_time_hour label,
.gfield_time_minute label,
.gfield_date_month label,
.gfield_date_day label,
.gfield_date_year label,
.gform_wrapper .instruction {
	display: block;
	font-size: 0.7em;
	font-weight: normal;
	letter-spacing: 1px;
}

.top_label,
.left_label,
.right_label {
	.gfield_label {
		margin: 10px 0 5px 0;
		display: inline-block;
		line-height: 1.3em;
		clear: both;
	}
}

.gsection .gfield_label {
	font-weight: bold;
	font-size: 1.3em;
}

.gform_wrapper {
	.hidden_label {
		.gfield_label {
			clip: rect(1px, 1px, 1px, 1px);
			position: absolute !important;
			height: 1px;
			width: 1px;
			overflow: hidden;
		}
	}

	.top_label {
		.hidden_label {
			.ginput_container {
				padding-top: 10px;
			}
		}
	}
}


//
// SECTIONS
//

.gsection {
	border-bottom: 4px double #CCC;
	padding: 2em 0 0.5em 0;
	margin: 0 0 1em;
	clear: both;

	&:first-of-type {
		padding: 0 0 0.5em 0;
	}
}

//
// MEDIA QUERIES
//

@include media-breakpoint-up('md') {

	.gform_footer {
		&.right_label,
		&.left_label {
			padding: 16px 0 10px 31%;
		}
	}

	.gform_heading {
		width: auto;
	}

	.field_name_first,
	.field_name_last {
		width: 49%;
	}

	.left_label {
		.gfield_label {
			float: left;
			margin: 0 2% 0 0;
			width: 29%;
		}
	}

	.right_label {
		.gfield_label {
			float: left;
			margin: 0 2% 0 0;
			width: 29%;
			text-align: right;
		}
	}

	.left_label .gfield_description,
	.right_label .gfield_description {
		width: 69%;
	}

	.left_label ul.gfield_checkbox,
	.right_label ul.gfield_checkbox,
	.left_label ul.gfield_radio,
	.right_label ul.gfield_radio {
		margin-left: 32%;
		overflow: hidden;
	}

	.right_label .gfield_description,
	.left_label .gfield_description,
	.left_label .instruction,
	.right_label .instruction {
		margin-left: 31%;
	}

	.field_name_first {
		float: left;
	}

	.field_name_last {
		float: right;
	}

	.ginput_complex {
		.name_last {
			clear: none;
		}

		&.has_prefix.has_first_name.has_middle_name.has_last_name.has_suffix {
			.name_prefix,
			.name_first,
			.name_middle,
			.name_last {
				float: left;
			}

			.name_suffix {
				float: right;
			}

			.name_prefix,
			.name_suffix {
				width: 10%;
			}

			.name_prefix {
				margin-right: 2%;
			}

			.name_first,
			.name_middle,
			.name_last {
				margin-right: 2%;
				width: 24%;
			}
		}

		&.no_prefix.has_first_name.has_middle_name.has_last_name.no_suffix {
			.name_first,
			.name_middle,
			.name_last {
				width: 32%;
			}

			.name_first,
			.name_middle {
				float: left;
				margin-right: 2%;
			}

			.name_last {
				float: right;
			}
		}

		&.no_prefix.has_first_name.no_middle_name.has_last_name.no_suffix {
			.name_first {
				float: left;
				width: 49%;
			}

			.name_last {
				float: right;
				width: 49%;
			}
		}

		&.has_prefix.has_first_name.no_middle_name.has_last_name.no_suffix {
			.name_prefix {
				float: left;
				margin-right: 2%;
				width: 20%;
			}

			.name_first {
				float: left;
				margin-right: 2%;
				width: 38%;
			}

			.name_last {
				float: right;
				width: 38%;
			}
		}

		&.no_prefix.has_first_name.no_middle_name.has_last_name.has_suffix {
			.name_first,
			.name_last {
				float: left;
				margin-right: 2%;
				width: 38%;
			}

			.name_suffix {
				float: right;
				width: 20%;
			}
		}

		.ginput_full {
			clear: both;
		}

		.ginput_left {
			float: left;
			width: 49%;
		}

		.ginput_right {
			float: right;
			width: 49%;
		}
	}

}
