/**
 * ForeFront Web / survey form styling
 *
 * Scoped to any Gravity Form carrying the "ff-survey" CSS class.
 * Covers Likert grids, choice controls, multi-page navigation and the
 * progress bar, none of which the main theme bundle styles.
 *
 * Palette: green #506055, dark green #39443C, pale green #A5AFA7,
 *          terracotta #C68061, light gray #F8F7F6, near black #212121.
 */

/* ---------- Progress bar ---------- */
#page .ff-survey .gf_progressbar_wrapper {
	margin-bottom: 40px;
}

#page .ff-survey .gf_progressbar_title {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #5b5b5b;
	margin-bottom: 10px;
}

#page .ff-survey .gf_progressbar {
	background-color: #F8F7F6;
	border: 1px solid #E4E2DF;
	border-radius: 999px;
	overflow: hidden;
	height: 22px;
	padding: 0;
}

#page .ff-survey .gf_progressbar_percentage {
	height: 22px;
	line-height: 22px;
	border-radius: 999px;
	transition: width 0.35s ease-in-out;
	text-align: right;
}

#page .ff-survey .gf_progressbar_percentage span {
	font-size: 12px;
	font-weight: 600;
	padding-right: 10px;
	letter-spacing: 0.3px;
}

/* ---------- Field rhythm and labels ---------- */
#page .ff-survey .gform_page .gfield {
	margin-bottom: 34px;
}

#page .ff-survey .gfield_label {
	display: block;
	font-size: 19px;
	font-weight: 600;
	line-height: 1.4;
	color: #212121;
	margin-bottom: 10px;
}

#page .ff-survey .gfield_description {
	font-size: 15px;
	line-height: 1.5;
	color: #5b5b5b;
	padding-top: 0;
	margin-bottom: 14px;
}

/* ---------- Radio and checkbox choices ---------- */
#page .ff-survey .gfield_radio .gchoice,
#page .ff-survey .gfield_checkbox .gchoice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 10px 14px;
	border: 1px solid transparent;
	border-radius: 6px;
	transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

#page .ff-survey .gfield_radio .gchoice:hover,
#page .ff-survey .gfield_checkbox .gchoice:hover {
	background-color: #F8F7F6;
}

#page .ff-survey .gfield_radio .gchoice:focus-within,
#page .ff-survey .gfield_checkbox .gchoice:focus-within {
	background-color: #F8F7F6;
	border-color: #A5AFA7;
}

#page .ff-survey .gfield_radio .gchoice input[type=radio],
#page .ff-survey .gfield_checkbox .gchoice input[type=checkbox] {
	width: 20px;
	height: 20px;
	margin: 3px 0 0;
	flex: 0 0 auto;
	accent-color: #506055;
	cursor: pointer;
}

#page .ff-survey .gfield_radio .gchoice label,
#page .ff-survey .gfield_checkbox .gchoice label {
	font-size: 17px;
	line-height: 1.45;
	color: #212121;
	margin: 0;
	cursor: pointer;
}

#page .ff-survey .gchoice_other_control[type=text] {
	flex: 1 1 auto;
	height: 44px !important;
	padding: 8px 14px !important;
	font-size: 16px !important;
	margin: 0;
}

/* ---------- Likert grid ---------- */
#page .ff-survey table.gsurvey-likert {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #E4E2DF;
	border-radius: 6px;
	overflow: hidden;
	margin-top: 4px;
}

#page .ff-survey table.gsurvey-likert th,
#page .ff-survey table.gsurvey-likert td {
	border: none;
}

#page .ff-survey table.gsurvey-likert thead th.gsurvey-likert-choice-label {
	background-color: #506055;
	color: #FFFFFF;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.3px;
	text-align: center;
	vertical-align: middle;
	padding: 12px 8px;
}

#page .ff-survey table.gsurvey-likert tbody tr {
	border-bottom: 1px solid #E4E2DF;
	transition: background-color 0.15s ease-in-out;
}

#page .ff-survey table.gsurvey-likert tbody tr:last-child {
	border-bottom: none;
}

#page .ff-survey table.gsurvey-likert tbody tr:nth-child(even) {
	background-color: #F8F7F6;
}

#page .ff-survey table.gsurvey-likert tbody tr:hover,
#page .ff-survey table.gsurvey-likert tbody tr:focus-within {
	background-color: rgba(165, 175, 167, 0.35);
}

#page .ff-survey table.gsurvey-likert thead td.gsurvey-likert-row-label {
	padding: 0;
}

#page .ff-survey table.gsurvey-likert td.gsurvey-likert-row-label {
	padding: 16px 20px 16px 16px;
	font-size: 16px;
	line-height: 1.45;
	color: #212121;
	max-width: 320px;
}

#page .ff-survey table.gsurvey-likert td.gsurvey-likert-choice {
	text-align: center;
	vertical-align: middle;
	padding: 10px 8px;
}

#page .ff-survey table.gsurvey-likert td.gsurvey-likert-choice input[type=radio] {
	width: 22px;
	height: 22px;
	margin: 0;
	accent-color: #506055;
	cursor: pointer;
}

/* Likert stacks into cards on phones */
@media screen and (max-width: 767px) {

	#page .ff-survey table.gsurvey-likert {
		border: none;
		border-radius: 0;
	}

	#page .ff-survey table.gsurvey-likert thead {
		display: none;
	}

	#page .ff-survey table.gsurvey-likert tbody,
	#page .ff-survey table.gsurvey-likert tbody tr,
	#page .ff-survey table.gsurvey-likert tbody td {
		display: block;
		width: 100%;
	}

	#page .ff-survey table.gsurvey-likert tbody tr,
	#page .ff-survey table.gsurvey-likert tbody tr:nth-child(even) {
		background-color: #FFFFFF;
		border: 1px solid #E4E2DF;
		border-radius: 6px;
		margin-bottom: 18px;
		padding: 14px 16px;
	}

	#page .ff-survey table.gsurvey-likert thead td.gsurvey-likert-row-label {
	padding: 0;
}

#page .ff-survey table.gsurvey-likert td.gsurvey-likert-row-label {
		padding: 0 0 10px;
		max-width: none;
		font-weight: 600;
	}

	#page .ff-survey table.gsurvey-likert td.gsurvey-likert-choice {
		display: flex;
		align-items: center;
		gap: 12px;
		text-align: left;
		padding: 10px 0;
		border-top: 1px solid #F1EFEC;
	}

	#page .ff-survey table.gsurvey-likert td.gsurvey-likert-choice::before {
		content: attr(data-label);
		order: 2;
		font-size: 16px;
		line-height: 1.4;
		color: #212121;
	}

	#page .ff-survey table.gsurvey-likert td.gsurvey-likert-choice input[type=radio] {
		order: 1;
	}
}

/* ---------- Multi page navigation ---------- */
#page .ff-survey .gform_page_footer {
	margin: 34px 0 0;
	padding-top: 24px;
	border-top: 1px solid #E4E2DF;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

#page .ff-survey .gform_page_footer .gform_next_button,
#page .ff-survey .gform_page_footer .gform_button {
	text-align: center;
	display: inline-block;
	transition: all 0.2s ease-in-out;
	padding: 9px 25px;
	color: #FFFFFF;
	background-color: #506055;
	border: 2px solid #506055;
	font-weight: 500;
	font-size: 18px;
	min-width: 200px;
	margin: 0 !important;
	text-decoration: none;
}

#page .ff-survey .gform_page_footer .gform_next_button:hover,
#page .ff-survey .gform_page_footer .gform_next_button:focus,
#page .ff-survey .gform_page_footer .gform_button:hover,
#page .ff-survey .gform_page_footer .gform_button:focus {
	outline: none;
	background-color: #39443C;
	border-color: #39443C;
	color: #FFFFFF;
}

#page .ff-survey .gform_page_footer .gform_previous_button {
	text-align: center;
	display: inline-block;
	transition: all 0.2s ease-in-out;
	padding: 9px 25px;
	background-color: transparent;
	color: #506055;
	border: 2px solid #506055;
	font-weight: 500;
	font-size: 18px;
	min-width: 160px;
	margin: 0 !important;
	text-decoration: none;
}

#page .ff-survey .gform_page_footer .gform_previous_button:hover,
#page .ff-survey .gform_page_footer .gform_previous_button:focus {
	outline: none;
	border-color: #39443C;
	color: #39443C;
	background-color: rgba(80, 96, 85, 0.1);
}

@media screen and (max-width: 767px) {

	#page .ff-survey .gform_page_footer {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	#page .ff-survey .gform_page_footer .gform_next_button,
	#page .ff-survey .gform_page_footer .gform_previous_button,
	#page .ff-survey .gform_page_footer .gform_button {
		width: 100%;
		min-width: 0;
	}
}

/* ---------- Validation ---------- */
#page .ff-survey .gfield_error .gfield_label {
	color: #B05730;
}

#page .ff-survey .gfield_error .gsurvey-likert,
#page .ff-survey .gfield_error input[type=text],
#page .ff-survey .gfield_error textarea {
	border-color: #B05730 !important;
}
