/* Contact Form 7 element options (Impreza Plus). Rules apply only with ip-cf7--* classes set by filled options. */

/* Button alignment */
.ip-cf7-submit {
	display: flex;
	align-items: center;
}

.ip-cf7--btn-left .ip-cf7-submit {
	justify-content: flex-start;
}

.ip-cf7--btn-center .ip-cf7-submit {
	justify-content: center;
}

.ip-cf7--btn-right .ip-cf7-submit {
	justify-content: flex-end;
}

.ip-cf7-submit__inner {
	position: relative;
	display: inline-flex;
	max-width: 100%;
}

/* Spinner out of the flow so it doesn't shift the button */
.ip-cf7-submit__inner > .wpcf7-spinner {
	position: absolute;
	top: 50%;
	left: 100%;
	margin: -12px 0 0 12px;
}

.ip-cf7--btn-right .ip-cf7-submit__inner > .wpcf7-spinner {
	left: auto;
	right: 100%;
	margin: -12px 12px 0 0;
}

/* Full width button, spinner inside it on the right */
.ip-cf7--btn-justify .ip-cf7-submit__inner {
	flex: 1 1 auto;
}

.ip-cf7--btn-justify .ip-cf7-submit__inner > .wpcf7-submit {
	width: 100%;
}

.ip-cf7--btn-justify .ip-cf7-submit__inner > .wpcf7-spinner {
	left: auto;
	right: 12px;
	margin: -12px 0 0;
}

/* Gap between label text and field only (Impreza puts .4rem above every field) */
.wpcf7.ip-cf7--label-gap .wpcf7-form-control-wrap {
	margin-top: 0;
}

.wpcf7.ip-cf7--label-gap .wpcf7-form-control-wrap.ip-cf7-wrap--label {
	margin-top: var(--ip-cf7-label-gap);
}

/* Acceptance: gap above */
.wpcf7.ip-cf7--acceptance-gap .wpcf7-form-control-wrap.ip-cf7-wrap--acceptance {
	margin-top: var(--ip-cf7-acceptance-gap);
}

/* Last row: exact gap from the previous one (its bottom margin is dropped so margins don't collapse into the larger one) */
.wpcf7.ip-cf7--last-row-gap .ip-cf7-last-row,
.wpcf7.ip-cf7--last-row-gap .wpcf7-form > p:last-of-type {
	margin-top: var(--ip-cf7-last-row-gap);
}

.wpcf7.ip-cf7--last-row-gap :has(+ .ip-cf7-last-row),
.wpcf7.ip-cf7--last-row-gap .wpcf7-form > p:has(+ p:last-of-type) {
	margin-bottom: 0;
}

/* Acceptance checkbox text */
.wpcf7.ip-cf7--acceptance-size .wpcf7-acceptance .wpcf7-list-item-label {
	font-size: var(--ip-cf7-acceptance-size);
}

.wpcf7.ip-cf7--acceptance-lh .wpcf7-acceptance .wpcf7-list-item-label {
	line-height: var(--ip-cf7-acceptance-lh);
}

/* Gap between fields in forms with CF7 auto-formatting (<p> per line).
   Grid blocks use --ip-cf7-gap from the grid CSS. */
.wpcf7.ip-cf7--fields-gap .wpcf7-form > p {
	margin-top: 0;
	margin-bottom: var(--ip-cf7-gap);
}
