/* =========================================================================
   AIAG Form Builder widget
   Namespaced under .aiag-fb to avoid collisions with global-inputs.css.
   ========================================================================= */

.aiag-fb {
	padding: 0;
	display: block;
	background: #fff;
	box-sizing: border-box;
	font-family: "DM Sans", system-ui, sans-serif;
}

.aiag-fb *,
.aiag-fb *::before,
.aiag-fb *::after {
	box-sizing: border-box;
}

/* ---------- Layout shell ---------- */
.aiag-fb__shell {
	padding: 40px 0;
	background: #fff;
	position: relative;
}

@media (max-width: 1100px) {
	.aiag-fb__shell { padding: 28px 0; }
}

/* ---------- Form header ---------- */
.aiag-fb__title {
	font-size: 26px;
	line-height: 1.2;
	font-weight: 700;
	color: #001D25;
	margin: 0 0 12px;
}

.aiag-fb__desc {
	font-size: 15px;
	color: #21282D;
	margin: 0 0 20px;
	max-width: 72ch;
	line-height: 1.6;
}

.aiag-fb__desc p:first-child { margin-top: 0; }
.aiag-fb__desc p:last-child { margin-bottom: 0; }
.aiag-fb__desc a { color: #026982; }

.aiag-fb__intro {
	font-size: 14px;
	color: #4B4C4D;
	margin: 0 0 28px;
	max-width: 62ch;
	line-height: 1.55;
}

.aiag-fb__req {
	color: #F41C1C;
	font-weight: 400;
	font-size: 13px;
	margin-left: 4px;
}

/* ---------- Honeypot (hidden but focusable off-screen) ---------- */
.aiag-fb__honeypot {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Field grid ---------- */
.aiag-fb__fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 20px;
}

.aiag-fb__field {
	display: block;
	margin: 0;
}

.aiag-fb__field--full {
	grid-column: 1 / -1;
}

.aiag-fb__field--half {
	grid-column: span 1;
}

@media (max-width: 640px) {
	.aiag-fb__fields {
		grid-template-columns: 1fr;
	}
	.aiag-fb__field--half {
		grid-column: 1 / -1;
	}
}

/* ---------- Section header (layout-only field) ---------- */
.aiag-fb__section {
	grid-column: 1 / -1;
	border-top: 1px solid #E6EAE9;
	padding-top: 36px;
	margin-top: 20px;
}

.aiag-fb__section--no-divider {
	border-top: 0;
	padding-top: 4px;
	margin-top: 0;
}

.aiag-fb__section-hd {
	display: flex;
	align-items: baseline;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.aiag-fb__section-num {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px;
	font-weight: 700;
	color: #026982;
	letter-spacing: 1.5px;
	text-transform: uppercase;
}

.aiag-fb__section-heading {
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 26px;
	line-height: 1.2;
	font-weight: 700;
	color: #001D25;
	margin: 0;
}

.aiag-fb__section-subtext {
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 14px;
	color: #4B4C4D;
	margin: 0 0 12px;
	max-width: 62ch;
	line-height: 1.55;
}

/* ---------- Labels / inputs / errors ---------- */
.aiag-fb__lbl,
.aiag-fb__legend {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: #21282D;
	margin-bottom: 8px;
	line-height: 1.3;
}

.aiag-fb__hint {
	font-size: 12px;
	color: #4B4C4D;
	margin-top: -4px;
	margin-bottom: 8px;
	line-height: 1.4;
}

/* Hard-edge 2px-black-border style, matching EC Contact + Membership App. */
.aiag-fb .aiag-fb__input,
.aiag-fb .aiag-fb__textarea,
.aiag-fb .aiag-fb__select {
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 15px;
	width: 100% !important;
	box-sizing: border-box;
	padding: 14px;
	border: 2px solid #000;
	border-radius: 0;
	color: #21282D;
	background: #fff;
	line-height: 1.3;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .15s, box-shadow .15s;
	margin: 0;
	display: block;
	height: 52px;
}

.aiag-fb .aiag-fb__textarea {
	min-height: 120px;
	resize: vertical;
	line-height: 1.55;
	height: auto;
}

.aiag-fb__input::placeholder,
.aiag-fb__textarea::placeholder { color: #707070; }

.aiag-fb__input:focus,
.aiag-fb__textarea:focus,
.aiag-fb__select:focus {
	outline: none;
	border-color: #026982;
	box-shadow: 0 0 0 3px rgba(2, 105, 130, .18);
}

.aiag-fb__field--invalid .aiag-fb__input,
.aiag-fb__field--invalid .aiag-fb__textarea,
.aiag-fb__field--invalid .aiag-fb__select,
.aiag-fb__field--invalid .aiag-fb__file {
	border-color: #F41C1C;
}

.aiag-fb__err {
	display: none;
	font-size: 13px;
	color: #F41C1C;
	margin-top: 6px;
	line-height: 1.3;
}

.aiag-fb__field--invalid .aiag-fb__err {
	display: block;
}

/* ---------- Radio / checkbox groups ---------- */
.aiag-fb__radios,
.aiag-fb__checks {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.aiag-fb__radio,
.aiag-fb__check {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	color: #21282D;
	cursor: pointer;
	padding: 6px 8px;
	border-radius: 4px;
}

.aiag-fb__radio input,
.aiag-fb__check input {
	appearance: auto;
	margin: 0;
	width: 18px;
	height: 18px;
	accent-color: #026982;
}

/* ---------- File upload ---------- */
.aiag-fb__file {
	display: block;
	width: 100%;
	padding: 14px;
	border: 2px dashed #000;
	border-radius: 0;
	background: #fff;
	font-size: 14px;
	font-family: "DM Sans", system-ui, sans-serif;
	color: #21282D;
	cursor: pointer;
}

.aiag-fb__file:hover {
	border-color: #026982;
	background: #F1FAFB;
}

.aiag-fb__file-meta {
	margin-top: 8px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.aiag-fb__file-meta-chip {
	font-size: 12px;
	color: #4B4C4D;
	background: #F2F4F4;
	padding: 3px 8px;
	border-radius: 12px;
}

.aiag-fb__file-progress {
	margin-top: 8px;
	height: 4px;
	background: #E6EAE9;
	border-radius: 2px;
	overflow: hidden;
	display: none;
}

.aiag-fb__file-progress.is-on {
	display: block;
}

.aiag-fb__file-progress-bar {
	display: block;
	height: 100%;
	background: #007891;
	width: 0;
	transition: width 120ms ease-in-out;
}

/* ---------- Consent ---------- */
.aiag-fb__field--consent {
	grid-column: 1 / -1;
	margin-top: 12px;
}

.aiag-fb__consent {
	display: grid;
	grid-template-columns: 22px 1fr;
	gap: 10px;
	align-items: flex-start;
	font-size: 13px;
	color: #21282D;
	line-height: 1.5;
	cursor: pointer;
}

.aiag-fb__consent input {
	position: absolute;
	opacity: 0;
	width: 22px;
	height: 22px;
	margin: 0;
}

.aiag-fb__consent-box {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: 1.5px solid #21282D;
	border-radius: 3px;
	background: #fff;
	flex: none;
	position: relative;
}

.aiag-fb__consent-box svg {
	width: 16px;
	height: 16px;
	opacity: 0;
	transition: opacity 80ms ease-in-out;
}

.aiag-fb__consent input:checked + .aiag-fb__consent-box svg {
	opacity: 1;
}

.aiag-fb__consent-txt a {
	color: #026982;
	text-decoration: underline;
}

/* ---------- Error banner ---------- */
.aiag-fb__error-banner {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 2px solid #F41C1C;
	color: #21282D;
	padding: 14px 16px;
	margin: 16px 0 0;
	font-size: 14px;
	border-radius: 0;
}

/* HTML [hidden] would normally display:none, but our display:flex overrides it. Restore default. */
.aiag-fb__error-banner[hidden] {
	display: none;
}

.aiag-fb__error-retry,
.aiag-fb__error-dismiss {
	border: 2px solid #000;
	background: #fff;
	color: #000;
	padding: 6px 14px;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	border-radius: 0;
	line-height: 1;
}

.aiag-fb__error-retry { margin-left: auto; }
.aiag-fb__error-retry:hover,
.aiag-fb__error-dismiss:hover { background: #000; color: #fff; }

.aiag-fb__error-dismiss {
	padding: 6px 10px;
	font-size: 16px;
}

/* ---------- Submit row ---------- */
.aiag-fb__submit-row {
	grid-column: 1 / -1;
	margin-top: 32px;
	padding-top: 24px;
	border-top: 2px solid #E6EAE9;
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.aiag-fb__submit {
	font-family: "DM Sans", system-ui, sans-serif;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	padding: 18px 26px;
	border: 2px solid #000;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	line-height: 1;
	transition: background .15s, color .15s, border-color .15s;
	background: #5CFF96;
	color: #000;
	border-radius: 0;
}

.aiag-fb__submit::after {
	content: "\2192";
	font-weight: 400;
	letter-spacing: 0;
}

.aiag-fb__submit:hover:not(:disabled) {
	background: #001D25;
	color: #fff;
	border-color: #001D25;
}

.aiag-fb__submit:disabled {
	background: #E6EAE9;
	color: #707070;
	border-color: #A5A5A5;
	cursor: not-allowed;
}

.aiag-fb__submit:disabled::after { opacity: .4; }

/* The form container grid shifts to single-col semantics for nested blocks
   (fields grid, consent, error banner, submit row). */
.aiag-fb__form {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	margin: 0;
}

.aiag-fb__form > * {
	width: 100%;
}

/* ---------- Success state ---------- */
.aiag-fb__success {
	display: none;
	text-align: center;
	padding: 48px 24px;
}

.aiag-fb__success.is-on {
	display: block;
}

.aiag-fb__success i {
	font-size: 48px;
	color: #0AA66D;
	margin-bottom: 16px;
}

.aiag-fb__success h2 {
	font-size: 26px;
	font-weight: 700;
	color: #001D25;
	margin: 0 0 12px;
}

.aiag-fb__success-body {
	font-size: 15px;
	color: #4B4C4D;
	max-width: 56ch;
	margin: 0 auto 24px;
	line-height: 1.55;
}

.aiag-fb__ticket {
	font-size: 12px;
	letter-spacing: 0.1em;
	color: #4B4C4D;
	margin-bottom: 20px;
}

.aiag-fb__success-links {
	display: inline-flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 16px;
}

.aiag-fb__success-links a {
	color: #026982;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
}

.aiag-fb__success-links a i {
	font-size: 14px;
	color: #026982;
	margin-right: 6px;
	margin-bottom: 0;
}

.aiag-fb__success-links a:hover {
	text-decoration: underline;
}

