/* ============================================================
   GRAVITY FORMS — Institute theme
   ------------------------------------------------------------
   Maps Gravity's class structure onto the theme's tokens. Loaded
   only when Gravity Forms is active (see inc/gravity-forms.php),
   after the visual theme layer has been dequeued.

   FORMS ARE LIGHT-GROUND ONLY. The error color is 7.87:1 on paper
   and 1.59:1 on navy. If a navy band needs a form, put the form in
   a white card rather than on the band itself.
   ============================================================ */

/* ------------------------------------------------------------
   0. CRITICAL — honeypot and hidden fields
   Gravity's own CSS normally hides these. We removed that layer,
   so these rules are load-bearing: without them the honeypot
   becomes visible, real users fill it in, and their genuine
   submissions get silently rejected as spam.
   ------------------------------------------------------------ */

.gform_wrapper .gform_validation_container,
.gform_wrapper .gform_validation_container *,
.gform_wrapper .gfield_visibility_hidden,
.gform_wrapper .gform_hidden,
.gform_wrapper input[type="hidden"] {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.gform_wrapper .screen-reader-text,
.gform_wrapper .gform-field-label--type-sub {
	border: 0; clip-path: inset(50%); height: 1px; overflow: hidden;
	position: absolute; white-space: nowrap; width: 1px;
}

/* ------------------------------------------------------------
   1. Wrapper and heading
   ------------------------------------------------------------ */

.gform_wrapper { font-family: var(--sans); color: var(--ink); }

.gform_wrapper .gform_heading { margin-bottom: 28px; }

.gform_wrapper .gform_title {
	font-family: var(--serif-display);
	font-size: 27px;
	line-height: 1.15;
	color: var(--regent-blue);
	font-weight: 400;
	margin: 0 0 10px;
}

.gform_wrapper .gform_description {
	display: block;
	font-size: 17px;
	line-height: 1.6;
	color: var(--fg2);
	margin: 0;
}

.gform_wrapper .gform_required_legend {
	font-size: 14.5px;
	color: var(--fg2);
	margin: 14px 0 0;
}

/* ------------------------------------------------------------
   2. Field grid
   Gravity 2.5+ lays fields out on a 12-column grid. The foundation
   stylesheet supplies it, but we re-declare so column widths hold
   even if the foundation handle changes name in a future release.
   ------------------------------------------------------------ */

.gform_wrapper .gform_fields {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	column-gap: 24px;
	row-gap: 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.gform_wrapper .gfield { grid-column: span 12; min-width: 0; }
.gform_wrapper .gfield--width-half    { grid-column: span 6; }
.gform_wrapper .gfield--width-third   { grid-column: span 4; }
.gform_wrapper .gfield--width-quarter { grid-column: span 3; }

/* Single column below 700px, matching the theme's one media block. */
@media (max-width: 700px) {
	.gform_wrapper .gfield,
	.gform_wrapper .gfield--width-half,
	.gform_wrapper .gfield--width-third,
	.gform_wrapper .gfield--width-quarter { grid-column: span 12; }
}

/* ------------------------------------------------------------
   3. Labels
   ------------------------------------------------------------ */

.gform_wrapper .gfield_label,
.gform_wrapper .gform-field-label {
	display: block;
	font-weight: 600;
	font-size: 15.5px;
	line-height: 1.4;
	color: var(--ink);
	margin: 0 0 7px;
}

.gform_wrapper .gfield_required,
.gform_wrapper .gfield_required_asterisk {
	color: var(--error);
	font-weight: 700;
	margin-left: 3px;
}

.gform_wrapper .gfield_description {
	font-size: 15px;
	color: var(--fg2);
	margin-top: 6px;
	line-height: 1.5;
}

/* ------------------------------------------------------------
   4. Inputs
   ------------------------------------------------------------ */

.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="url"],
.gform_wrapper input[type="number"],
.gform_wrapper input[type="password"],
.gform_wrapper input[type="date"],
.gform_wrapper select,
.gform_wrapper textarea {
	width: 100%;
	padding: 13px 14px;
	font: inherit;
	font-size: 16.5px;
	color: var(--ink);
	background: var(--white);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-md);
	appearance: none;
}

.gform_wrapper textarea { min-height: 150px; line-height: 1.6; resize: vertical; }

.gform_wrapper select {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235A6675' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 40px;
}

.gform_wrapper input::placeholder,
.gform_wrapper textarea::placeholder { color: var(--neutral-400); }

/* Placeholders are not labels. If a form ships placeholder-only
   fields, the label is still required — this keeps it visible. */
.gform_wrapper .gfield_label { position: static !important; }

/* ------------------------------------------------------------
   5. Checkboxes and radios
   Gravity wraps each choice in .gchoice.
   ------------------------------------------------------------ */

.gform_wrapper .gfield_checkbox,
.gform_wrapper .gfield_radio {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.gform_wrapper .gchoice {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	min-height: 28px;
}

.gform_wrapper .gchoice input[type="checkbox"],
.gform_wrapper .gchoice input[type="radio"] {
	width: 20px;
	height: 20px;
	margin: 3px 0 0;
	accent-color: var(--regent-green);
	flex: 0 0 auto;
}

.gform_wrapper .gchoice label {
	font-weight: 400;
	font-size: 16.5px;
	line-height: 1.5;
	margin: 0;
	cursor: pointer;
}

/* ------------------------------------------------------------
   6. Error states
   Never color alone: a 2px border plus a bold "Error:" prefix.
   ------------------------------------------------------------ */

.gform_wrapper .gfield_error input[type="text"],
.gform_wrapper .gfield_error input[type="email"],
.gform_wrapper .gfield_error input[type="tel"],
.gform_wrapper .gfield_error input[type="url"],
.gform_wrapper .gfield_error input[type="number"],
.gform_wrapper .gfield_error select,
.gform_wrapper .gfield_error textarea {
	border: 2px solid var(--error);
	background: var(--error-bg);
}

.gform_wrapper .validation_message,
.gform_wrapper .gfield_validation_message {
	color: var(--error);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
	margin-top: 7px;
	background: none;
	border: 0;
	padding: 0;
}

.gform_wrapper .validation_message::before,
.gform_wrapper .gfield_validation_message::before {
	content: "Error: ";
	font-weight: 700;
}

/* Validation summary — the accessible route. Lists each failure
   and links to the field. */
.gform_wrapper .gform_validation_errors {
	border: 2px solid var(--error);
	background: var(--error-bg);
	border-radius: var(--radius-md);
	padding: 18px 20px;
	margin-bottom: 28px;
}

.gform_wrapper .gform_validation_errors > h2,
.gform_wrapper .gform_submission_error {
	font-family: var(--sans);
	font-size: 17px;
	font-weight: 700;
	color: var(--error);
	margin: 0 0 10px;
	line-height: 1.4;
}

.gform_wrapper .gform_validation_errors ol {
	margin: 0;
	padding-left: 20px;
	font-size: 15.5px;
}

.gform_wrapper .gform_validation_errors li { margin-bottom: 5px; }

.gform_wrapper .gform_validation_errors a {
	color: var(--error);
	text-decoration: underline;
}

/* ------------------------------------------------------------
   7. Confirmation
   ------------------------------------------------------------ */

.gform_confirmation_wrapper .gform_confirmation_message,
.gform_wrapper .gform_confirmation_message {
	border: 2px solid var(--green-800);
	background: var(--green-100);
	border-radius: var(--radius-md);
	padding: 20px 22px;
	font-size: 17px;
	line-height: 1.6;
	color: var(--ink);
}

/* ------------------------------------------------------------
   8. Submit
   ------------------------------------------------------------ */

.gform_wrapper .gform_footer {
	margin-top: 28px;
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.gform_wrapper .gform_button,
.gform_wrapper .gform_next_button,
.gform_wrapper .gform_previous_button {
	background: var(--regent-green);
	color: #fff;
	padding: 14px 26px;
	border: 0;
	border-radius: var(--radius-md);
	font-family: var(--sans);
	font-weight: 600;
	font-size: 14.5px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	cursor: pointer;
}

.gform_wrapper .gform_button:hover { background: var(--green-800); }

.gform_wrapper .gform_previous_button { background: var(--regent-blue); }
.gform_wrapper .gform_previous_button:hover { background: var(--blue-900); }

/* Submitting / disabled. Gravity sets [disabled] during AJAX submit. */
.gform_wrapper .gform_button[disabled],
.gform_wrapper .gform_button.gform_button--disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.gform_wrapper .gform_ajax_spinner,
.gform_wrapper .gform-loader {
	width: 20px;
	height: 20px;
	border: 2px solid var(--border-strong);
	border-top-color: var(--regent-green);
	border-radius: 50%;
	animation: ii-spin 0.7s linear infinite;
}

@keyframes ii-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.gform_wrapper .gform_ajax_spinner,
	.gform_wrapper .gform-loader { animation: none; }
}

/* Full width below 700px, matching [data-fullwidth] elsewhere. */
@media (max-width: 700px) {
	.gform_wrapper .gform_footer { flex-direction: column; align-items: stretch; }
	.gform_wrapper .gform_button { width: 100%; text-align: center; }
}

/* ------------------------------------------------------------
   9. Sections, HTML blocks, multi-page
   ------------------------------------------------------------ */

.gform_wrapper .gsection {
	border-bottom: 1px solid var(--border);
	padding-bottom: 12px;
	margin-top: 16px;
}

.gform_wrapper .gsection_title {
	font-family: var(--serif-display);
	font-size: 23px;
	color: var(--regent-blue);
	font-weight: 400;
	margin: 0;
}

.gform_wrapper .gfield_html { font-size: 17px; line-height: 1.7; color: var(--neutral-800); }

.gform_wrapper .gf_progressbar_wrapper { margin-bottom: 28px; }
.gform_wrapper .gf_progressbar {
	background: var(--neutral-200);
	border-radius: var(--radius-pill, 999px);
	height: 8px;
	overflow: hidden;
}
.gform_wrapper .gf_progressbar_percentage { background: var(--regent-green); height: 100%; display: block; }

/* ------------------------------------------------------------
   10. Focus
   The theme's global :focus-visible already covers inputs. This
   only ensures Gravity's own reset cannot strip it.
   ------------------------------------------------------------ */

.gform_wrapper :focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px var(--regent-blue);
	border-radius: 3px;
}

/* ------------------------------------------------------------
   11. Inline variant — single field beside a button, used for the
   newsletter signup. Collapses to stacked below 700px.
   ------------------------------------------------------------ */

.ii-form-inline .gform_fields { row-gap: 12px; }

@media (min-width: 701px) {
	.ii-form-inline .gform_body,
	.ii-form-inline form { display: flex; gap: 12px; align-items: flex-end; }
	.ii-form-inline .gform_body { flex: 1 1 auto; }
	.ii-form-inline .gform_footer { margin-top: 0; }
}
