/**
 * Broadband ZIP Search Form Styles
 * Modern, responsive design matching the provided UI/UX
 */

/* Container */
.broadband-zip-search {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0;
}

/* Form wrapper with elevated card design */
.zip-search-form {
	position: relative;
	width: 100%;
	margin: 0 auto;
}

/* Input container with white background and shadow */
.zip-search-form .input-container {
	display: flex;
	align-items: center;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
	padding: 8px 11px 8px 11px;
	transition: all 0.3s ease;
	position: relative;
}

.zip-search-form .input-container:hover {
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.zip-search-form .input-container:focus-within {
	box-shadow: 0 12px 32px rgba(29, 78, 216, 0.15), 0 4px 12px rgba(29, 78, 216, 0.08);
}

/* Location icon container */
.zip-search-form .icon-container {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 12px;
	flex-shrink: 0;
}

.zip-search-form .icon-container .dashicons {
	width: 24px;
	height: 24px;
	font-size: 24px;
	color: #9ca3af;
	transition: color 0.3s ease;
}

.zip-search-form .input-container:focus-within .icon-container .dashicons {
	color: #1D4ED8;
}

/* Hide screen reader text visually but keep it accessible */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Input field */
.zip-search-form .zip_search_input {
	flex: 1;
	border: none;
	outline: none;
	background: transparent !important;
	font-size: 25px;
	line-height: 1.5;
	color: #1f2937;
	padding: 12px 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-weight: 600;
	min-width: 0;
	box-shadow: none !important;
}

/* Prevent autofill background color */
.zip-search-form .zip_search_input:-webkit-autofill,
.zip-search-form .zip_search_input:-webkit-autofill:hover,
.zip-search-form .zip_search_input:-webkit-autofill:focus,
.zip-search-form .zip_search_input:-webkit-autofill:active {
	-webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
	-webkit-text-fill-color: #1f2937 !important;
	background-color: transparent !important;
	transition: background-color 5000s ease-in-out 0s;
}

.zip-search-form .zip_search_input::placeholder {
	color: #9ca3af;
	opacity: 1;
	font-weight: 400;
	font-size: 16px;
}

.zip-search-form .zip_search_input:focus::placeholder {
	color: #d1d5db;
}

/* Search button with gradient brand color */
.zip-search-form .submit-zip {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
	color: #ffffff;
	border: none;
	border-radius: 12px;
	padding: 12px 32px;
	font-size: 20px;
	font-weight: 600;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	cursor: pointer;
	transition: all 0.3s ease;
	white-space: nowrap;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
}

.zip-search-form .submit-zip:hover {
	background: linear-gradient(135deg, #1E40AF 0%, #1D4ED8 100%);
	box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
	transform: translateY(-1px);
}

.zip-search-form .submit-zip:active {
	transform: translateY(0);
	box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

.zip-search-form .submit-zip:disabled {
	background: linear-gradient(135deg, #9ca3af 0%, #a8aeb8 100%);
	cursor: not-allowed;
	transform: none;
	box-shadow: 0 2px 8px rgba(156, 163, 175, 0.25);
}

/* Search icon inside button */
.zip-search-form .submit-zip::before {
	content: "\f179";
	font-family: "dashicons";
	font-size: 18px;
	display: inline-block;
	width: 18px;
	height: 18px;
	line-height: 1;
}

/* Loading indicator */
.zip-search-form .loading-indicator {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

.zip-search-form .submit-zip.is-loading .loading-indicator {
	display: inline-block;
}

.zip-search-form .submit-zip.is-loading::before {
	display: none;
}

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

/* Feedback message */
.zip-search-feedback {
	margin-top: 12px;
	font-size: 14px;
	line-height: 1.5;
	color: #6b7280;
	padding: 0 20px;
	min-height: 21px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.zip-search-feedback.is-error {
	color: #ef4444;
	font-weight: 500;
}

.zip-search-feedback:empty {
	display: none;
}

/* Responsive design */
@media screen and (max-width: 768px) {
	.broadband-zip-search {
		padding: 0 16px;
	}

	.zip-search-form .input-container {
		padding: 6px 6px 6px 16px;
		border-radius: 14px;
	}

	.zip-search-form .icon-container {
		margin-right: 8px;
	}

	.zip-search-form .icon-container .dashicons {
		width: 20px;
		height: 20px;
		font-size: 20px;
	}

	.zip-search-form .zip_search_input {
		font-size: 25px;
		padding: 12px 12px;
	}

	.zip-search-form .submit-zip {
		padding: 12px 24px;
		font-size: 15px;
		border-radius: 10px;
	}

	.zip-search-form .submit-zip::before {
		font-size: 16px;
		width: 16px;
		height: 16px;
	}

	.zip-search-feedback {
		font-size: 13px;
		padding: 0 16px;
	}
}

@media screen and (max-width: 480px) {
	.broadband-zip-search {
		padding: 0 12px;
	}

	.zip-search-form .input-container {
		flex-direction: column;
		padding: 12px;
		gap: 10px;
	}

	.zip-search-form .icon-container {
		position: absolute;
		left: 16px;
		top: 16px;
		margin-right: 0;
	}

	.zip-search-form .zip_search_input {
		width: 100%;
		padding: 12px 12px 12px 40px;
		font-size: 25px;
	}

	.zip-search-form .submit-zip {
		width: 100%;
		padding: 14px 24px;
		font-size: 15px;
		justify-content: center;
	}

	.zip-search-feedback {
		padding: 0 12px;
		text-align: center;
	}
}

/* Extra small devices */
@media screen and (max-width: 360px) {
	.zip-search-form .zip_search_input {
		font-size: 22px;
		padding: 10px 10px 10px 36px;
	}

	.zip-search-form .submit-zip {
		padding: 12px 20px;
		font-size: 14px;
	}

	.zip-search-form .icon-container .dashicons {
		width: 18px;
		height: 18px;
		font-size: 18px;
	}
}

/* Focus states for accessibility */
.zip-search-form .zip_search_input:focus {
	outline: none;
}

.zip-search-form .submit-zip:focus {
	outline: 2px solid #1D4ED8;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.zip-search-form .input-container {
		border: 2px solid #1f2937;
	}

	.zip-search-form .submit-zip {
		border: 2px solid #6d4eea;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.zip-search-form .input-container,
	.zip-search-form .icon-container .dashicons,
	.zip-search-form .submit-zip {
		transition: none;
	}

	.zip-search-form .submit-zip:hover {
		transform: none;
	}

	.zip-search-form .submit-zip:active {
		transform: none;
	}

	.loading-indicator {
		animation: none;
		border-top-color: transparent;
	}
}
