/* Nairo Forms — front end styles.
 * Reskin per brand by overriding the variables below in your theme CSS.
 * e.g. .nf-card { --nf-primary: #16245A; --nf-primary-hover: #0F1A45; }
 */

.nf-card {
	--nf-primary: #2147e8;
	--nf-primary-hover: #1736bf;
	--nf-ink: #0b1633;
	--nf-muted: #5a6584;
	--nf-border: #dce3f5;
	--nf-bg: #ffffff;
	--nf-field-bg: #f7f9fe;
	--nf-success: #0e9f6e;
	--nf-error: #d23f3f;
	--nf-radius: 14px;
	--nf-focus-ring: rgba(33, 71, 232, 0.14);

	box-sizing: border-box;
	max-width: 560px;
	margin: 0 auto;
	padding: 36px 32px;
	background: var(--nf-bg);
	border: 1px solid var(--nf-border);
	border-radius: var(--nf-radius);
	box-shadow: 0 18px 40px -24px rgba(11, 22, 51, 0.25);
	font-family: var(--nf-font-body, inherit);
	color: var(--nf-ink);
}

.nf-card *,
.nf-card *::before,
.nf-card *::after {
	box-sizing: border-box;
}

/* Header */

.nf-eyebrow {
	display: inline-block;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--nf-primary);
	margin-bottom: 10px;
}

.nf-title {
	margin: 0 0 6px;
	font-size: 24px;
	line-height: 1.25;
	font-weight: 700;
	font-family: var(--nf-font-heading, inherit);
	color: var(--nf-ink);
}

.nf-subtitle {
	margin: 0 0 26px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--nf-muted);
}

/* Field grid */

.nf-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 16px;
}

.nf-col-full {
	grid-column: 1 / -1;
}

.nf-col-half {
	grid-column: span 1;
}

.nf-field {
	margin-bottom: 18px;
	min-width: 0;
}

.nf-label {
	display: block;
	margin-bottom: 6px;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--nf-ink);
}

.nf-req {
	color: var(--nf-error);
	margin-left: 3px;
}

.nf-input {
	display: block;
	width: 100%;
	padding: 12px 14px;
	font-size: 15px;
	font-family: inherit;
	color: var(--nf-ink);
	background: var(--nf-field-bg);
	border: 1.5px solid var(--nf-border);
	border-radius: 10px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
	appearance: none;
}

.nf-input::placeholder {
	color: #9aa4c0;
}

.nf-input:focus {
	outline: none;
	background: #ffffff;
	border-color: var(--nf-primary);
	box-shadow: 0 0 0 3px rgba(33, 71, 232, 0.14);
}

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

.nf-card .nf-form select.nf-input {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6584' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 38px;
	cursor: pointer;
}

/* Radio and checkbox groups */

.nf-choices {
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding-top: 2px;
}

.nf-choice {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 14.5px;
	color: var(--nf-ink);
	cursor: pointer;
	line-height: 1.45;
}

.nf-choice input {
	margin: 3px 0 0;
	accent-color: var(--nf-primary);
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

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

.nf-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Turnstile */

.nf-turnstile {
	margin: 4px 0 14px;
}

/* Consent line: small copy pinned above the button */

.nf-consent {
	margin: 2px 0 12px;
}

.nf-consent-line {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 12.5px;
	line-height: 1.55;
	color: var(--nf-muted);
	cursor: pointer;
}

.nf-consent-line input {
	margin: 2px 0 0;
	accent-color: var(--nf-primary);
	flex-shrink: 0;
	width: 15px;
	height: 15px;
}

.nf-consent-line a {
	color: var(--nf-primary);
	text-decoration: underline;
}

/* Button */

.nf-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 14px 22px;
	margin-top: 4px;
	font-size: 15.5px;
	font-weight: 600;
	font-family: inherit;
	color: #ffffff;
	background: var(--nf-button, var(--nf-primary));
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease;
}

.nf-button:hover {
	background: var(--nf-button-hover, var(--nf-primary-hover));
}

.nf-button:active {
	transform: translateY(1px);
}

.nf-button:focus-visible {
	outline: 3px solid rgba(33, 71, 232, 0.35);
	outline-offset: 2px;
}

.nf-button[disabled] {
	opacity: 0.65;
	cursor: wait;
}

/* Status */

.nf-status {
	margin: 14px 0 0;
	font-size: 14.5px;
	line-height: 1.5;
	min-height: 1em;
}

.nf-status.is-success {
	color: var(--nf-success);
	font-weight: 600;
}

.nf-status.is-error {
	color: var(--nf-error);
	font-weight: 600;
}

/* Sent state */

.nf-card.is-sent .nf-form > :not(.nf-status) {
	display: none;
}

/* Mobile */

@media (max-width: 520px) {
	.nf-card {
		padding: 26px 20px;
	}

	.nf-grid {
		grid-template-columns: 1fr;
	}

	.nf-col-half {
		grid-column: 1 / -1;
	}

	.nf-title {
		font-size: 21px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nf-input,
	.nf-button {
		transition: none;
	}
}

/* Submit button loading spinner */

.nf-button.is-loading {
	opacity: 0.85;
	pointer-events: none;
}

.nf-button.is-loading::after {
	content: '';
	display: inline-block;
	width: 13px;
	height: 13px;
	margin-left: 8px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #ffffff;
	border-radius: 50%;
	vertical-align: middle;
	animation: nf-spin 0.7s linear infinite;
}

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

/* Multi-step */

.nf-step {
	display: none;
}

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

.nf-progress {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin-bottom: 18px;
}

.nf-progress-text {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--nf-primary);
}

.nf-progress-track {
	display: block;
	height: 5px;
	border-radius: 99px;
	background: var(--nf-border, #dce3f5);
	overflow: hidden;
}

.nf-progress-bar {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 99px;
	background: var(--nf-primary);
	transition: width 0.25s ease;
}

.nf-step-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 4px;
}

.nf-back {
	background: transparent;
	border: none;
	color: var(--nf-muted);
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	padding: 10px 4px;
}

.nf-back:hover {
	color: var(--nf-ink);
}

.nf-file {
	padding: 9px;
	cursor: pointer;
}

.nf-file-hint {
	display: block;
	margin-top: 4px;
	font-size: 11.5px;
	color: var(--nf-muted);
}

/* Success state: pulsing check, centred message */

.nf-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 26px 12px 18px;
}

.nf-success-ring {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: #d9f5e6;
	color: #1fbe6e;
	animation: nf-pulse 1.8s ease-in-out infinite;
}

.nf-success-ring svg {
	width: 38px;
	height: 38px;
}

.nf-success-text {
	margin: 16px 0 0;
	font-size: 15.5px;
	line-height: 1.55;
	font-weight: 600;
	color: var(--nf-ink);
	max-width: 420px;
}

@keyframes nf-pulse {
	0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(31, 190, 110, 0.32); }
	50% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(31, 190, 110, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.nf-success-ring { animation: none; }
}

/* -------------------------------------------------------------------
 * Theme armor. Themes and page builders (Elementor, Divi, Astra, and
 * others) frequently ship blanket rules like input[type="text"] { ... }
 * that repaint form fields and break our look, often catching text
 * inputs while leaving select and textarea alone, so the form ends up
 * visually mismatched. Scoping each rule under .nf-card .nf-form raises
 * our specificity above those type selectors, and restating every
 * load-bearing property stops a framework from half-styling a field.
 * No !important needed; specificity does the work.
 * ---------------------------------------------------------------- */

.nf-card .nf-form .nf-input,
.nf-card .nf-form input.nf-input,
.nf-card .nf-form textarea.nf-input,
.nf-card .nf-form select.nf-input {
	box-sizing: border-box;
	display: block;
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	font-size: 15px;
	line-height: 1.4;
	font-family: var(--nf-font-body, inherit);
	color: var(--nf-ink);
	background-color: var(--nf-field-bg);
	border: 1.5px solid var(--nf-border);
	border-radius: 10px;
	box-shadow: none;
	min-height: 0;
	height: auto;
	max-width: 100%;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.nf-card .nf-form .nf-input:focus,
.nf-card .nf-form input.nf-input:focus,
.nf-card .nf-form textarea.nf-input:focus,
.nf-card .nf-form select.nf-input:focus {
	outline: none;
	background-color: #ffffff;
	border-color: var(--nf-primary);
	box-shadow: 0 0 0 3px var(--nf-focus-ring);
}

.nf-card .nf-form textarea.nf-input {
	min-height: 110px;
	resize: vertical;
}

.nf-card .nf-form select.nf-input {
	padding-right: 38px;
	cursor: pointer;
}

/* Choice inputs and the consent box should also resist theme accenting. */
.nf-card .nf-form input[type="checkbox"],
.nf-card .nf-form input[type="radio"] {
	accent-color: var(--nf-primary);
}

/* ===== Country field: searchable dropdown ===== */
.nf-country { position: relative; }
.nf-country-menu {
	position: absolute;
	z-index: 30;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	margin: 0;
	padding: 6px;
	list-style: none;
	max-height: 240px;
	overflow-y: auto;
	background: var(--nf-bg);
	border: 1.5px solid var(--nf-border);
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(11, 22, 51, 0.12);
}
.nf-country-option {
	padding: 9px 12px;
	font-size: 14.5px;
	color: var(--nf-ink);
	border-radius: 7px;
	cursor: pointer;
	line-height: 1.3;
}
.nf-country-option:hover,
.nf-country-option.is-active {
	background: var(--nf-field-bg);
	color: var(--nf-primary);
}
.nf-country-search { background-image: none; }
