/* NairoCRM Forms — front-end styles.
 *
 * Defaults are the NairoCRM brand. Every value is a custom property, so a
 * brand build changes the look without touching this file:
 *   - per-form colours and fonts arrive from the builder as inline variables
 *     (--nf-primary, --nf-button, --nf-ink, --nf-font-heading, --nf-font-body);
 *   - the site preset (includes/site-preset.php) can set any other token
 *     below through nairo_forms_preset_tokens().
 * Every rule is scoped under .nf-card so theme input and button styles
 * cannot override the form.
 */

.nf-card {
	--nf-primary: #1E61D6;          /* NairoCRM blue */
	--nf-primary-hover: #1a52b4;
	--nf-button: #1E61D6;
	--nf-button-hover: #1a52b4;
	--nf-button-shadow: rgba(30, 97, 214, 0.45);
	--nf-ink: #0F1B33;              /* NairoCRM ink */
	--nf-link: #14438f;
	--nf-ring: rgba(30, 97, 214, 0.18);
	--nf-text: #2b3a55;
	--nf-muted: #5b6b86;
	--nf-border: #dfe6f1;
	--nf-bg: #ffffff;
	--nf-field-bg: #f6f8fc;
	--nf-success: #2f6b0c;          /* NairoCRM green, darkened for legible text */
	--nf-success-bg: #edf7e3;
	--nf-success-line: #74C427;     /* NairoCRM green */
	--nf-error: #b42a3a;
	--nf-error-bg: #fbecee;
	--nf-radius: 16px;
	--nf-field-radius: 10px;
	--nf-button-radius: 10px;
	--nf-top-width: 1px;
	--nf-top-color: var(--nf-border);
	--nf-shadow: 0 24px 48px -32px rgba(15, 27, 51, 0.35);
	--nf-card-max: 680px;

	box-sizing: border-box;
	width: 100%;
	max-width: var(--nf-card-max);
	margin: 0 auto;
	padding: 36px 34px 32px;
	background: var(--nf-bg);
	border: 1px solid var(--nf-border);
	border-top: var(--nf-top-width) solid var(--nf-top-color);
	border-radius: var(--nf-radius);
	box-shadow: var(--nf-shadow);
	font-family: var(--nf-font-body, 'Manrope'), 'Manrope', 'Segoe UI', Arial, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: var(--nf-text);
	text-align: left;
}

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

/* Header */

.nf-card .nf-title {
	margin: 0 0 6px;
	font-family: var(--nf-font-heading, 'Manrope'), 'Manrope', 'Segoe UI', Arial, sans-serif;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: var(--nf-ink);
}

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

.nf-card .nf-head + .nf-form {
	margin-top: 22px;
}

/* Field grid */

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

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

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

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

.nf-card .nf-label {
	display: block;
	margin-bottom: 7px;
	font-family: var(--nf-font-heading, 'Manrope'), 'Manrope', 'Segoe UI', Arial, sans-serif;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--nf-ink);
}

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

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

.nf-card .nf-input::placeholder {
	color: #8c99b0;
	opacity: 1;
}

.nf-card .nf-input:hover {
	border-color: #c6d2e6;
}

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

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

.nf-card .nf-select {
	padding-right: 40px;
	cursor: pointer;
	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='%235b6b86' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 15px center;
}

.nf-card .nf-select:invalid,
.nf-card .nf-select:has(option[value=""]:checked) {
	color: #8c99b0;
}

.nf-card .nf-select option {
	color: var(--nf-ink);
}

/* Radio and checkbox groups */

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

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

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

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

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

/* Turnstile */

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

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

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

.nf-card .nf-consent-line {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--nf-muted);
	cursor: pointer;
}

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

.nf-card .nf-consent-line a {
	margin-left: 0.15em;
	color: var(--nf-link);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.nf-card .nf-consent-line a:hover {
	color: var(--nf-primary);
}

/* Button */

.nf-card button.nf-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 50px;
	margin-top: 2px;
	padding: 14px 26px;
	font-family: var(--nf-font-heading, 'Manrope'), 'Manrope', 'Segoe UI', Arial, sans-serif;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: #ffffff;
	background: var(--nf-button, var(--nf-primary));
	border: none;
	border-radius: var(--nf-button-radius);
	cursor: pointer;
	transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.nf-card button.nf-button:hover {
	color: #ffffff;
	background: var(--nf-button-hover, var(--nf-primary-hover));
	box-shadow: 0 10px 22px -14px var(--nf-button-shadow);
}

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

.nf-card button.nf-button:focus-visible {
	outline: 3px solid var(--nf-ring);
	outline-offset: 2px;
}

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

/* Status */

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

.nf-card .nf-status:empty {
	display: none;
}

.nf-card .nf-status.is-success {
	padding: 16px 18px;
	font-weight: 600;
	color: var(--nf-success);
	background: var(--nf-success-bg);
	border-left: 3px solid var(--nf-success-line, var(--nf-success));
	border-radius: var(--nf-field-radius);
}

.nf-card .nf-status.is-error {
	padding: 12px 14px;
	font-weight: 600;
	color: var(--nf-error);
	background: var(--nf-error-bg);
	border-left: 3px solid var(--nf-error);
	border-radius: var(--nf-field-radius);
}

/* Sent state */

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

.nf-card.is-sent .nf-status {
	margin-top: 0;
}

/* Mobile */

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

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

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

	.nf-card .nf-title {
		font-size: 22px;
	}
}

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

/* Submit button loading spinner */

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

.nf-card button.nf-button.is-loading::after {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 9px;
	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); }
}
