/* Map the reporting form palette to editable Elementor global colors. */
#isi_report_submission_form,
.isi-stopit-report-confirmation {
	--isi-report-color-on-dark: var(--e-global-color-8efc870, #fff);
	--isi-report-color-accent: var(--e-global-color-secondary, #62a36d);
	--isi-report-color-success-background: color-mix(in srgb, var(--isi-report-color-accent) 12%, var(--isi-report-color-on-dark));
	--isi-report-color-success-text: color-mix(in srgb, var(--e-global-color-36ed1c3, #4e8b54) 55%, var(--e-global-color-primary, #344154));
	--isi-report-color-muted: var(--e-global-color-5ad6e13, #c6d0db);
	--isi-report-color-file-surface: color-mix(in srgb, var(--isi-report-color-on-dark) 12%, transparent);
	--isi-report-color-success: var(--e-global-color-8efc870, #b8f0c4);
	--isi-report-color-error-background: var(--e-global-color-0ab39ac, #fbe9e7);
	--isi-report-color-error-text: var(--e-global-color-c916da4, #a3352a);
}

/* Keep Elementor's real file input and upload handling intact. */
#isi_report_submission_form .elementor-field-group-evidence_files {
	flex-direction: column;
	align-items: center;
	text-align: center;
}

#isi_report_submission_form #form-field-evidence_files {
	display: block;
	width: 100%;
	background: transparent;
	color: var(--isi-report-color-on-dark);
	font-size: 14px;
	text-align: center;
	cursor: pointer;
}

#isi_report_submission_form #form-field-evidence_files::file-selector-button {
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--isi-report-color-accent);
	background-image: linear-gradient(var(--isi-report-color-on-dark), var(--isi-report-color-on-dark)), linear-gradient(var(--isi-report-color-on-dark), var(--isi-report-color-on-dark));
	background-position: center, center;
	background-size: 3px 22px, 22px 3px;
	background-repeat: no-repeat;
	color: transparent;
	font-size: 0;
	cursor: pointer;
}

#isi_report_submission_form #form-field-evidence_files:focus-visible::file-selector-button {
	outline: 3px solid var(--isi-report-color-on-dark);
	outline-offset: 3px;
}

/* Hide the browser's untranslated empty-file text only when the script supplies a visible selection status. */
#isi_report_submission_form .isi-stopit-evidence-enhanced #form-field-evidence_files {
	width: 56px;
	height: 56px;
	margin: 0 auto;
	overflow: hidden;
	color: transparent;
	font-size: 0;
}

#isi_report_submission_form .isi-stopit-evidence-enhanced #form-field-evidence_files::file-selector-button {
	margin: 0;
}

#isi_report_submission_form .isi-stopit-evidence-selection {
	list-style: none;
	width: 100%;
	margin: 8px 0 14px;
	padding: 0;
	text-align: start;
	color: var(--isi-report-color-on-dark);
}

#isi_report_submission_form .isi-stopit-evidence-selection li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 6px;
	padding: 8px 12px;
	border-radius: 6px;
	background: var(--isi-report-color-file-surface);
	font-size: 13px;
	line-height: 1.4;
	min-width: 0;
}

#isi_report_submission_form .isi-stopit-evidence-selection li span {
	min-width: 0;
	overflow-wrap: anywhere;
}

#isi_report_submission_form .isi-stopit-evidence-selection li span::before {
	content: "📎 ";
}

#isi_report_submission_form .isi-stopit-evidence-selection button {
	flex: none;
	border: 0;
	background: transparent;
	color: var(--isi-report-color-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

#isi_report_submission_form .isi-stopit-evidence-selection button:focus-visible {
	outline: 2px solid var(--isi-report-color-on-dark);
	outline-offset: 2px;
}

#isi_report_submission_form .isi-stopit-evidence-status {
	width: 100%;
	margin: 0;
	color: var(--isi-report-color-on-dark);
	font-size: 14px;
	line-height: 1.4;
}

#isi_report_submission_form .isi-stopit-evidence-status.elementor-message-success {
	color: var(--isi-report-color-success);
}

#isi_report_submission_form .isi-stopit-report-error,
#isi_report_submission_form .elementor-message.elementor-message-danger,
.isi-stopit-report-confirmation .elementor-message.elementor-message-success {
	box-sizing: border-box;
	width: 100%;
	margin: 0 0 12px;
	padding: 9px 12px;
	border-radius: 6px;
	background: var(--isi-report-color-error-background);
	color: var(--isi-report-color-error-text);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	overflow-wrap: anywhere;
}

#isi_report_submission_form .elementor-message.elementor-message-danger,
.isi-stopit-report-confirmation .elementor-message.elementor-message-success {
	margin-top: 6px;
}

/* Preserve the filename and size sentence as separate bidirectional text lines. */
#isi_report_submission_form .isi-stopit-report-error--multiline {
	white-space: pre-line;
	unicode-bidi: plaintext;
}

/* Elementor inserts field errors among flex items, so reserve a row below that field. */
#isi_report_submission_form :is(.elementor-field-group, .elementor-field-option):has(> .elementor-form-help-inline.elementor-message-danger) {
	flex-wrap: wrap;
}

#isi_report_submission_form .elementor-form-help-inline.elementor-message-danger {
	display: block;
	flex: 0 0 100%;
	width: 100%;
}

/* The upload field stacks children, so the shared row flex basis would stretch its warning. */
#isi_report_submission_form .elementor-field-group-evidence_files > .elementor-form-help-inline.elementor-message-danger {
	flex: 0 0 auto;
	align-self: center;
	max-width: 450px;
	margin-inline: auto;
}

/* Mix existing site colors to keep the success message pale green with readable dark green text. */
.isi-stopit-report-confirmation .elementor-message.elementor-message-success {
	background: var(--isi-report-color-success-background);
	color: var(--isi-report-color-success-text) !important;
	box-shadow: inset 0 0 0 2px var(--isi-report-color-accent);
}

#isi_report_submission_form .elementor-message.elementor-message-danger::before,
.isi-stopit-report-confirmation .elementor-message.elementor-message-success::before {
	display: none;
}

#isi_report_submission_form .isi-stopit-report-error[hidden] {
	display: none;
}

.isi-stopit-report-confirmation {
	width: 100%;
}

.isi-stopit-report-confirmation:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
}

/* The form script places the date after the first mode option so visual and reading order agree. */
#isi_report_submission_form .elementor-field-group-incident_time_mode .elementor-field-subgroup > .elementor-field-group-incident_date {
	flex: 0 0 100%;
	max-width: 100%;
	margin: 8px 0 12px;
}

/* Keep the independent ongoing answer after either conditional answer and before navigation. */
#isi_report_submission_form .elementor-field-group-incident_ongoing {
	order: 1;
}

#isi_report_submission_form .elementor-field-group-incident_ongoing ~ .e-form__buttons {
	order: 2;
}
