/**
 * Active Campaign Module
 * Renders an ActiveCampaign form (header/body copy, fields, button, thanks
 * message all come from ActiveCampaign itself). Field/button styling mirrors
 * contact_form_module's input/select/submit treatment under this module's
 * own class names, so it renders correctly even on a page that doesn't also
 * have a Contact Form module (CSS is not shared between the two).
 */

/* ===========================
   # Section / box
=========================== */

.active-campaign-module {
	padding: 80px 100px;
}

.active-campaign-module__box {
	max-width: 720px;
	margin: 0 auto;
	padding: 50px;
	background: var(--nec-light-grey, #f5f5f6);
	border-radius: 8px;
}

/* ===========================
   # ActiveCampaign's own header/body fields
=========================== */

.active-campaign-module__heading {
	margin: 0 0 12px;
	font-family: var(--nec-font);
	font-size: clamp(1.5rem, calc(1.3rem + 1vw), 2rem);
	font-weight: 500;
	line-height: 1.25;
	color: var(--nec-grey);
}

.active-campaign-module__html {
	margin: 0 0 20px;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--nec-grey);
}

.active-campaign-module__html p:first-child {
	margin-top: 0;
}

.active-campaign-module__html p:last-child {
	margin-bottom: 0;
}

/* ===========================
   # Thank-you message (swapped in for the form on submit — see .js)
=========================== */

.active-campaign-module__thanks {
	font-family: var(--nec-font);
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--nec-grey);
	text-align: center;
}

/* ===========================
   # Form — field grid
=========================== */

.active-campaign-module__form {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

.active-campaign-module__heading,
.active-campaign-module__html,
.active-campaign-module__group {
	grid-column: 1 / -1;
}

/* ===========================
   # Fields — shared styling (mirrors contact_form_module)
=========================== */

.active-campaign-module__label-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.active-campaign-module__input {
	width: 100%;
	background: var(--nec-white, #fff);
	border: none;
	border-radius: 4px;
	padding: 14px 18px;
	font-family: var(--nec-font);
	font-size: 0.9375rem;
	color: var(--nec-grey);
}

.active-campaign-module__input::placeholder {
	color: var(--nec-grey);
	opacity: 0.55;
}

.active-campaign-module__input:focus-visible {
	outline: 2px solid var(--nec-blue);
	outline-offset: 2px;
}

.active-campaign-module__textarea {
	min-height: 120px;
	resize: vertical;
}

.active-campaign-module__select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5l5 5 5-5' stroke='%23384249' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 18px center;
	background-size: 16px;
	padding-right: 44px;
}

.active-campaign-module__select:invalid,
.active-campaign-module__select option[value=""] {
	color: rgba(56, 66, 73, 0.55);
}

/* Checkbox / radio groups */
.active-campaign-module__group {
	border: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.active-campaign-module__legend {
	padding: 0;
	font-family: var(--nec-font);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--nec-grey);
	margin-bottom: 4px;
}

.active-campaign-module__option {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--nec-font);
	font-size: 0.9375rem;
	color: var(--nec-grey);
}

.active-campaign-module__option input {
	width: auto;
}

/* ===========================
   # Submit button
=========================== */

.active-campaign-module__submit {
	grid-column: 2;
	justify-self: end;
	margin-top: 12px;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-family: var(--nec-font);
	font-size: 1rem;
	font-weight: 500;
	color: var(--nec-grey);
}

.active-campaign-module__submit:focus-visible {
	outline: none;
}

.active-campaign-module__submit-icon {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	transition: transform 0.25s ease;
	color: var(--nec-orange, #EB6E00);
}

.active-campaign-module__submit:hover .active-campaign-module__submit-icon,
.active-campaign-module__submit:focus-visible .active-campaign-module__submit-icon {
	transform: translateX(4px);
}

.active-campaign-module__submit-icon svg {
	width: 34px;
	height: 34px;
}

.active-campaign-module__target-frame {
	display: none;
}

/* ===========================
   # Responsive — 991px
=========================== */

@media (max-width: 991px) {
	.active-campaign-module {
		padding: 40px 0;
	}

	.active-campaign-module__box {
		padding: 32px;
	}

	.active-campaign-module__form {
		grid-template-columns: 1fr;
	}

	.active-campaign-module__submit {
		grid-column: 1;
		justify-self: start;
	}
}

/* ===========================
   # Responsive — 599px
=========================== */

@media (max-width: 599px) {
	.active-campaign-module__box {
		padding: 24px;
	}
}
