/**
 * Contact Form — base styles. Elementor controls override most of these.
 */

.cfe-form-wrap {
	width: 100%;
}

.cfe-form {
	box-sizing: border-box;
	width: 100%;
	display: block;
}

.cfe-form *,
.cfe-form *::before,
.cfe-form *::after {
	box-sizing: border-box;
}

/* Grid */
.cfe-form-grid {
	display: grid;
	grid-template-columns: repeat( 12, 1fr );
	row-gap: 16px;
	column-gap: 16px;
	width: 100%;
}

.cfe-form-field {
	grid-column: span 12;
	min-width: 0;
}

/* Labels */
.cfe-form-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: inherit;
}

/* Visually hidden label — keeps it readable to screen readers and to label-for behavior. */
.cfe-form-label--sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect( 0, 0, 0, 0 ) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.cfe-form-required {
	color: #dc2626;
}

.cfe-hide-required .cfe-form-required {
	display: none !important;
}

/* Inputs */
.cfe-form-input,
.cfe-form-select,
.cfe-form-textarea {
	width: 100%;
	display: block;
	font: inherit;
	color: inherit;
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 10px 12px;
	height: 44px;
	line-height: 1.4;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.cfe-form-textarea {
	min-height: 120px;
	height: auto;
	resize: vertical;
}

.cfe-form-input:focus,
.cfe-form-select:focus,
.cfe-form-textarea:focus {
	outline: 2px solid transparent;
	outline-offset: 2px;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba( 37, 99, 235, 0.15 );
}

.cfe-form-input:disabled,
.cfe-form-select:disabled,
.cfe-form-textarea:disabled {
	background-color: #f3f4f6;
	cursor: not-allowed;
}

.cfe-has-error .cfe-form-input,
.cfe-has-error .cfe-form-select,
.cfe-has-error .cfe-form-textarea,
.cfe-has-error .cfe-form-file {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba( 220, 38, 38, 0.15 );
}

/* intl-tel-input: stretch the wrapper to fill the field column and keep error
   styling on the inner input. The library adds `.iti` around the <input>; it also
   sets `padding-left` as an inline style on the input (sized to fit the selected
   dial code), so DON'T add a static padding-left rule here — it would be ignored
   anyway. Admins can override the auto-padding via the "Phone Input Padding"
   control under Style → Phone Country Code (which emits !important). */
.cfe-form-field .iti {
	width: 100%;
	display: block;
}
.cfe-has-error .iti .cfe-form-input {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba( 220, 38, 38, 0.15 );
}

/* Custom select dropdown (button + listbox + hidden input) */
.cfe-form-select-wrap {
	position: relative;
	width: 100%;
}

button.cfe-form-select {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	text-align: left;
	cursor: pointer;
	padding-right: 14px;
}

button.cfe-form-select:hover {
	border-color: #9ca3af;
}

.cfe-form-select-value {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cfe-form-select-value.is-placeholder {
	color: #9ca3af;
}

.cfe-form-select-arrow {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #6b7280;
	font-size: 14px;
	line-height: 1;
	transition: transform 150ms ease;
}

.cfe-form-select-arrow svg,
.cfe-form-select-arrow i {
	width: 1em;
	height: 1em;
	font-size: inherit;
	fill: currentColor;
}

button.cfe-form-select[aria-expanded="true"] .cfe-form-select-arrow {
	transform: rotate( 180deg );
}

.cfe-form-select-list {
	position: absolute;
	z-index: 1000;
	top: calc( 100% + 4px );
	left: 0;
	right: 0;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba( 17, 24, 39, 0.12 );
	max-height: 260px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.cfe-form-select-list[hidden] {
	display: none;
}

.cfe-form-select-option {
	padding: 10px 14px;
	cursor: pointer;
	color: inherit;
	user-select: none;
	transition: background-color 100ms ease, color 100ms ease;
}

.cfe-form-select-option:hover,
.cfe-form-select-option.is-active {
	background-color: #f3f4f6;
}

.cfe-form-select-option[aria-selected="true"] {
	background-color: #eff6ff;
	color: #1d4ed8;
	font-weight: 500;
}

/* Radio / checkbox group */
.cfe-form-options {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.cfe-form-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}

.cfe-form-option input {
	margin: 0;
}

/* File upload — picked-files card list (rendered by JS above the dropzone) */
.cfe-form-file-wrap {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
}

.cfe-form-file-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cfe-form-file-list[hidden] {
	display: none;
}

.cfe-form-file-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	background: #f9fafb;
	border-radius: 8px;
	color: inherit;
	font-size: 0.95em;
}

.cfe-form-file-card-icon {
	flex: none;
	color: #1f2937;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	line-height: 1;
}

.cfe-form-file-card-icon svg,
.cfe-form-file-card-icon i {
	width: 1em;
	height: 1em;
	font-size: inherit;
	fill: currentColor;
}

.cfe-form-file-card-name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/*
 * Compound `button.cfe-form-file-card-remove` (tag + class) beats theme button rules
 * like `.elementor-widget-container button { background: var(--primary) }` without
 * needing !important. Every common button property is reset explicitly so the theme's
 * brand color, gradient, border, or shadow can't bleed through unstyled. Elementor
 * controls (selectors below in PHP) layer on top of this base.
 */
.cfe-form-file-wrap button.cfe-form-file-card-remove,
button.cfe-form-file-card-remove {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* Box sizes itself around the icon: width = font-size + 2 * padding. Setting the
	   Elementor "Remove Button Size" slider sets font-size only, so the icon visibly
	   scales to whatever the user picks while the click area stays proportional. */
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 4px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	background-color: transparent;
	background-image: none;
	box-shadow: none;
	text-shadow: none;
	color: inherit;
	font: inherit;
	font-size: 14px;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 120ms ease, color 120ms ease;
}

.cfe-form-file-wrap button.cfe-form-file-card-remove svg,
.cfe-form-file-wrap button.cfe-form-file-card-remove i {
	width: 1em;
	height: 1em;
	font-size: inherit;
	line-height: 1;
	fill: currentColor;
}

.cfe-form-file-wrap button.cfe-form-file-card-remove:hover,
.cfe-form-file-wrap button.cfe-form-file-card-remove:focus-visible {
	background: rgba( 17, 24, 39, 0.08 );
	background-color: rgba( 17, 24, 39, 0.08 );
	color: #b91c1c;
	outline: none;
}

/* File upload */
.cfe-form-file {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border: 1.5px dashed #d1d5db;
	border-radius: 8px;
	background: #f9fafb;
	cursor: pointer;
	transition: border-color 150ms ease, background-color 150ms ease;
}

.cfe-form-file:hover {
	border-color: #2563eb;
	background: #f3f6ff;
}

.cfe-form-file-input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.cfe-form-file-icon {
	color: #6b7280;
	flex: none;
	font-size: 20px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.cfe-form-file-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.cfe-form-file-text {
	color: inherit;
	font-weight: 500;
}

.cfe-form-file-help {
	margin-left: auto;
	font-size: 0.875em;
	color: #6b7280;
	max-width: 60%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Submit button */
.cfe-form-submit-field {
	grid-column: span 12;
}

.cfe-form-submit-wrap {
	text-align: left;
}

.cfe-form-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font: inherit;
	font-weight: 600;
	color: #ffffff;
	background: #1d4ed8;
	border: 1px solid transparent;
	border-radius: 6px;
	padding: 12px 28px;
	cursor: pointer;
	transition: background-color 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.cfe-form-submit:hover {
	background: #1e40af;
}

.cfe-form-submit:focus-visible {
	outline: 3px solid rgba( 29, 78, 216, 0.4 );
	outline-offset: 2px;
}

.cfe-form-submit:disabled,
.cfe-form-submit.is-loading {
	cursor: progress;
	opacity: 0.85;
}

.cfe-form-submit-spinner {
	display: none;
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: cfe-spin 0.8s linear infinite;
	margin-left: 8px;
}

.cfe-form-submit.is-loading .cfe-form-submit-spinner {
	display: inline-block;
}

@keyframes cfe-spin {
	to {
		transform: rotate( 360deg );
	}
}

/* Per-field error */
.cfe-form-error {
	display: block;
	min-height: 1em;
	margin-top: 4px;
	color: #dc2626;
	font-size: 0.875em;
}

.cfe-form-error:empty {
	min-height: 0;
}

/* Form-level messages */
.cfe-form-message {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 6px;
	border: 1px solid transparent;
}

.cfe-form-message-success {
	color: #065f46;
	background: #ecfdf5;
	border-color: #a7f3d0;
}

.cfe-form-message-error {
	color: #991b1b;
	background: #fef2f2;
	border-color: #fecaca;
}

/* Honeypot — off-screen, NOT display:none. */
.cfe-form-honey {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect( 0, 0, 0, 0 ) !important;
}
