/* Field errors: Persian message right under the field (the toast itself lives in toast.css) */
.fe-error,
.wpcf7-not-valid-tip {
	display: block;
	margin: 4px 0 0;
	padding: 0;
	color: #d92d20;
	font-size: 12.5px;
	font-weight: 500;
	line-height: 1.8;
	text-align: right;
	direction: rtl;
}

/* Messages/notices that get focus from script (tabindex="-1": WooCommerce / our toast code focus them for screen readers)
   must not show the browser's black focus ring. Real keyboard targets keep their ring. */
.fe-error:focus,
.fe-error:focus-visible,
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible,
[role="alert"]:focus,
[role="alert"]:focus-visible,
.woocommerce-error:focus,
.woocommerce-message:focus,
.woocommerce-info:focus,
.woocommerce-NoticeGroup:focus,
.woocommerce-notices-wrapper:focus {
	outline: none !important;
}

/* Contact Form 7 wraps the field in an inline span: make it a block so the message sits below it */
.wpcf7-form-control-wrap {
	display: block;
}

.is-invalid,
.wpcf7-not-valid,
.woocommerce-invalid input.input-text,
.woocommerce-invalid select,
.woocommerce-invalid textarea {
	border-color: #d92d20 !important;
	box-shadow: 0 0 0 3px rgba(217, 45, 32, .12) !important;
}

/* checkbox / radio: no ring, just the message */
input[type="checkbox"].is-invalid,
input[type="radio"].is-invalid {
	box-shadow: none !important;
	outline: 2px solid #d92d20;
	outline-offset: 1px;
}

/* CF7's own response box is replaced by the toast */
.wpcf7 form .wpcf7-response-output {
	display: none !important;
}

/* CF7 spinner would push the layout around */
.wpcf7-spinner {
	display: none;
}

/* the field's own bottom margin / inline baseline gap would push the message away: drop them while it is invalid */
input.is-invalid:not([type="checkbox"]):not([type="radio"]),
select.is-invalid,
textarea.is-invalid,
input.wpcf7-not-valid,
.woocommerce-invalid input.input-text,
.woocommerce-invalid select,
.woocommerce-invalid textarea {
	margin-bottom: 0 !important;
	vertical-align: top;
}

.wpcf7-form-control-wrap + .fe-error,
.woocommerce-input-wrapper + .fe-error {
	margin-top: 4px;
}
