/**
 * Nexio Form Builder — structural defaults.
 * Every color/size here is overridable from the widget's Style tab.
 */

.nexio-form-wrap {
	max-width: 100%;
}

.nexio-form__editor-badge {
	display: inline-block;
	margin-bottom: 12px;
	padding: 5px 12px;
	border-radius: 999px;
	background: #eef2ff;
	color: #4338ca;
	font-size: 12px;
	font-weight: 600;
}

.nexio-form__description {
	margin: 0 0 16px;
	opacity: 0.8;
}

.nexio-form__fields {
	display: flex;
	flex-wrap: wrap;
	row-gap: 16px;
	column-gap: 16px;
	--nexio-form-col-gap: 16px;
}

.nexio-form__field {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex-grow: 0;
	flex-shrink: 0;
}

/* Width system: percentage minus the shared column gap. */
.nexio-fw-100 { flex-basis: 100%; }
.nexio-fw-75  { flex-basis: calc(75% - var(--nexio-form-col-gap, 16px)); }
.nexio-fw-66  { flex-basis: calc(66.66% - var(--nexio-form-col-gap, 16px)); }
.nexio-fw-50  { flex-basis: calc(50% - var(--nexio-form-col-gap, 16px) / 2); }
.nexio-fw-33  { flex-basis: calc(33.33% - var(--nexio-form-col-gap, 16px)); }
.nexio-fw-25  { flex-basis: calc(25% - var(--nexio-form-col-gap, 16px)); }

@media (max-width: 1024px) {
	.nexio-fw-t-100 { flex-basis: 100%; }
	.nexio-fw-t-75  { flex-basis: calc(75% - var(--nexio-form-col-gap, 16px)); }
	.nexio-fw-t-66  { flex-basis: calc(66.66% - var(--nexio-form-col-gap, 16px)); }
	.nexio-fw-t-50  { flex-basis: calc(50% - var(--nexio-form-col-gap, 16px) / 2); }
	.nexio-fw-t-33  { flex-basis: calc(33.33% - var(--nexio-form-col-gap, 16px)); }
	.nexio-fw-t-25  { flex-basis: calc(25% - var(--nexio-form-col-gap, 16px)); }
}

@media (max-width: 767px) {
	.nexio-form__field { flex-basis: 100%; }

	.nexio-fw-m-100 { flex-basis: 100%; }
	.nexio-fw-m-75  { flex-basis: calc(75% - var(--nexio-form-col-gap, 16px)); }
	.nexio-fw-m-66  { flex-basis: calc(66.66% - var(--nexio-form-col-gap, 16px)); }
	.nexio-fw-m-50  { flex-basis: calc(50% - var(--nexio-form-col-gap, 16px) / 2); }
	.nexio-fw-m-33  { flex-basis: calc(33.33% - var(--nexio-form-col-gap, 16px)); }
	.nexio-fw-m-25  { flex-basis: calc(25% - var(--nexio-form-col-gap, 16px)); }
}

/* Labels */

.nexio-form__label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

.nexio-form__required {
	color: #dc2626;
}

/* Inline label layout */
.nexio-form-labels-inline .nexio-form__field {
	flex-direction: row;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.nexio-form-labels-inline .nexio-form__field .nexio-form__label {
	margin-bottom: 0;
	flex: 0 0 auto;
}

.nexio-form-labels-inline .nexio-form__field .nexio-form__input {
	flex: 1 1 120px;
}

.nexio-form-labels-inline .nexio-form__field .nexio-form__error,
.nexio-form-labels-inline .nexio-form__field .nexio-form__help {
	flex-basis: 100%;
}

.nexio-form-labels-hidden .nexio-form__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Inputs */

.nexio-form__input {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 14px;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 8px;
	background: #fff;
	font: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.nexio-form__input:focus {
	outline: none;
	border-color: rgba(0, 0, 0, 0.5);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.nexio-form__input:focus-visible {
	outline: 2px solid transparent;
}

.nexio-form__input:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.nexio-form__input[aria-invalid="true"] {
	border-color: #dc2626;
}

textarea.nexio-form__input {
	resize: vertical;
	min-height: 110px;
}

select.nexio-form__input {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px;
	padding-right: 38px;
}

select.nexio-form__input[multiple] {
	background-image: none;
	padding-right: 14px;
	height: auto;
}

/* Choice groups */

.nexio-form__options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nexio-form__option {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	cursor: pointer;
}

.nexio-form__option input {
	margin: 0;
}

.nexio-form__option input:focus-visible,
.nexio-form__consent input:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Inline row display */

.nexio-form__options--inline {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 14px;
}

/* Pills display — the real radio/checkbox stays in the DOM (hidden),
 * so keyboard access, validation, and submission are unchanged. */

.nexio-form__options--pills {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 10px;
}

.nexio-form__options--pills .nexio-form__option {
	position: relative;
	gap: 0;
}

.nexio-form__options--pills .nexio-form__option input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.nexio-form__options--pills .nexio-form__option span {
	display: inline-flex;
	align-items: center;
	padding: 9px 20px;
	border: 1px solid rgba(0, 0, 0, 0.22);
	border-radius: 999px;
	background: transparent;
	font-weight: 500;
	line-height: 1.3;
	cursor: pointer;
	user-select: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nexio-form__options--pills .nexio-form__option span:hover {
	border-color: rgba(0, 0, 0, 0.45);
}

.nexio-form__options--pills .nexio-form__option input:checked + span {
	background: #111;
	border-color: #111;
	color: #fff;
}

.nexio-form__options--pills .nexio-form__option input:focus-visible + span {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Consent */

.nexio-form__consent {
	display: inline-flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13px;
	line-height: 1.5;
	cursor: pointer;
}

.nexio-form__consent input {
	margin: 3px 0 0;
	flex-shrink: 0;
}

.nexio-form__consent a {
	color: inherit;
	text-decoration: underline;
}

/* File upload */

.nexio-form__file {
	border: 1px dashed rgba(0, 0, 0, 0.25);
	border-radius: 8px;
	padding: 14px;
	background: rgba(0, 0, 0, 0.02);
}

.nexio-form__file .nexio-form__file-input {
	border: none;
	background: transparent;
	padding: 0;
}

.nexio-form__file-names {
	margin-top: 6px;
	font-size: 13px;
	opacity: 0.75;
}

.nexio-form__file-names:empty {
	display: none;
}

/* Help + errors */

.nexio-form__help {
	display: block;
	margin-top: 5px;
	font-size: 12.5px;
	opacity: 0.65;
}

.nexio-form__error {
	display: block;
	margin-top: 5px;
	font-size: 12.5px;
	font-weight: 600;
	color: #dc2626;
}

.nexio-form__error:empty {
	display: none;
}

/* Headings + HTML blocks */

.nexio-form__heading {
	margin: 8px 0 0;
}

/* Honeypot — visually removed, still in the DOM for bots. */

.nexio-form__hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Actions + button. (0,2,1) so kit/theme button skins can't repaint. */

.nexio-form__actions {
	display: flex;
	margin-top: 20px;
}

.nexio-form button.nexio-form__submit {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 28px;
	border: none;
	border-radius: 10px;
	background: #111;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.nexio-form button.nexio-form__submit:hover {
	opacity: 0.88;
}

.nexio-form button.nexio-form__submit:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.nexio-form button.nexio-form__submit.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

.nexio-form button.nexio-form__submit.is-loading::after {
	content: "";
	display: inline-block;
	box-sizing: border-box;
	width: 1em;
	height: 1em;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: nexio-form-spin 0.6s linear infinite;
}

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

.nexio-form__submit--full {
	width: 100%;
}

@media (max-width: 767px) {
	.nexio-form-btn-mobile-full-yes .nexio-form__submit {
		width: 100%;
	}
}

.nexio-form__submit-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* Message region */

.nexio-form__message {
	margin-top: 16px;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
}

.nexio-form__message:focus {
	outline: none;
}

.nexio-form__message--success {
	background: #ecfdf5;
	color: #047857;
}

.nexio-form__message--error {
	background: #fef2f2;
	color: #b91c1c;
}
