/**
 * JAEVC mailing list form + floating modal (scoped).
 */

/* --- Form card (shortcode + modal body) --- */
.jaevc-ml-form {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	width: 100%;
	max-width: min(700px, 100%);
	padding: 40px;
	margin: 20px auto;
	box-sizing: border-box;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.jaevc-ml-form .jaevc-ml-form__header {
	text-align: center;
	margin-bottom: 24px;
}

.jaevc-ml-form .jaevc-ml-form__title {
	color: #2d3748;
	font-size: 28px;
	line-height: 1.2;
	margin: 0 0 12px;
	font-weight: 700;
}

.jaevc-ml-form .jaevc-ml-form__subtitle {
	color: #4a5568;
	font-size: 15px;
	line-height: 1.5;
	margin: 0;
	max-width: 36em;
	margin-left: auto;
	margin-right: auto;
}

.jaevc-ml-form .jaevc-ml-form__group {
	margin-bottom: 24px;
}

.jaevc-ml-form .jaevc-ml-form__label {
	display: block;
	color: #2d3748;
	font-weight: 600;
	font-size: 14px;
	margin-bottom: 8px;
}

.jaevc-ml-form .jaevc-ml-form__optional {
	color: #a0aec0;
	font-weight: 400;
}

.jaevc-ml-form .jaevc-ml-form__input,
.jaevc-ml-form .jaevc-ml-form__textarea {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.2s ease;
	box-sizing: border-box;
	max-width: 100%;
	overflow-wrap: break-word;
	word-break: break-word;
}

.jaevc-ml-form .jaevc-ml-form__textarea {
	resize: vertical;
	min-height: 100px;
}

.jaevc-ml-form .jaevc-ml-form__hint {
	font-size: 13px;
	color: #718096;
	margin: 0;
	line-height: 1.6;
}

.jaevc-ml-form .jaevc-ml-form__hint a {
	color: #667eea;
	text-decoration: none;
}

.jaevc-ml-form .jaevc-ml-form__submit {
	width: 100%;
	padding: 14px 24px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.jaevc-ml-form .jaevc-ml-form__submit:hover:not(:disabled) {
	opacity: 0.95;
}

.jaevc-ml-form .jaevc-ml-form__submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

/* Phone row: prevent flex overflow */
.jaevc-ml-form .phone-input-container {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	align-items: stretch;
	min-width: 0;
	width: 100%;
	max-width: 100%;
}

.jaevc-ml-form .phone-country-selector-wrapper {
	position: relative;
	flex: 0 0 auto;
	min-width: 0;
}

.jaevc-ml-form #ml-phone-country-selector {
	width: 100px;
	min-width: 0;
	max-width: 100%;
	padding: 12px 10px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	background-color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 4px;
	box-sizing: border-box;
}

.jaevc-ml-form #ml-phone {
	flex: 1 1 0;
	min-width: 0;
}

.jaevc-ml-form #ml-phone-country-list {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 4px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	max-height: 300px;
	overflow-y: auto;
	z-index: 1000;
}

/* --- Floating FAB wrapper --- */
#jaevc-floating-form-wrapper {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	z-index: auto !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	margin: 18px 0 14px !important;
	padding: 0 12px !important;
	box-sizing: border-box !important;
	pointer-events: auto !important;
	clear: both !important;
}

#jaevc-floating-form-button {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	transform: none !important;
	width: min(920px, 100%) !important;
	min-height: 34px !important;
	height: auto !important;
	padding: 8px 16px !important;
	-webkit-appearance: none;
	appearance: none;
	font: inherit;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
	border: 1px solid rgba(102, 126, 234, 0.45) !important;
	border-radius: 999px !important;
	box-shadow: 0 3px 10px rgba(102, 126, 234, 0.25) !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
	pointer-events: auto !important;
	margin: 0 !important;
	box-sizing: border-box !important;
	text-align: center !important;
	overflow: hidden !important;
}

#jaevc-floating-form-button:hover {
	transform: translateY(-1px) !important;
	box-shadow: 0 5px 14px rgba(102, 126, 234, 0.35) !important;
	filter: brightness(1.02) !important;
}

#jaevc-floating-form-button:focus-visible {
	outline: 3px solid #4c51bf !important;
	outline-offset: 2px !important;
}

#jaevc-floating-form-button .jaevc-floating-marquee {
	display: block !important;
	width: 100% !important;
	overflow: hidden !important;
	white-space: nowrap !important;
}

#jaevc-floating-form-button .jaevc-floating-label {
	color: #fff !important;
	font-size: 13px !important;
	line-height: 1.2 !important;
	font-weight: 700 !important;
	letter-spacing: 0.1px !important;
	padding: 0 !important;
	text-transform: none !important;
	pointer-events: none !important;
	display: inline-block !important;
	margin: 0 !important;
	opacity: 0.96 !important;
	white-space: nowrap !important;
	padding-left: 100% !important;
	animation: jaevc-mailing-marquee 12s linear infinite !important;
}

@keyframes jaevc-mailing-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
	#jaevc-floating-form-button .jaevc-floating-label {
		animation: none !important;
		padding-left: 0 !important;
	}
}

/* --- Modal shell --- */
#jaevc-form-modal-overlay {
	display: none !important;
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100vw !important;
	background-color: rgba(0, 0, 0, 0.6) !important;
	z-index: 10060 !important;
	justify-content: center !important;
	align-items: flex-start !important;
	padding: 16px !important;
	box-sizing: border-box !important;
	overflow-x: hidden !important;
	overflow-y: auto !important;
	pointer-events: none !important;
	margin: 0 !important;
}

#jaevc-form-modal-overlay.active {
	display: flex !important;
	pointer-events: auto;
}

#jaevc-form-modal-content {
	background: #fff !important;
	border-radius: 16px !important;
	width: 100% !important;
	max-width: min(800px, calc(100vw - 32px)) !important;
	max-height: 90vh !important;
	overflow-x: hidden !important;
	overflow-y: auto !important;
	position: relative !important;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
	animation: jaevc-ml-slideIn 0.3s ease !important;
	margin: 24px auto !important;
	pointer-events: auto !important;
	box-sizing: border-box !important;
}

@keyframes jaevc-ml-slideIn {
	from {
		opacity: 0;
		transform: translateY(-12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

#jaevc-form-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	background: #f7fafc;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
	z-index: 10;
	font-size: 20px;
	line-height: 1;
	color: #4a5568;
	pointer-events: auto;
}

#jaevc-form-modal-close:hover {
	background: #e2e8f0;
	color: #2d3748;
}

#jaevc-form-modal-body {
	padding: 48px 24px 28px;
	box-sizing: border-box;
	max-width: 100%;
	overflow-x: hidden;
}

/* Form inside modal: one visual card (#jaevc-form-modal-content), not a nested card */
#jaevc-form-modal-body .jaevc-ml-form {
	margin: 0;
	box-shadow: none;
	max-width: 100%;
}

#jaevc-form-modal-body .jaevc-mailing-list-form-container {
	margin: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	border-radius: 0 !important;
	max-width: 100% !important;
	padding: 0 !important;
}

@media (max-width: 768px) {
	.jaevc-ml-form {
		padding: 24px 16px;
		margin: 12px auto;
		border-radius: 12px;
	}

	.jaevc-ml-form .jaevc-ml-form__title {
		font-size: 22px;
	}

	.jaevc-ml-form .jaevc-ml-form__subtitle {
		font-size: 14px;
	}

	.jaevc-ml-form .jaevc-ml-form__input,
	.jaevc-ml-form .jaevc-ml-form__textarea,
	.jaevc-ml-form #ml-phone-country-selector {
		font-size: 16px;
	}

	#jaevc-floating-form-wrapper {
		margin: 14px 0 12px !important;
		padding: 0 10px !important;
	}

	#jaevc-floating-form-button {
		min-height: 32px !important;
		padding: 7px 12px !important;
	}

	#jaevc-floating-form-button .jaevc-floating-label {
		font-size: 12px !important;
	}

	#jaevc-form-modal-content {
		max-height: 95vh !important;
		border-radius: 12px !important;
		margin: 12px auto !important;
	}

	#jaevc-form-modal-body {
		padding: 44px 12px 20px;
	}
}

@media (max-width: 480px) {
	.jaevc-ml-form .phone-input-container {
		flex-direction: column;
		flex-wrap: wrap;
		align-items: stretch;
	}

	.jaevc-ml-form .phone-country-selector-wrapper {
		width: 100%;
	}

	.jaevc-ml-form #ml-phone-country-selector {
		width: 100%;
		max-width: 100%;
	}

	.jaevc-ml-form #ml-phone {
		width: 100%;
		flex: none;
	}
}

/* Legacy class used by older shortcode markup */
#jaevc-form-modal-body .ahimsa-mailing-list-form-container {
	margin: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	border-radius: 0 !important;
	max-width: 100% !important;
	padding: 0 !important;
}
#jaevc-floating-form-button {
	text-decoration: none !important;
	color: #fff !important;
}
