/*
 * Syspro Partner Directory Form
 * Defaults follow the Syspro 2026 brand. Every color, size and radius is a
 * custom property, so the Elementor widget can override it without fighting
 * selector specificity.
 */

/* ---------- Tokens: light (default) ---------- */
.spdf {
	--spdf-font: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
	--spdf-heading-font: "Roobert", "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
	--spdf-max-width: 880px;
	--spdf-row-gap: 24px;
	--spdf-col-gap: 24px;
	--spdf-actions-gap: 32px;
	--spdf-header-gap: 32px;
	--spdf-title-gap: 8px;

	--spdf-text: #061C22;
	--spdf-text-soft: rgba(6, 28, 34, 0.72);
	--spdf-surface: #FFFFFF;
	--spdf-stroke: #E1E1E1;
	--spdf-primary: #0031CA;
	--spdf-primary-hover: #002399;
	--spdf-accent: #74FFE0;
	--spdf-tint: #E3FFF9;

	--spdf-title-color: var(--spdf-text);
	--spdf-intro-color: var(--spdf-text-soft);
	--spdf-accent-bar: var(--spdf-accent);

	--spdf-label-color: var(--spdf-text);
	--spdf-label-gap: 8px;
	--spdf-required-color: var(--spdf-primary);

	--spdf-input-color: var(--spdf-text);
	--spdf-input-bg: #FFFFFF;
	--spdf-input-border: var(--spdf-stroke);
	--spdf-input-border-width: 1px;
	--spdf-input-radius: 4px;
	--spdf-input-height: 48px;
	--spdf-textarea-height: 280px;
	--spdf-placeholder: #9A9E9E;
	--spdf-input-border-hover: #CDD2D3;
	--spdf-input-bg-hover: var(--spdf-input-bg);
	--spdf-focus-border: var(--spdf-primary);
	--spdf-focus-bg: var(--spdf-input-bg);
	--spdf-focus-ring: var(--spdf-accent);
	--spdf-focus-ring-width: 2px;
	--spdf-focus-ring-offset: 2px;
	--spdf-select-arrow: var(--spdf-text);

	--spdf-check-cols-auto: 1;
	--spdf-check-gap: 8px;
	--spdf-check-size: 18px;
	--spdf-check-accent: var(--spdf-primary);
	--spdf-option-color: var(--spdf-text);
	--spdf-option-bg: #FFFFFF;
	--spdf-option-border: var(--spdf-stroke);
	--spdf-option-border-width: 1px;
	--spdf-option-radius: 4px;
	--spdf-option-bg-hover: #F5F6F6;
	--spdf-option-border-hover: #CDD2D3;
	--spdf-option-color-checked: var(--spdf-text);
	--spdf-option-bg-checked: var(--spdf-tint);
	--spdf-option-border-checked: var(--spdf-primary);

	--spdf-help-color: var(--spdf-text-soft);
	--spdf-counter-color: var(--spdf-text-soft);
	--spdf-counter-ok: #00B050;
	--spdf-counter-bad: #FF0000;

	--spdf-error-color: var(--spdf-text);
	--spdf-error-border: #FF0000;
	--spdf-error-bg: #FFF5F5;

	--spdf-btn-color: #FFFFFF;
	--spdf-btn-bg: var(--spdf-primary);
	--spdf-btn-border: var(--spdf-primary);
	--spdf-btn-border-width: 0px;
	--spdf-btn-color-hover: #FFFFFF;
	--spdf-btn-bg-hover: var(--spdf-primary-hover);
	--spdf-btn-border-hover: var(--spdf-primary-hover);
	--spdf-btn-radius: 4px;
	--spdf-btn-height: 48px;
	--spdf-btn-width: auto;
	--spdf-btn-align: flex-start;
	--spdf-btn-transition: 150ms;

	--spdf-msg-radius: 4px;
	--spdf-msg-border-width: 4px;
	--spdf-msg-ok-color: var(--spdf-text);
	--spdf-msg-ok-bg: #EBF9F1;
	--spdf-msg-ok-border: #00B050;
	--spdf-msg-err-color: var(--spdf-text);
	--spdf-msg-err-bg: #FFF5F5;
	--spdf-msg-err-border: #FF0000;
}

/* ---------- Tokens: dark ---------- */
.spdf.spdf--dark {
	--spdf-text: #FFFFFF;
	--spdf-text-soft: rgba(255, 255, 255, 0.76);
	--spdf-surface: #061C22;
	--spdf-stroke: #CDD2D3;
	--spdf-required-color: var(--spdf-accent);
	--spdf-input-bg: #000000;
	--spdf-input-border: rgba(205, 210, 211, 0.5);
	--spdf-input-border-hover: #CDD2D3;
	--spdf-focus-border: var(--spdf-accent);
	--spdf-option-bg: transparent;
	--spdf-option-border: rgba(205, 210, 211, 0.5);
	--spdf-option-bg-hover: rgba(116, 255, 224, 0.06);
	--spdf-option-border-hover: #CDD2D3;
	--spdf-option-bg-checked: rgba(116, 255, 224, 0.12);
	--spdf-option-border-checked: var(--spdf-accent);
	--spdf-check-accent: var(--spdf-accent);
	--spdf-error-bg: rgba(255, 0, 0, 0.1);
	--spdf-msg-ok-bg: rgba(0, 176, 80, 0.14);
	--spdf-msg-err-bg: rgba(255, 0, 0, 0.14);
}

@media (min-width: 640px) {
	.spdf { --spdf-check-cols-auto: 2; }
}
@media (min-width: 1024px) {
	.spdf { --spdf-check-cols-auto: 3; }
}

/* ---------- Container ---------- */
.spdf {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--spdf-max-width);
	margin: 0 auto;
	padding: 48px;
	background: var(--spdf-surface);
	border: 1px solid var(--spdf-stroke);
	border-radius: 8px;
	color: var(--spdf-text);
	font-family: var(--spdf-font);
	font-size: 16px;
	line-height: 1.5;
}
.spdf.spdf--dark { border-color: transparent; }
.spdf *,
.spdf *::before,
.spdf *::after { box-sizing: border-box; }

@media (max-width: 639px) {
	.spdf { padding: 24px 16px; }
}

.spdf .spdf-form { margin: 0; }

/* ---------- Header ---------- */
.spdf .spdf-header { margin: 0 0 var(--spdf-header-gap); }
.spdf.spdf--no-accent .spdf-header::before { display: none; }
.spdf .spdf-header::before {
	content: "";
	display: block;
	width: 48px;
	height: 4px;
	margin: 0 var(--spdf-header-mr, auto) 16px var(--spdf-header-ml, 0);
	background: var(--spdf-accent-bar);
	border-radius: 2px;
}
.spdf .spdf-title {
	margin: 0 0 var(--spdf-title-gap);
	padding: 0;
	color: var(--spdf-title-color);
	font-family: var(--spdf-heading-font);
	font-size: clamp(24px, 3vw, 32px);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-transform: none;
}
.spdf .spdf-intro {
	max-width: 64ch;
	margin: 0 var(--spdf-header-mr, auto) 0 var(--spdf-header-ml, 0);
	color: var(--spdf-intro-color);
	font-size: 16px;
	line-height: 1.6;
}

/* ---------- Grid ---------- */
.spdf .spdf-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--spdf-row-gap) var(--spdf-col-gap);
}
@media (min-width: 640px) {
	.spdf:not(.spdf--stacked) .spdf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.spdf:not(.spdf--stacked) .spdf-col-full { grid-column: 1 / -1; }
}

.spdf .spdf-field {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

/* ---------- Labels ---------- */
.spdf .spdf-label {
	display: block;
	float: none;
	width: auto;
	margin: 0 0 var(--spdf-label-gap);
	padding: 0;
	color: var(--spdf-label-color);
	font-family: var(--spdf-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	text-transform: none;
	letter-spacing: 0;
}
.spdf .spdf-required {
	margin-left: 2px;
	color: var(--spdf-required-color);
	font-weight: 600;
}
.spdf .spdf-sr-only,
.spdf .spdf-hp {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}
.spdf .spdf-hp { left: -9999px; }

/* ---------- Inputs ---------- */
.spdf .spdf-input {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: var(--spdf-input-height);
	margin: 0;
	padding: 12px 16px;
	color: var(--spdf-input-color);
	background-color: var(--spdf-input-bg);
	border: var(--spdf-input-border-width) solid var(--spdf-input-border);
	border-radius: var(--spdf-input-radius);
	box-shadow: none;
	font-family: var(--spdf-font);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 150ms ease-out, background-color 150ms ease-out, outline-color 150ms ease-out;
}
.spdf .spdf-input::placeholder { color: var(--spdf-placeholder); opacity: 1; }
.spdf .spdf-input:hover {
	border-color: var(--spdf-input-border-hover);
	background-color: var(--spdf-input-bg-hover);
}
.spdf .spdf-input:focus,
.spdf .spdf-input:focus-visible {
	border-color: var(--spdf-focus-border);
	background-color: var(--spdf-focus-bg);
	outline: var(--spdf-focus-ring-width) solid var(--spdf-focus-ring);
	outline-offset: var(--spdf-focus-ring-offset);
}

.spdf .spdf-textarea {
	min-height: 120px;
	resize: vertical;
}
.spdf [data-field="long_description"] .spdf-textarea { min-height: var(--spdf-textarea-height); }

/* Select */
.spdf .spdf-select-wrap { position: relative; }
.spdf .spdf-select-wrap::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 18px;
	width: 8px;
	height: 8px;
	margin-top: -6px;
	border-right: 2px solid var(--spdf-select-arrow);
	border-bottom: 2px solid var(--spdf-select-arrow);
	transform: rotate(45deg);
	pointer-events: none;
}
.spdf .spdf-select {
	padding-right: 48px;
	cursor: pointer;
	background-image: none;
	text-overflow: ellipsis;
}
.spdf .spdf-select option { color: #061C22; background: #FFFFFF; }

/* ---------- Checkbox tiles ---------- */
.spdf .spdf-options {
	display: grid;
	grid-template-columns: repeat(var(--spdf-check-cols, var(--spdf-check-cols-auto)), minmax(0, 1fr));
	gap: var(--spdf-check-gap);
}
.spdf .spdf-option {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	margin: 0;
	padding: 10px 14px;
	color: var(--spdf-option-color);
	background: var(--spdf-option-bg);
	border: var(--spdf-option-border-width) solid var(--spdf-option-border);
	border-radius: var(--spdf-option-radius);
	cursor: pointer;
	transition: border-color 150ms ease-out, background-color 150ms ease-out;
}
.spdf .spdf-option:hover {
	background: var(--spdf-option-bg-hover);
	border-color: var(--spdf-option-border-hover);
}
.spdf .spdf-option:has(.spdf-check:checked),
.spdf .spdf-option.is-checked {
	color: var(--spdf-option-color-checked);
	background: var(--spdf-option-bg-checked);
	border-color: var(--spdf-option-border-checked);
}
.spdf .spdf-option:has(.spdf-check:focus-visible) {
	outline: var(--spdf-focus-ring-width) solid var(--spdf-focus-ring);
	outline-offset: var(--spdf-focus-ring-offset);
}
.spdf .spdf-check {
	flex: 0 0 auto;
	width: var(--spdf-check-size);
	height: var(--spdf-check-size);
	margin: 0;
	accent-color: var(--spdf-check-accent);
	cursor: pointer;
}
.spdf .spdf-option-text {
	font-family: var(--spdf-font);
	font-size: 15px;
	line-height: 1.35;
}

/* ---------- Help, counter, error ---------- */
.spdf .spdf-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0 16px;
}
.spdf .spdf-meta .spdf-help { flex: 1 1 260px; }
.spdf .spdf-meta .spdf-counter { margin-left: auto; }

.spdf .spdf-help {
	margin: 8px 0 0;
	color: var(--spdf-help-color);
	font-size: 14px;
	line-height: 1.5;
}
.spdf .spdf-counter {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 8px 0 0;
	color: var(--spdf-counter-color);
	font-size: 14px;
	line-height: 1.5;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.spdf .spdf-counter::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--spdf-stroke);
}
.spdf .spdf-counter.is-ok::before { background: var(--spdf-counter-ok); }
.spdf .spdf-counter.is-bad::before { background: var(--spdf-counter-bad); }
.spdf .spdf-counter:empty { display: none; }

.spdf .spdf-error {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 8px 0 0;
	color: var(--spdf-error-color);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
}
.spdf .spdf-error::before {
	content: "!";
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	border-radius: 50%;
	background: var(--spdf-error-border);
	color: #FFFFFF;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}
.spdf .spdf-error[hidden] { display: none; }

.spdf .spdf-field--invalid .spdf-input,
.spdf .spdf-field--invalid .spdf-input:hover {
	border-color: var(--spdf-error-border);
	background-color: var(--spdf-error-bg);
}
.spdf .spdf-field--invalid .spdf-input:focus { border-color: var(--spdf-error-border); }
.spdf .spdf-field--invalid .spdf-option { border-color: var(--spdf-error-border); }

/* ---------- Button ---------- */
.spdf .spdf-actions {
	display: flex;
	justify-content: var(--spdf-btn-align);
	margin-top: var(--spdf-actions-gap);
}
.spdf .spdf-submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: var(--spdf-btn-width);
	min-height: var(--spdf-btn-height);
	margin: 0;
	padding: 12px 32px;
	color: var(--spdf-btn-color);
	background: var(--spdf-btn-bg);
	border: var(--spdf-btn-border-width) solid var(--spdf-btn-border);
	border-radius: var(--spdf-btn-radius);
	box-shadow: none;
	font-family: var(--spdf-font);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	text-transform: none;
	letter-spacing: 0;
	text-decoration: none;
	cursor: pointer;
	transition: color var(--spdf-btn-transition) ease-out, background-color var(--spdf-btn-transition) ease-out, border-color var(--spdf-btn-transition) ease-out, box-shadow var(--spdf-btn-transition) ease-out;
}
.spdf .spdf-submit:hover,
.spdf .spdf-submit:focus {
	color: var(--spdf-btn-color-hover);
	background: var(--spdf-btn-bg-hover);
	border-color: var(--spdf-btn-border-hover);
}
.spdf .spdf-submit:focus-visible {
	outline: var(--spdf-focus-ring-width) solid var(--spdf-focus-ring);
	outline-offset: var(--spdf-focus-ring-offset);
}
.spdf .spdf-submit[disabled] {
	cursor: progress;
	opacity: 0.72;
}
.spdf .spdf-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: spdf-spin 700ms linear infinite;
}
.spdf .is-sending .spdf-spinner { display: inline-block; }

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

/* ---------- Form messages ---------- */
.spdf .spdf-message {
	margin: 0 0 var(--spdf-row-gap);
	padding: 16px 20px;
	border-left: var(--spdf-msg-border-width) solid transparent;
	border-radius: var(--spdf-msg-radius);
	font-size: 16px;
	line-height: 1.5;
	outline: none;
}
.spdf .spdf-message[hidden] { display: none; }
.spdf .spdf-message--success {
	color: var(--spdf-msg-ok-color);
	background: var(--spdf-msg-ok-bg);
	border-left-color: var(--spdf-msg-ok-border);
}
.spdf .spdf-message--error {
	color: var(--spdf-msg-err-color);
	background: var(--spdf-msg-err-bg);
	border-left-color: var(--spdf-msg-err-border);
}
.spdf .spdf-form.is-complete .spdf-grid,
.spdf .spdf-form.is-complete .spdf-actions { display: none; }
.spdf .spdf-form.is-complete .spdf-message { margin-bottom: 0; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.spdf .spdf-input,
	.spdf .spdf-option,
	.spdf .spdf-submit { transition: none; }
	.spdf .spdf-spinner { animation-duration: 2s; }
}
