/**
 * LFCF Contact Form — accessible, overrideable styles.
 * All colors and radii use CSS custom properties so Elementor can override per instance.
 */

/* ── Variables ──────────────────────────────────────────────────────────────── */
.lfcf-form-wrapper {
	--lfcf-primary:           #1a1a2e;
	--lfcf-primary-h:         #2a2a3e;
	--lfcf-text:              #333333;
	--lfcf-muted:             #666666;
	--lfcf-input-bg:          #ffffff;
	--lfcf-input-border:      #cccccc;
	--lfcf-input-border-focus: var(--lfcf-primary);
	--lfcf-placeholder:       #999999;
	--lfcf-button-bg:         var(--lfcf-primary);
	--lfcf-button-text:       #ffffff;
	--lfcf-button-bg-hover:   var(--lfcf-primary-h);
	--lfcf-button-text-hover: #ffffff;
	--lfcf-radius:            6px;
	--lfcf-padding:           1.25rem;
	--lfcf-field-gap:         1rem;
	--lfcf-font:              inherit;
	--lfcf-error-bg:          #ffebee;
	--lfcf-error-text:        #c62828;
	--lfcf-error-border:      #ffcdd2;
	--lfcf-success-bg:        #e8f5e9;
	--lfcf-success-text:      #2e7d32;
	--lfcf-success-border:    #c8e6c9;

	box-sizing: border-box;
	font-family: var(--lfcf-font);
}

.lfcf-form-wrapper *,
.lfcf-form-wrapper *::before,
.lfcf-form-wrapper *::after {
	box-sizing: inherit;
}

/* ── Form structure ─────────────────────────────────────────────────────────── */
.lfcf-form {
	padding: 0;
}

/* Grid layout for field width control (Feature 2.2). */
.lfcf-form fieldset {
	border: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--lfcf-field-gap);
}

.lfcf-form legend {
	font-size: 1.1em;
	font-weight: 600;
	margin-bottom: 1rem;
	color: var(--lfcf-text);
}

/* ── Field grid columns ─────────────────────────────────────────────────────── */
.lfcf-form .lfcf-field--full,
.lfcf-form .lfcf-checkbox-field.lfcf-field--full,
.lfcf-form .lfcf-field-error.lfcf-field--full,
.lfcf-form .lfcf-field--submit {
	grid-column: span 2;
}

.lfcf-form .lfcf-field--half,
.lfcf-form .lfcf-checkbox-field.lfcf-field--half {
	grid-column: span 1;
}

/* Mobile: collapse all fields to full width. */
@media (max-width: 600px) {
	.lfcf-form .lfcf-field--half,
	.lfcf-form .lfcf-checkbox-field.lfcf-field--half {
		grid-column: span 2;
	}
}

/* ── Fields ─────────────────────────────────────────────────────────────────── */
.lfcf-field {
	margin-bottom: 0; /* gap handles spacing now */
}

.lfcf-field label {
	display: block;
	margin-bottom: .35rem;
	font-size: .9rem;
	font-weight: 500;
	color: var(--lfcf-text);
}

.lfcf-field label .lfcf-required {
	color: var(--lfcf-error-text);
	margin-left: 2px;
}

.lfcf-field input[type="text"],
.lfcf-field input[type="email"],
.lfcf-field input[type="tel"],
.lfcf-field select,
.lfcf-field textarea {
	display: block;
	width: 100%;
	padding: 1.3rem .85rem;
	border: 1px solid var(--lfcf-input-border);
	border-radius: var(--lfcf-radius);
	background: var(--lfcf-input-bg); 
	color: var(--lfcf-text);
	font-size: .95rem;
	font-family: var(--lfcf-font);
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none;
	appearance: none; 
}

.lfcf-field input::placeholder,
.lfcf-field textarea::placeholder {
	color: var(--lfcf-placeholder);
	opacity: 1;
}

.lfcf-field input:focus,
.lfcf-field select:focus,
.lfcf-field textarea:focus {
	outline: 2px solid var(--lfcf-input-border-focus);
	outline-offset: 2px;
	border-color: var(--lfcf-input-border-focus);
}

.lfcf-field textarea {
	resize: vertical;
	min-height: 120px;
}

/* ── Screen reader text (Feature 2.1 — placeholder mode label). */
.lfcf-form .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	word-wrap: normal !important;
}

/* ── Error state ─────────────────────────────────────────────────────────────── */
.lfcf-input-error,
.lfcf-input-error:focus {
	border-color: var(--lfcf-error-text) !important;
}

.lfcf-field-error {
	display: none;
	color: var(--lfcf-error-text);
	font-size: .82rem;
	margin-top: .3rem;
}

/* ── Checkboxes ─────────────────────────────────────────────────────────────── */
.lfcf-checkbox-field {
	display: flex;
	align-items: flex-start;
	gap: .5rem;
}

.lfcf-checkbox-field input[type="checkbox"] {
	margin-top: .2rem;
	accent-color: var(--lfcf-primary);
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
}

.lfcf-checkbox-field label {
	font-size: .88rem;
	color: var(--lfcf-input-bg);
	margin-bottom: 0;
}

.lfcf-checkbox-field label a {
	color: var(--lfcf-input-bg);
	font-weight: 800;
}

/* ── Honeypot ─────────────────────────────────────────────────────────────────── */
.lfcf-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ── Submit button ───────────────────────────────────────────────────────────── */
.lfcf-submit-btn {
	display: inline-block;
	padding: .75rem 2rem;
	background: var(--lfcf-button-bg) !important;
	color: var(--lfcf-button-text) !important;
	border: none;
	border-radius: var(--lfcf-radius);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, transform .1s ease;
	width: 100%;
} 

.lfcf-submit-btn:hover:not(:disabled) {
	background: var(--lfcf-button-bg-hover) !important;
	color: var(--lfcf-button-text-hover) !important;
}

.lfcf-submit-btn:focus-visible {
	outline: 2px solid var(--lfcf-primary);
	outline-offset: 3px;
}

.lfcf-submit-btn:disabled {
	opacity: .65;
	cursor: not-allowed;
}

/* ── Messages ───────────────────────────────────────────────────────────────── */
.lfcf-form-message {
	display: none;
	padding: .85rem 1rem;
	border-radius: var(--lfcf-radius);
	margin-bottom: 1rem;
	font-size: .92rem;
}

.lfcf-form-message--success {
	background: var(--lfcf-success-bg);
	color: var(--lfcf-success-text);
	border: 1px solid var(--lfcf-success-border);
}

.lfcf-form-message--error {
	background: var(--lfcf-error-bg);
	color: var(--lfcf-error-text);
	border: 1px solid var(--lfcf-error-border);
}

/* ── SR-only live region ────────────────────────────────────────────────────── */
.lfcf-sr-live {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border: 0;
}
