/**
 * Edrone Newsletter Module Frontend Styles
 * 
 * @author    RomiCore
 * @copyright 2024 RomiCore
 * @license   MIT License
 */

/* Main form container */
.edrone-newsletter-form {
	position: relative;
	padding: 20px;
	background: transparent;
	border: none;
	color: #181818;
	max-width: 1484px;
	margin: auto;
}

.edrone-newsletter-form.form-holder.appmov {
	background: transparent;
	box-shadow: none;
}

/* Newsletter heading */
.newsletter-heading {
	font-size: 24px;
	font-weight: 600;
	color: #181818;
	margin-bottom: 10px;
	text-transform: lowercase;
}

.newsletter-subheading {
	font-size: 16px;
	font-weight: 500;
	color: #181818;
	margin-bottom: 20px;
	line-height: 1.4;
}

/* Form fields container */
.newsletter-fields {
	width: 100%;
}

.input-group-newsletter {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-bottom: 20px;
}

/* Input fields styling */
.newsletter-input {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #ddd;
	border-radius: 0;
	font-size: 14px;
	font-weight: 500;
	transition: border-color 0.3s ease;
	background-color: #fff;
	margin-bottom: 10px;
	color: #181818;
}

.newsletter-input:focus {
	outline: none;
	border-color: #181818;
}

.newsletter-input:invalid {
	border-color: #dc3545;
}

.newsletter-input::placeholder {
	color: #999;
	opacity: 1;
}

/* Checkbox styling */
.input-group-checkbox {
	margin-bottom: 15px;
}

.input-group-checkbox.styled-input-single {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.input-group-checkbox input[type='checkbox'] {
	margin: 0;
	margin-top: 3px;
	flex-shrink: 0;
}

.input-group-checkbox label {
	font-size: 10px;
	font-weight: 400;
	line-height: 1.4;
	color: #181818;
	cursor: pointer;
	margin: 0;
}

.input-group-checkbox label a {
	color: #181818;
	text-decoration: underline;
}

.input-group-checkbox label a:hover {
	color: #181818;
	text-decoration: none;
}

/* reCAPTCHA container */
.recaptcha-container {
	margin: 20px auto;
	text-align: center;
}

/* Submit button */
.newsletter-submit {
	padding: 12px 30px;
	background-color: #000;
	color: white;
	border: none;
	border-radius: 0;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.3s ease;
	margin-top: 15px;
	text-transform: lowercase;
}

.newsletter-submit:hover:not(:disabled) {
	background-color: #333;
}

.newsletter-submit:disabled {
	background-color: #999;
	cursor: not-allowed;
}

/* Success and error messages */
.newsletter-success,
.newsletter-error {
	margin: 15px 0;
	padding: 12px 15px;
	border-radius: 0;
	font-size: 14px;
	font-weight: 500;
	animation: slideIn 0.3s ease;
}

.newsletter-success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.newsletter-error {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Loading state */
.newsletter-submit.loading {
	position: relative;
	color: transparent;
}

.newsletter-submit.loading::after {
	content: '';
	position: absolute;
	width: 20px;
	height: 20px;
	top: 50%;
	left: 50%;
	margin-left: -10px;
	margin-top: -10px;
	border: 2px solid transparent;
	border-top: 2px solid #fff;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* Responsive design */
@media (min-width: 576px) {
	.input-group-newsletter {
		flex-direction: column;
		gap: 10px;
	}

	.newsletter-input {
		width: 100%;
		max-width: 400px;
	}

	.newsletter-submit {
		width: auto;
		min-width: 120px;
	}
}

@media (min-width: 768px) {
	.edrone-newsletter-form {
		padding: 25px;
	}

	.input-group-newsletter {
		gap: 10px;
	}
}

/* Hide form when processing to prevent double submission */
.edrone-newsletter-form.processing {
	pointer-events: none;
	opacity: 0.7;
}

/* Date picker specific styling */
.newsletter-datepicker[type='date'] {
	position: relative;
}

.newsletter-datepicker[type='date']::-webkit-calendar-picker-indicator {
	background: transparent;
	bottom: 0;
	color: transparent;
	cursor: pointer;
	height: auto;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
	width: auto;
}

/* Phone input styling */
input[type='tel'].newsletter-input {
	letter-spacing: 0.5px;
}

/* Focus ring for accessibility */
.newsletter-input:focus-visible,
.newsletter-submit:focus-visible,
.input-group-checkbox input[type='checkbox']:focus-visible {
	outline: 2px solid #007bff;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.newsletter-input {
		border-width: 2px;
	}

	.newsletter-submit {
		border: 2px solid #000;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.newsletter-input,
	.newsletter-submit,
	.newsletter-success,
	.newsletter-error {
		transition: none;
	}

	.slideIn,
	.spin {
		animation: none;
	}
}

/* Print styles */
@media print {
	.edrone-newsletter-form {
		display: none;
	}
}
