/*
 * Floating labels for Gravity Forms.
 *
 * Applies only to forms carrying the .gffl-enabled class, which the plugin adds
 * to forms that have the tweak switched on. The class name is inherited from the
 * standalone Gravity Forms Floating Label plugin, because existing sites style
 * against it.
 *
 * Per-form settings arrive as custom properties in a small inline block:
 *   --igg-fl-bg   background behind the floated label
 *   --igg-fl-top  how far the floated label sits above the input
 *
 * Choice fields (radios, checkboxes) are excluded: their label belongs above the
 * options, not inside an input.
 */

.gffl-enabled .gfield:not(.gfield--type-choice) {
	position: relative;
}

.gffl-enabled .gfield:not(.gfield--type-choice) .gfield_label {
	position: absolute;
	top: 14px;
	left: 12px;
	z-index: 1;
	padding: 0 4px;
	line-height: 1;
	transition: all 0.2s ease-in-out;
}

.gffl-enabled .gfield:not(.gfield--type-choice).float-label-active .gfield_label {
	top: var( --igg-fl-top, -10px );
	left: 8px;
	font-size: 0.75em;
	background: var( --igg-fl-bg, #ffffff );
}

/*
 * Respect a visitor's reduced-motion preference: the label still moves, it just
 * moves instantly.
 */
@media ( prefers-reduced-motion: reduce ) {

	.gffl-enabled .gfield:not(.gfield--type-choice) .gfield_label {
		transition: none;
	}
}
