/* ==========================================================================
   NoyaForms Pro — fields, multi-step and builder extras
   ========================================================================== */

/* Conditional logic -------------------------------------------------------- */

.noyaforms .nf-logic-init,
.noyaforms .nf-logic-hidden {
	display: none !important;
}

/* Rating ------------------------------------------------------------------- */

.noyaforms .nf-rating {
	display: inline-flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	gap: 6px;
}

.noyaforms .nf-rating input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

.noyaforms .nf-rating label {
	display: inline-flex;
	cursor: pointer;
	color: #d0d5dd;
	transition: color .15s, transform .2s var(--nf-ease, ease);
}

.noyaforms .nf-rating svg {
	fill: currentColor;
	display: block;
}

.noyaforms .nf-rating label:hover,
.noyaforms .nf-rating label:hover ~ label,
.noyaforms .nf-rating input:checked ~ label {
	color: #fdb022;
}

.noyaforms .nf-rating label:hover {
	transform: scale(1.15);
}

.noyaforms .nf-rating input:focus-visible + label {
	outline: 2px solid var(--nf-accent);
	outline-offset: 3px;
	border-radius: 6px;
}

.noyaforms .nf-rating-preview {
	flex-direction: row;
}

.noyaforms .nf-rating-preview label:nth-child(-n+4) {
	color: #fdb022;
}

/* File upload -------------------------------------------------------------- */

.noyaforms .nf-file-drop {
	position: relative;
	border: 1.5px dashed var(--nf-border);
	border-radius: calc(var(--nf-radius) + 2px);
	background: #fcfcfd;
	transition: border-color .15s, background-color .15s;
}

.noyaforms.nf-theme-soft .nf-file-drop {
	background: var(--nf-input-bg);
}

.noyaforms .nf-file-drop:hover,
.noyaforms .nf-file-drop.is-dragover {
	border-color: var(--nf-accent);
	background: var(--nf-tint);
}

.noyaforms .nf-has-error .nf-file-drop {
	border-color: var(--nf-error);
	background: #fffbfa;
}

.noyaforms .nf-file-input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.noyaforms .nf-file-input:focus-visible + .nf-file-ui {
	outline: 2px solid var(--nf-accent);
	outline-offset: -4px;
	border-radius: var(--nf-radius);
}

.noyaforms .nf-file-ui {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 28px 16px 26px;
	text-align: center;
	color: var(--nf-muted);
}

.noyaforms .nf-file-ui svg {
	box-sizing: content-box;
	width: 22px;
	height: 22px;
	margin-bottom: 8px;
	padding: 11px;
	border-radius: 50%;
	background: var(--nf-tint-strong, rgba(79, 70, 229, .1));
	box-shadow: 0 0 0 6px var(--nf-tint, rgba(79, 70, 229, .06));
	color: var(--nf-accent);
	transition: transform .2s var(--nf-ease, ease);
}

.noyaforms .nf-file-drop:hover .nf-file-ui svg,
.noyaforms .nf-file-drop.is-dragover .nf-file-ui svg {
	transform: translateY(-2px);
}

.noyaforms .nf-file-text {
	color: var(--nf-text);
}

.noyaforms .nf-file-text strong {
	color: var(--nf-accent);
	font-weight: 600;
}

.noyaforms .nf-file-hint {
	font-size: .8125em;
}

.noyaforms .nf-file-list {
	list-style: none;
	margin: 0;
	padding: 0 14px;
}

.noyaforms .nf-file-drop.has-files .nf-file-list {
	padding-bottom: 14px;
}

.noyaforms .nf-file-list li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 6px;
	padding: 10px 12px;
	border-radius: var(--nf-radius);
	background: #fff;
	box-shadow: 0 0 0 1px var(--nf-line, #eaecf0), var(--nf-shadow-xs, 0 1px 2px rgba(16, 24, 40, .05));
	font-size: .875em;
}

.noyaforms .nf-file-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 500;
}

.noyaforms .nf-file-size {
	flex: none;
	color: var(--nf-muted);
	font-variant-numeric: tabular-nums;
}

/* Address ------------------------------------------------------------------ */

.noyaforms .nf-address {
	display: flex;
	flex-wrap: wrap;
	gap: 12px var(--nf-gap-x);
}

.noyaforms .nf-address .nf-subfield {
	flex: 0 0 100%;
}

.noyaforms .nf-address .nf-subfield.nf-w-half {
	flex-basis: calc(50% - var(--nf-gap-x) / 2);
}

@container (max-width: 420px) {
	.noyaforms .nf-address .nf-subfield.nf-w-half {
		flex-basis: 100%;
	}
}

/* Range -------------------------------------------------------------------- */

.noyaforms .nf-range {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 6px 16px;
}

.noyaforms .nf-range-input {
	--nf-fill: 50%;
	width: 100%;
	height: 6px;
	margin: 12px 0;
	border-radius: 999px;
	background: linear-gradient(to right, var(--nf-accent) var(--nf-fill), var(--nf-line, #eaecf0) var(--nf-fill));
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.noyaforms .nf-range .nf-range-input::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--nf-accent);
	box-shadow: 0 2px 6px rgba(16, 24, 40, .18);
	transition: transform .15s;
}

.noyaforms .nf-range .nf-range-input:active::-webkit-slider-thumb {
	transform: scale(1.12);
}

.noyaforms .nf-range .nf-range-input::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--nf-accent);
	box-shadow: 0 2px 6px rgba(16, 24, 40, .18);
}

.noyaforms .nf-range-input:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px var(--nf-focus);
}

.noyaforms .nf-range-value {
	min-width: 60px;
	padding: 6px 12px;
	border-radius: var(--nf-radius);
	background: var(--nf-tint-strong, rgba(79, 70, 229, .1));
	color: var(--nf-accent);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.noyaforms .nf-range-scale {
	grid-column: 1;
	display: flex;
	justify-content: space-between;
	font-size: .75em;
	color: var(--nf-muted);
}

/* Multi-step --------------------------------------------------------------- */

.noyaforms .nf-progress {
	margin-bottom: 28px;
}

.noyaforms .nf-progress-meta {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 10px;
	font-size: .875em;
}

.noyaforms .nf-progress-title {
	font-weight: 700;
	color: var(--nf-label);
}

.noyaforms .nf-progress-count {
	color: var(--nf-muted);
	font-variant-numeric: tabular-nums;
}

.noyaforms .nf-progress-track {
	height: 8px;
	border-radius: 999px;
	background: var(--nf-soft, #f2f4f7);
	overflow: hidden;
}

.noyaforms .nf-progress-fill {
	height: 100%;
	border-radius: inherit;
	background-color: var(--nf-accent);
	background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .25));
	transition: width .45s var(--nf-ease, ease);
}

/* Stepper: numbered dots joined by a line; finished steps show a tick. */
.noyaforms .nf-stepper {
	display: flex;
	gap: 0;
	margin: 0 0 32px;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.noyaforms .nf-step {
	position: relative;
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	min-width: 0;
	margin: 0;
	padding: 0 6px;
	border: 0;
	color: var(--nf-muted);
	font-size: .8125em;
	text-align: center;
}

.noyaforms .nf-step::before {
	content: "";
	position: absolute;
	top: 15px;
	left: calc(-50% + 22px);
	right: calc(50% + 22px);
	height: 2px;
	border-radius: 2px;
	background: var(--nf-line, #eaecf0);
	transition: background-color .3s;
}

.noyaforms .nf-step:first-child::before {
	display: none;
}

.noyaforms .nf-step.is-active::before,
.noyaforms .nf-step.is-done::before {
	background: var(--nf-accent);
}

.noyaforms .nf-step-num {
	position: relative;
	display: grid;
	place-items: center;
	flex: none;
	width: 32px;
	height: 32px;
	border: 2px solid var(--nf-line, #eaecf0);
	border-radius: 50%;
	background: var(--nf-surface, #fff);
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	transition: background-color .25s, border-color .25s, color .25s, box-shadow .25s;
}

.noyaforms .nf-step-title {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}

.noyaforms .nf-step.is-active,
.noyaforms .nf-step.is-done {
	color: var(--nf-label);
}

.noyaforms .nf-step.is-active .nf-step-num {
	border-color: var(--nf-accent);
	color: var(--nf-label);
	box-shadow: 0 0 0 4px var(--nf-focus);
}

.noyaforms .nf-step.is-done .nf-step-num {
	border-color: var(--nf-accent);
	background: var(--nf-accent);
	color: transparent;
}

.noyaforms .nf-step.is-done .nf-step-num::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 14px;
	height: 14px;
	background: var(--nf-on-accent, #fff);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

@container (max-width: 520px) {
	.noyaforms .nf-step-title {
		display: none;
	}

	.noyaforms .nf-step.is-active .nf-step-title {
		display: block;
	}
}

.noyaforms .nf-page[hidden],
.noyaforms .nf-submit-row[hidden],
.noyaforms .nf-page-prev[hidden] {
	display: none !important;
}

.noyaforms .nf-page {
	animation: nf-in .3s var(--nf-ease, ease-out);
}

.noyaforms .nf-page-nav {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 30px;
}

.noyaforms .nf-page-nav .nf-page-next:only-child {
	margin-left: auto;
}

.noyaforms .nf-submit-row .nf-page-prev {
	margin-right: auto;
}

/* Builder extras ----------------------------------------------------------- */

.nfb-logic-sentence {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 14px 0 12px;
	color: var(--nfb-text-2, #374151);
	font-weight: 500;
}

#noyaforms-builder .nfb-logic-sentence .nfb-input {
	width: auto;
	min-width: 72px;
	min-height: 32px;
	padding: 4px 26px 4px 8px;
}

.nfb-rules {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 12px;
}

.nfb-rule {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	padding: 10px;
	border: 1px solid var(--nfb-border, #e5e7eb);
	border-radius: 10px;
	background: #fafafa;
}

.nfb-rule-grid {
	flex: 1;
	display: grid;
	gap: 6px;
	min-width: 0;
}

.nfb-rule-join {
	align-self: center;
	padding: 1px 10px;
	border-radius: 999px;
	background: var(--nfb-accent-50, #eef2ff);
	color: var(--nfb-accent, #4f46e5);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
}

.nfb-pagebreak-pro {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.nfb-pb-btn {
	align-self: flex-end;
	padding: 8px 16px;
	border-radius: 8px;
	background: var(--nf-accent, #4f46e5);
	color: #fff;
	font-weight: 600;
	font-size: 13px;
}

.nfb-pb-line {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--nfb-muted, #6b7280);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.nfb-pb-line em {
	font-style: normal;
	white-space: nowrap;
}

.nfb-pb-line::before,
.nfb-pb-line::after {
	content: "";
	flex: 1;
	border-top: 2px dashed var(--nfb-border-strong, #d1d5db);
}

.nfb-payload {
	margin-top: 16px;
}

.nfb-payload summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--nfb-accent, #4f46e5);
}

.nfb-payload pre {
	margin: 10px 0 0;
	padding: 12px 14px;
	border-radius: 10px;
	background: #111827;
	color: #e5e7eb;
	font-size: 12px;
	overflow: auto;
}

/* Mailchimp (builder → Integrations) ------------------------------------ */
.nfb-sheet-stack .nfb-sheet + .nfb-sheet {
	margin-top: 24px;
}

.nfb-mc-title {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.nfb-mc-title svg {
	width: 26px;
	height: 26px;
	flex: none;
}

.nfb-badge-ok {
	display: inline-flex;
	align-items: center;
	padding: 2px 10px;
	border-radius: 999px;
	background: #ecfdf3;
	color: #067647;
	font-size: 12px;
	font-weight: 600;
}

.nfb-card-icon.nfb-mc-icon {
	background: transparent;
}

.nfb-mc-connect {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
	padding: 14px 16px;
	border: 1px solid #fde68a;
	border-radius: 12px;
	background: #fffbeb;
}

.nfb-mc-connect p {
	margin: 2px 0 0;
	color: var(--nfb-muted);
	font-size: 13px;
}

.nfb-mc-connect > div:not(.nfb-mc-connect-actions) {
	flex: 1;
}

.nfb-mc-connect-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.nfb-mc-inline {
	display: flex;
	align-items: center;
	gap: 8px;
}

.nfb-mc-inline .nfb-select {
	flex: 1;
}

.nfb-mc-map {
	display: grid;
	gap: 10px;
	margin-bottom: 18px;
}

.nfb-mc-map-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid var(--nfb-border);
	border-radius: 10px;
	background: var(--nfb-surface);
}

.nfb-mc-map-name {
	display: grid;
	gap: 2px;
	min-width: 0;
	margin: 0;
}

.nfb-mc-map-name strong {
	overflow: hidden;
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nfb-mc-map-name span {
	color: var(--nfb-muted);
	font-size: 11.5px;
}

.nfb-mc-error {
	color: #b42318;
}

.nfb-mc-loading {
	margin: 4px 0 0;
	font-size: 13px;
}

@media (max-width: 640px) {
	.nfb-mc-connect,
	.nfb-mc-map-row {
		grid-template-columns: 1fr;
		flex-direction: column;
		align-items: stretch;
	}
}
