/*
 * Nice Forms styling.
 * Uses Astra's CSS custom properties when present (--ast-global-color-*,
 * --ast-global-font-family, etc.) with sensible fallbacks so the form still
 * looks decent on any other theme.
 */

.nice-form-wrapper {
	max-width: 640px;
	margin: 0 auto;
	font-family: var(--ast-global-font-family-body, inherit);
}

.nice-form-icon {
	display: flex;
	justify-content: center;
	margin-bottom: 1.25em;
	color: var(--nf-accent, var(--ast-global-color-0, #c9a227));
}

.nice-form-icon svg {
	width: 40px;
	height: 40px;
}

.nice-form-field-icon {
	display: inline-flex;
	vertical-align: -2px;
	margin-right: 6px;
}

.nice-form-field-icon svg {
	width: 14px;
	height: 14px;
	display: block;
}

.nice-form-field {
	margin-bottom: 1.25em;
}

.nice-form-field label {
	display: block;
	margin-bottom: 0.5em;
	font-weight: 700;
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--nf-label, var(--nf-accent, var(--ast-global-color-0, #1a1a1a))) !important;
}

.nice-form-split-row {
	display: flex;
	gap: 1.5em;
}

.nice-form-split-col {
	flex: 1;
}

.nice-form-address-group .nice-form-split-row {
	margin-top: 1.1em;
}

.nice-form-address-group > input {
	margin-bottom: 0;
}

.nice-form-field .required {
	color: #d63638;
}

.nice-form-wrapper .nice-form-field input[type="text"],
.nice-form-wrapper .nice-form-field input[type="email"],
.nice-form-wrapper .nice-form-field input[type="tel"],
.nice-form-wrapper .nice-form-field input[type="number"],
.nice-form-wrapper .nice-form-field input[type="date"],
.nice-form-wrapper .nice-form-field select,
.nice-form-wrapper .nice-form-field textarea,
.nice-form-wrapper .nice-form-split-col input,
.nice-form-wrapper .nice-form-address-group input,
.nice-form-wrapper .nice-form-address-group select {
	width: 100%;
	box-sizing: border-box;
	padding: 0.55em 0;
	font-size: 1em;
	font-family: inherit;
	color: var(--nf-text, var(--ast-global-color-3, #1a1a1a)) !important;
	background: var(--nf-bg, transparent) !important;
	border: none !important;
	border-bottom: 1px solid var(--nf-border, var(--ast-border-color, #d5d8dc)) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	transition: border-color 0.15s ease;
}

.nice-form-wrapper .nice-form-field input:focus,
.nice-form-wrapper .nice-form-field select:focus,
.nice-form-wrapper .nice-form-field textarea:focus {
	outline: none;
	border-bottom-color: var(--nf-accent, var(--ast-global-color-0, #0274be)) !important;
	box-shadow: none !important;
}

/*
 * Select dropdowns: the CLOSED field can safely use the theme's light text
 * color, but the OPEN option list is rendered by the browser as a native
 * white panel in virtually every browser — if the options inherit a light
 * theme color too, you get invisible white-on-white text. Force the list
 * itself to always be dark-on-light regardless of the site's color scheme.
 */
.nice-form-wrapper .nice-form-field select option {
	color: #111111 !important;
	background-color: #ffffff !important;
}

/*
 * Date fields: make the native calendar icon visible on a dark background
 * (Chrome/Edge/Safari support this; Firefox will show its own default icon
 * instead, which is an acceptable fallback). Also hint the browser to render
 * its native calendar popup in dark mode where supported, which pulls the
 * popup itself much closer to a dark theme automatically.
 */
.nice-form-wrapper .nice-form-field input[type="date"] {
	color-scheme: dark;
}

.nice-form-wrapper .nice-form-field input[type="date"]::-webkit-calendar-picker-indicator {
	filter: invert(1);
	cursor: pointer;
	opacity: 0.85;
}

.nice-form-wrapper .nice-form-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
	opacity: 1;
}

.nice-form-choice-group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em 1.5em;
}

.nice-form-choice {
	font-weight: 400 !important;
	display: flex;
	align-items: center;
	gap: 0.4em;
	margin-bottom: 0 !important;
}

.nice-form-choice input {
	margin: 0;
}

.nice-form-submit-row {
	display: flex;
	align-items: center;
	gap: 0.75em;
}

.nice-form-submit-btn {
	display: inline-block;
	padding: 0.75em 1.75em;
	font-size: 1em;
	font-weight: 600;
	line-height: 1;
	color: #111 !important;
	background-color: var(--nf-accent, var(--ast-global-color-0, #0274be)) !important;
	border: none !important;
	border-radius: var(--ast-button-border-radius, 4px);
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color 0.15s ease, filter 0.15s ease, transform 0.1s ease;
}

.nice-form-submit-btn:hover {
	filter: brightness(0.9);
}

.nice-form-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.nice-form-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid rgba(0, 0, 0, 0.15);
	border-top-color: var(--ast-global-color-0, #0274be);
	border-radius: 50%;
	animation: nice-forms-spin 0.7s linear infinite;
}

@keyframes nice-forms-spin {
	to {
		transform: rotate(360deg);
	}
}

.nice-form-message {
	margin-top: 1em;
	padding: 0.75em 1em;
	border-radius: var(--ast-border-radius, 4px);
	font-size: 0.95em;
	background: transparent !important;
	border: 1px solid !important;
	border-left-width: 3px !important;
}

.nice-form-message-success {
	color: #4caf50 !important;
	border-color: #4caf50 !important;
}

.nice-form-message-error {
	color: #e57373 !important;
	border-color: #e57373 !important;
}

/* Honeypot: visually hidden but present in the DOM for bots to fill in */
.nice-form-hp-field {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------------- Admin screens ---------------- */

.nice-forms-wrap .nice-forms-field-row .form-table td {
	vertical-align: top;
}
