.as-jdf {
	display: grid;
	gap: 1.25rem;
	width: 100%;
}

.as-jdf-field {
	display: grid;
	gap: .5rem;
}

.as-jdf-label {
	/* Typography is intentionally inherited from JetEngine's native label styles. */
	line-height: inherit;
}

.as-jdf-required {
	margin-inline-start: .2em;
	color: currentColor;
}

.as-jdf-description,
.as-jdf-file-note {
	font-size: .9em;
	opacity: .75;
}

.as-jdf-control {
	display: grid;
	gap: .55rem;
}

.as-jdf-input,
.as-jdf-file {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

.as-jdf-choice {
	display: flex;
	align-items: flex-start;
	gap: .5rem;
	cursor: pointer;
}

.as-jdf-choice-input {
	margin-top: .25em;
}

.as-jdf-field-error {
	min-height: 1.2em;
	font-size: .88em;
}

.as-jdf-field--invalid .as-jdf-field-error {
	color: #b42318;
}

.as-jdf-uploaded-file {
	font-size: .9em;
	font-weight: 600;
}

.as-jdf-status {
	font-size: .9em;
}

/* JetEngine Forms (Legacy) multi-step integration */
.as-jdf--legacy {
	margin-block: 0;
}

/* Dynamic fields use the same row/column/label classes as native JetEngine fields. */
.as-jdf--legacy .as-jdf-field.jet-form-row {
	width: 100%;
}

.as-jdf--legacy .as-jdf-col.jet-form-col {
	width: 100%;
	max-width: 100%;
	flex: 0 0 100%;
}

.as-jdf--legacy .as-jdf-label.jet-form__label {
	/* Do not set font/size/color here: Elementor's Jet Form settings should win. */
	font: inherit;
}

.as-jdf--legacy .as-jdf-label-text.jet-form__label-text {
	font: inherit;
	color: inherit;
}

/* One horizontal actions row for Back + Submit. */
.as-jdf-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	width: 100%;
	margin-top: 1rem;
	direction: rtl;
}

.as-jdf-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	width: auto;
}

.as-jdf-actions .jet-form-row--submit {
	display: flex;
	align-items: center;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
}

.as-jdf-actions .jet-form-row--submit .jet-form-col,
.as-jdf-actions .jet-form-row--submit .jet-form__submit-wrap {
	width: auto !important;
	max-width: none !important;
	flex: 0 0 auto !important;
	margin: 0 !important;
	padding: 0 !important;
}

.as-jdf-back {
	cursor: pointer;
}

@media (max-width: 767px) {
	.as-jdf-actions {
		flex-wrap: wrap;
	}
}

/* v0.4.3: dynamic fields should fill the same full width as native JetEngine fields. */
.as-jdf--legacy,
.as-jdf--legacy .as-jdf-field.jet-form-row,
.as-jdf--legacy .as-jdf-col.jet-form-col,
.as-jdf--legacy .as-jdf-control {
	box-sizing: border-box;
	width: 100% !important;
	max-width: 100% !important;
	flex: 0 0 100% !important;
}

.as-jdf--legacy .as-jdf-input,
.as-jdf--legacy textarea.as-jdf-input,
.as-jdf--legacy select.as-jdf-input,
.as-jdf--legacy input.as-jdf-input,
.as-jdf--legacy .as-jdf-file {
	box-sizing: border-box;
	width: 100% !important;
	max-width: 100% !important;
}

.as-jdf--legacy .as-jdf-choice {
	width: 100%;
}

.as-jdf-file-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: .45rem;
	width: 100%;
	max-width: 100%;
}

.as-jdf-file-row .as-jdf-file {
	min-width: 0;
}

.as-jdf-file-remove {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	padding: .1em .25em;
	margin: 0;
	font: inherit;
	font-size: 1.35em;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}

.as-jdf-file-remove[hidden] {
	display: none !important;
}

.as-jdf-file-remove:disabled {
	cursor: wait;
	opacity: .45;
}

@media (min-width: 768px) {
	.as-jdf--legacy input.as-jdf-file {
		font-size: 1.5vw !important;
	}
}


/* v0.4.4: Native-looking choice groups + custom file picker. */
.as-jdf--legacy .as-jdf-control.as-jdf-choices.jet-form__fields-group.checkradio-wrap,
.as-jdf .as-jdf-choices.jet-form__fields-group.checkradio-wrap {
	box-sizing: border-box;
	width: 100% !important;
	max-width: 100% !important;
	direction: rtl !important;
	text-align: right !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
}

.as-jdf--legacy .as-jdf-choice.jet-form__field-label,
.as-jdf .as-jdf-choice.jet-form__field-label {
	box-sizing: border-box;
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	justify-content: flex-start !important;
	width: 100% !important;
	max-width: 100% !important;
	direction: rtl !important;
	text-align: right !important;
	gap: .5em;
	font: inherit;
	color: inherit;
}

.as-jdf--legacy .as-jdf-choice-text,
.as-jdf .as-jdf-choice-text {
	font: inherit;
	color: inherit;
	line-height: inherit;
	text-align: right;
}

/* Checkbox/radio are exactly 1em: the same visual size as the option text. */
.as-jdf--legacy input.as-jdf-choice-input.jet-form__field.checkradio-field,
.as-jdf input.as-jdf-choice-input.jet-form__field.checkradio-field {
	box-sizing: border-box !important;
	width: 1em !important;
	height: 1em !important;
	min-width: 1em !important;
	min-height: 1em !important;
	max-width: 1em !important;
	max-height: 1em !important;
	flex: 0 0 1em !important;
	margin: 0 !important;
	padding: 0 !important;
	font: inherit !important;
	vertical-align: middle;
}

.as-jdf-file-picker {
	box-sizing: border-box;
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	gap: .45rem;
}

/* Keep the real file input accessible/valid, but visually replace it with a normal Jet button. */
.as-jdf-file-native {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	min-width: 1px !important;
	min-height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.as-jdf-file-trigger-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

.as-jdf-file-trigger.jet-form__submit {
	cursor: pointer;
}

/* Selected file is always on its own line BELOW the upload button. */
.as-jdf-file-selection {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: .45em;
	width: 100%;
	max-width: 100%;
	direction: rtl;
	text-align: right;
}

.as-jdf-file-selection[hidden] {
	display: none !important;
}

.as-jdf-file-name {
	min-width: 0;
	overflow-wrap: anywhere;
	font: inherit;
	color: inherit;
}

.as-jdf-file-selection .as-jdf-file-remove {
	flex: 0 0 auto;
	margin: 0;
	font-size: 1em;
}

@media (min-width: 768px) {
	.as-jdf-file-trigger.jet-form__submit {
		font-size: 1.5vw !important;
	}
}

/* v0.4.6: Job-form button icons + right-aligned phone field. */
.as-jdf-job-form .jet-form__next-page,
.as-jdf-job-form .jet-form-row--submit .jet-form__submit:not(.as-jdf-file-trigger) {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: .45em !important;
}

/* "לשלב הבא" icon. In RTL the ::after item sits on the left of the text. */
.as-jdf-job-form .jet-form__next-page::after {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	flex: 0 0 1em;
	background-image: url('/wp-content/uploads/2026/08/CaretLeft2.svg');
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

/* Final submit icon. */
.as-jdf-job-form .jet-form-row--submit .jet-form__submit:not(.as-jdf-file-trigger)::after {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	flex: 0 0 1em;
	background-image: url('/wp-content/uploads/2026/08/PaperPlaneRight.svg');
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

/* JetEngine can render Phone as tel, inputmode=tel or a phone-field class. */
.as-jdf-job-form input[type="tel"],
.as-jdf-job-form input[inputmode="tel"],
.as-jdf-job-form input.phone-field {
	text-align: right !important;
}


/* v0.4.7: prevent Legacy dynamic rows from shifting outside the form on mobile.
 * JetEngine gives .jet-form-row negative side margins. A forced width:100%
 * makes that row shift to the left; width:auto lets the native column padding
 * cancel those margins exactly, just like JetEngine's regular fields. */
@media (max-width: 767px) {
	.as-jdf--legacy .as-jdf-field.jet-form-row {
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
	}

	.as-jdf--legacy .as-jdf-col.jet-form-col,
	.as-jdf--legacy .as-jdf-control,
	.as-jdf--legacy .as-jdf-input {
		min-width: 0 !important;
	}
}
