/* contact-form.css - Revision 1 */

/* Base form container */
.z_form {
	max-width: 800px;
	margin: 0 auto;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	color: #333;
	line-height: 1.5;
}

/* Form rows */
.z_row {
	display: flex;
	flex-wrap: wrap;
	margin-bottom: 25px;
	gap: 20px;
	width: 100%;
}

/* Form elements (columns) */
.form_element {
	flex: 1;
	box-sizing: border-box;
	min-width: 0; /* Prevents flex items from overflowing */
}

/* Single column rows */
.z_row .form_element:only-child {
	flex: none;
	width: 100%;
}

/* Submit button row */
.z_row:has(#_z_form_submit) {
	justify-content: flex-start;
}

/* #_z_form_submit {
	flex: none;
	width: auto;
} */

/* Mobile first - single column on small screens */
@media (max-width: 768px) {
	.z_row {
		flex-direction: column;
		gap: 15px;
	}

	.form_element {
		width: 100% !important;
		flex: none;
	}
}

/* Desktop layout - side by side */
@media (min-width: 769px) {
	.z_row {
		align-items: flex-start;
	}

	/* Adjust for gap in multi-column rows */
	.z_row .form_element:not(:only-child) {
		width: calc(50% - 10px) !important;
	}

	/* Three column layout */
	.z_row:has(.form_element:nth-child(3)) .form_element {
		width: calc(33.333% - 14px) !important;
	}

	/* Four column layout */
	.z_row:has(.form_element:nth-child(4)) .form_element {
		width: calc(25% - 15px) !important;
	}
}

/* Labels */
.form_element label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	color: #666;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Required field indicator */
.required {
	color: #d32f2f;
	font-weight: bold;
}

/* Input container */
.input_ele {
	position: relative;
}

/* Base input styles */
.z_form input[type="text"],
.z_form input[type="email"],
.z_form input[type="tel"],
.z_form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    background-color: #fff;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Focus states */
.z_form input[type="text"]:focus,
.z_form input[type="email"]:focus,
.z_form input[type="tel"]:focus,
.z_form textarea:focus {
	outline: none;
	border-color: #4A90E2;
	box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Error states */
.z_form input.error,
.z_form textarea.error {
    border-color: #ff0000;
    background-color: #ff7eb724;
}

.z_form input.error:focus,
.z_form textarea.error:focus {
	border-color: #d32f2f;
	box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* Textarea specific */
.z_form textarea {
	min-height: 120px;
	resize: vertical;
}

/* Character counter */
.char_counter {
	font-size: 12px;
	color: #999;
	margin-top: 5px;
	text-align: right;
}

.char_counter.warning {
	color: #ff9800;
	font-weight: bold;
}

/* Error messages */
.error_message {
	animation: slideInError 0.3s ease-out;
	background: #970000;
	padding: 10px 15px;
	border-radius: 0;
	font-weight: 500;
	margin-top: 8px;
	font-size: 14px;
	display: none;
	color: white;
}

@keyframes slideInError {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Form notifications */
.form_notification {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
    display: none;
    width: 100%;
    text-align: center;
}

.form_notification.success {
	background-color: #4caf50;
	color: white;
}

.form_notification.error {
	background-color: #d32f2f;
	color: white;
}

/* Submit button */
#z_form_submit {
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #232323;
    padding: 21px 30px;
    font-weight: 200;
    border-radius: 0;
    margin-top: 10px;
    font-size: 14px;
    cursor: pointer;
    color: white;
    border: none;
    display: block;
    width: 100%;
}

/* Submit button container styling */
/* #_z_form_submit {
	width: auto !important;
	flex: none !important;
} */

#_z_form_submit .form_element {
	width: auto !important;
}

#z_form_submit:active {
	transform: translateY(0);
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#z_form_submit:disabled {
	background: #ccc;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
	position: relative;
}

#z_form_submit:disabled:before {
	content: '';
	position: absolute;
	left: 15px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	border: 2px solid #ffffff;
	border-radius: 50%;
	border-top-color: transparent;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to { transform: translateY(-50%) rotate(360deg); }
}

/* Captcha container */
#captcha_container {
	text-align: center;
	margin: 20px 0;
}

/* Form title styling (if used) */
.form_title {
	text-align: center;
	margin-bottom: 10px;
	color: #4A90E2;
	font-size: 2.5em;
	font-weight: 300;
}

.form_subtitle {
	text-align: center;
	margin-bottom: 30px;
	color: #666;
	font-size: 1.1em;
}

/* Loading spinner for submit button */
.loading-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #ffffff;
	border-radius: 50%;
	border-top-color: transparent;
	animation: spin 1s ease-in-out infinite;
	margin-right: 8px;
}

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

/* Accessibility improvements */
.z_form input:focus,
.z_form textarea:focus,
.z_form button:focus {
	outline: 2px solid #4A90E2;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.z_form input[type="text"],
	.z_form input[type="email"],
	.z_form input[type="tel"],
	.z_form textarea {
		border-width: 3px;
	}

	.error_message {
		border: 2px solid #000;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.z_form input,
	.z_form textarea,
	#z_form_submit,
	.error_message,
	.form_notification {
		transition: none;
	}

	#z_form_submit:hover {
		transform: none;
	}

	.loading-spinner {
		animation: none;
	}
}

/* Print styles */
@media print {
	.z_form {
		background: white;
		box-shadow: none;
	}

	#z_form_submit {
		display: none;
	}
}
