/**
 * Fluent Forms in the Core Treks look.
 *
 * Gravity Forms drew the site's forms with its own theme plus the theme's
 * form styles (src/styles/layout/form.scss). The values here were read from
 * the live Gravity forms as the browser draws them, and checked side by side
 * with their Fluent copies at desktop and phone width. Plain CSS, loaded by
 * app/GravityForms/FluentForms.php only where Fluent Forms is active.
 *
 * Two additions only, as agreed: one red star on each required field, and
 * the message that replaces the form on success. Error text uses a lighter
 * red than Gravity's, so it stays readable on the dark sections.
 *
 * This file must print after Fluent's own stylesheets, which use selectors
 * of the same weight: FluentForms.php loads it with them as dependencies.
 * Submit buttons take the site's own button (.btn.btn--secondary), so they
 * stand out on the teal sections and in the white popups alike.
 *
 * Author: Pravash Karki - pravashkarki.com
 */

.fluentform {
	--ct-ff-text: #fff;
	--ct-ff-line: #fff;
	--ct-ff-muted: rgba(255, 255, 255, 0.7);
	--ct-ff-placeholder: rgba(255, 255, 255, 0.7);
	--ct-ff-rule: rgba(104, 110, 119, 0.35);
	--ct-ff-error: #ffb3ab;
	--ct-ff-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23ffffff' d='M5 1h2v2h6V1h2v2h3v16H2V3h3V1zm-1 6v10h12V7H4zm2 2h2v2H6V9zm3 0h2v2H9V9zm3 0h2v2h-2V9zm-6 3h2v2H6v-2zm3 0h2v2H9v-2z'/%3E%3C/svg%3E");
	--ct-ff-button: #efa00b;
	--ct-ff-button-hover: #ff8552;
	--ct-ff-button-text: #002632;
	--ct-ff-font: neue-haas-grotesk-text, sans-serif;
	--ct-ff-button-font: veneer, sans-serif;
	font-family: var(--ct-ff-font);
}

/* The newsletter and WhatsApp popups (.footer__popup) are white. */
.footer__popup .fluentform {
	--ct-ff-text: #191308;
	--ct-ff-line: #191308;
	--ct-ff-muted: rgba(25, 19, 8, 0.45);
	--ct-ff-placeholder: rgba(25, 19, 8, 0.65);
	--ct-ff-error: #a4000d;
	--ct-ff-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%23191308' d='M5 1h2v2h6V1h2v2h3v16H2V3h3V1zm-1 6v10h12V7H4zm2 2h2v2H6V9zm3 0h2v2H9V9zm3 0h2v2h-2V9zm-6 3h2v2H6v-2zm3 0h2v2H9v-2z'/%3E%3C/svg%3E");
}

/* Layout: Gravity's 12-column grid, 20px between rows, 16px between columns. */
.fluentform form fieldset {
	display: grid !important;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 20px 16px;
}

.fluentform form fieldset > * {
	grid-column: span 12;
}

.fluentform form fieldset > legend,
.fluentform form fieldset > input[type="hidden"],
.fluentform form fieldset > .akismet-fields-container,
.fluentform form fieldset > .ff-hpsf-container {
	grid-column: span 12;
	margin: 0 !important;
}

@media (min-width: 640px) {
	.fluentform form fieldset > .gf-span-6 {
		grid-column: span 6;
	}
}

.fluentform .ff-el-group {
	margin-bottom: 0;
}

/* Multi-step forms: fields inside a step sit outside the grid above, so
   they take its 20px row gap here. */
.fluentform .fluentform-step > * + * {
	margin-top: 20px;
}

/* Labels. */
.fluentform .ff-el-input--label {
	margin-bottom: 8px;
	padding: 0;
	line-height: 1.43;
}

.fluentform .ff-el-input--label label {
	font-family: var(--ct-ff-font);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.43;
	color: var(--ct-ff-text);
	margin: 0;
}

.fluentform .ff-el-input--label.ff-el-is-required.asterisk-right label::after {
	content: " *";
	color: var(--ct-ff-error);
	margin-left: 2px;
}

/* Section headings, as Gravity's section break. */
.fluentform .ff-el-section-break {
	padding-bottom: 8px;
	border-bottom: 1px solid var(--ct-ff-rule);
}

.fluentform .ff-el-section-break .ff-el-section-title {
	margin: 0;
	padding: 0;
	font-family: veneer, sans-serif;
	font-size: clamp(24px, 3vw, 42px);
	font-weight: 400;
	line-height: 1;
	color: var(--ct-ff-text);
}

.fluentform .ff-el-section-break hr,
.fluentform .ff-el-section-break .ff-section_break_desk:empty {
	display: none;
}

/* Inputs. */
.fluentform .ff-el-form-control {
	font-family: var(--ct-ff-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 1;
	height: 46px;
	padding: 12px 15px;
	border: 1px solid var(--ct-ff-line);
	border-radius: 6px;
	background-color: transparent;
	color: var(--ct-ff-text);
	box-shadow: 0 1px 4px rgba(18, 25, 97, 0.08);
}

.fluentform .ff-el-form-control:focus {
	border-color: var(--ct-ff-line);
	background-color: transparent;
	color: var(--ct-ff-text);
	outline: 1px solid var(--ct-ff-line);
	outline-offset: 0;
}

.fluentform .ff-el-form-control::placeholder {
	color: var(--ct-ff-placeholder);
	font-size: 14px;
	opacity: 1;
}

.fluentform textarea.ff-el-form-control {
	height: 186px;
	min-height: 120px;
	line-height: 1;
}

/* Selects: Gravity's white chevron, and the placeholder dimmed. */
.fluentform .ff-el-group select.ff-el-form-control:not([size]):not([multiple]),
.fluentform select.ff-el-form-control {
	height: 42px;
	min-height: 42px;
	line-height: 40px;
	padding-top: 0;
	padding-bottom: 0;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath fill='%23ffffff' d='M0 1.615L1.65 0 5.5 3.77 9.35 0 11 1.615 5.5 7z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: calc(100% - 12px) 50%;
	background-size: 10px auto;
	padding-right: 32px;
}

.fluentform select.ff-el-form-control:has(option[value=""]:checked) {
	color: var(--ct-ff-muted);
}

.fluentform select.ff-el-form-control option {
	color: #191308;
	background-color: #fff;
}

/* Number fields keep the browser's arrows, drawn as Gravity drew them. */
.fluentform input[type="number"].ff-el-form-control {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: number-input;
}

.fluentform input[type="number"].ff-el-form-control::-webkit-inner-spin-button {
	-webkit-appearance: none;
	appearance: none;
	width: 8px;
	opacity: 1;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4 0c.27 0 .52.1.7.3l3 3a1 1 0 0 1-1.4 1.4L4 2.4 1.7 4.7A1 1 0 0 1 .3 3.3l3-3c.18-.2.43-.3.7-.3zM.3 9.3a1 1 0 0 1 1.4 0L4 11.6l2.3-2.3a1 1 0 1 1 1.4 1.4l-3 3a1 1 0 0 1-1.4 0l-3-3a1 1 0 0 1 0-1.4z' fill='rgba(17, 35, 55, 0.65)'/%3E%3C/svg%3E");
	background-position: center center;
	background-repeat: no-repeat;
	background-size: 8px 14px;
}

/* Date fields: one calendar mark inside the box, in the text colour. */
.fluentform input.ff-el-datepicker {
	width: 100%;
	padding-right: 40px;
	background-image: var(--ct-ff-calendar);
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 18px 18px;
}

/* Phone fields: room for the flag, as Gravity's smart phone field. */
.fluentform .iti {
	width: 100%;
}

.fluentform .iti input.ff-el-form-control[type="tel"] {
	padding-left: 48px;
}

.fluentform .iti__selected-dial-code,
.fluentform .iti__arrow {
	color: var(--ct-ff-text);
}

/* Phone fields: Gravity's smart phone field marked the number with a green
   tick when valid and a red cross when not (fluent-forms.js). */
.fluentform .ct-phone-mark {
	position: absolute;
	top: 13px;
	right: 10px;
	z-index: 9;
	width: 20px;
	height: 20px;
	background-position: center;
	background-repeat: no-repeat;
	pointer-events: none;
}

.fluentform .ct-phone-mark.is-valid {
	background-image: url("phone-valid.png");
}

.fluentform .ct-phone-mark.is-invalid {
	background-image: url("phone-invalid.png");
}

/* Checkboxes and radios: a white box that ticks, label beside it. */
.fluentform .ff-el-form-check {
	margin-bottom: 8px;
}

.fluentform .ff-el-form-check-label {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-family: var(--ct-ff-font);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.43;
	color: var(--ct-ff-text);
	cursor: pointer;
}

.fluentform input.ff-el-form-check-input {
	-webkit-appearance: auto;
	appearance: auto;
	position: static;
	opacity: 1;
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	margin: 0;
	accent-color: #00607c;
	cursor: pointer;
}

.fluentform input.ff-el-form-check-input::before,
.fluentform input.ff-el-form-check-input::after {
	content: none;
}

/* Checkboxes as Gravity drew them: a white box, the site's teal tick. */
.fluentform input[type="checkbox"].ff-el-form-check-input {
	-webkit-appearance: none;
	appearance: none;
	border: 1px solid #686e77;
	border-radius: 2px;
	background-color: #fff;
	box-shadow: 0 1px 4px rgba(18, 25, 97, 0.08);
}

.fluentform input[type="checkbox"].ff-el-form-check-input:checked {
	border-color: #686e77;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2300607c' d='M6.2 11.6 2.6 8l-1.2 1.2 4.8 4.8 9-9-1.2-1.2z'/%3E%3C/svg%3E");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 16px 16px;
}

/* Gravity's simple radios sit side by side. */
.fluentform .simple-radio .ff-el-input--content {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 24px;
}

.fluentform .simple-radio .ff-el-form-check {
	margin-bottom: 0;
}

/* Consent: the box and the agreement, then Gravity's note in its frame,
   full width under both. */
.fluentform .ff-el-tc label.ff-el-form-check-label.ff_tc_label {
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr);
	align-items: start;
	column-gap: 12px;
	width: 100%;
}

.fluentform .ff-el-tc .ff_tc_label .ff_tc_checkbox {
	display: block;
	width: 30px;
	line-height: 0;
}

.fluentform .ff-el-tc .ff_tc_checkbox input.ff-el-form-check-input {
	margin: 0;
}

.fluentform .ff-el-tc .ff_tc_label .ff_t_c {
	display: block;
	margin: 0;
	padding: 5px 0 0;
}

.fluentform .ff-el-tc .ct-consent-note {
	display: block;
	width: calc(100% + 42px);
	margin: 17px 0 0 -42px;
	padding: 16px;
	border: 1px solid var(--ct-ff-rule);
	font-size: 14px;
	line-height: 1.43;
	color: var(--ct-ff-text);
	cursor: default;
}

.fluentform .ff-el-tc .ct-consent-note a {
	color: inherit;
	text-decoration: none;
}

/* The reCAPTCHA box needs no heading, as on the other forms. */
.fluentform .ff-el-group:has(.ff-el-recaptcha) > .ff-el-input--label {
	display: none;
}

/* Errors: a red border and a red message under the field. The consent
   line itself stays as it was, as in Gravity. */
.fluentform .ff-el-is-error .ff-el-form-check-label,
.fluentform .ff-el-is-error .ff_t_c {
	color: var(--ct-ff-text);
}

.fluentform .ff-el-is-error .ff-el-form-control,
.fluentform .ff-el-is-error .iti input.ff-el-form-control {
	border-color: var(--ct-ff-error);
	outline: 1px solid var(--ct-ff-error);
}

.fluentform .ff-el-is-error input.ff-el-form-check-input {
	outline: 2px solid var(--ct-ff-error);
	outline-offset: 1px;
}

.fluentform .ff-el-is-error .error,
.fluentform .error.text-danger {
	margin-top: 8px;
	font-family: var(--ct-ff-font);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.43;
	color: var(--ct-ff-error);
}

.ff-errors-in-stack .error {
	color: var(--ct-ff-error);
}

/* The submit button: the site's own button (.btn.btn--secondary). */
.fluentform .ff_submit_btn_wrapper {
	margin-top: 4px;
	text-align: left;
}

.fluentform .ff_submit_btn_wrapper .ff-btn-submit,
.fluentform .ff_submit_btn_wrapper .ff-btn-submit:not(.ff_btn_no_style) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 12px 24px 11px;
	border: 1px solid var(--ct-ff-button-text) !important;
	border-radius: 20px;
	background-color: var(--ct-ff-button) !important;
	color: var(--ct-ff-button-text) !important;
	font-family: var(--ct-ff-button-font);
	font-size: 18px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: uppercase;
	box-shadow: 0 3px 0 0 var(--ct-ff-button-text);
	opacity: 1;
	transition: background-color 0.2s linear;
}

.fluentform .ff_submit_btn_wrapper .ff-btn-submit:hover,
.fluentform .ff_submit_btn_wrapper .ff-btn-submit:focus-visible {
	background-color: var(--ct-ff-button-hover) !important;
	color: var(--ct-ff-button-text) !important;
}

.fluentform .ff_submit_btn_wrapper .ff-btn-submit:focus-visible {
	outline: 2px solid var(--ct-ff-line);
	outline-offset: 3px;
}

@media (min-width: 768px) {
	.fluentform .ff_submit_btn_wrapper .ff-btn-submit,
	.fluentform .ff_submit_btn_wrapper .ff-btn-submit:not(.ff_btn_no_style) {
		font-size: 22px;
	}
}

@media (max-width: 640px) {
	.fluentform .ff_submit_btn_wrapper .ff-btn-submit {
		width: 100%;
	}
}

/* Success: the form hides and its message shows. */
.fluentform .ff-message-success {
	margin: 0;
	padding: 16px 20px;
	border: 1px solid var(--ct-ff-rule);
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	font-family: var(--ct-ff-font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--ct-ff-text);
}

.fluentform .ff-message-success p:last-child {
	margin-bottom: 0;
}

/* Newsletter note, moved from Gravity's submit button filter. */
.fluentform + .form-info-text {
	margin-top: 10px;
}

/* Online payment form (Gravity 12): the parts the server needs but Gravity
   never showed. */
.fluentform .ct-hbl-price-item,
.fluentform .ff_payment_summary {
	display: none !important;
}

.fluentform .lds-hbl-fee-note {
	margin-top: 8px;
	font-size: 14px;
	line-height: 1.43;
	color: var(--ct-ff-text);
}
