/* WS Form retheme via the plugin's own `--wsf-*` variables (docs/integrations.md). */

.wsf-form {
	--wsf-form-color-base: var(--wp--preset--color--ink);
	--wsf-form-color-base-contrast: var(--wp--preset--color--white);
	--wsf-form-color-primary: var(--wp--preset--color--ink);
	--wsf-form-color-accent: var(--wp--preset--color--ink);
	--wsf-form-color-neutral: var(--wp--preset--color--border);
	--wsf-form-color-secondary: var(--wp--preset--color--muted);
	--wsf-form-color-success: #2e6b3a;

	--wsf-form-font-size: var(--wp--preset--font-size--regular);
	--wsf-form-font-size-small: var(--wp--preset--font-size--small);
	--wsf-form-font-size-large: var(--wp--preset--font-size--heading-5);
	--wsf-form-line-height: 1.4;
	--wsf-form-grid-gap: var(--wp--preset--spacing--sm);

	--wsf-section-legend-font-weight: 600;
	--wsf-section-legend-gap: 15px;

	--wsf-field-label-font-size: var(--wp--preset--font-size--small);
	--wsf-field-label-font-weight: 600;
	--wsf-field-label-gap: 8px;
	--wsf-field-help-color: var(--wp--preset--color--muted);
	--wsf-field-help-gap: 8px;
	--wsf-field-invalid-feedback-gap: 8px;

	--wsf-field-border-width: 2px;
	--wsf-field-border-color: var(--wp--preset--color--border);
	--wsf-field-border-color-hover: var(--wp--preset--color--ink);
	--wsf-field-border-color-focus: var(--wp--preset--color--ink);
	--wsf-field-border-radius: 15px;
	--wsf-field-padding-horizontal: 18px;
	--wsf-field-padding-vertical: 12px;
	--wsf-field-color-placeholder: var(--wp--preset--color--muted);
	--wsf-field-box-shadow-width-focus: 0px;

	--wsf-field-checkbox-border-radius: 6px;
	--wsf-field-checkbox-gap-horizontal: 12px;
	--wsf-field-radio-gap-horizontal: 12px;

	--wsf-field-button-width: auto;
	--wsf-field-button-border-radius: 9999px;
	--wsf-field-button-border-width: 2px;
	--wsf-field-button-padding-horizontal: 30px;
	--wsf-field-button-padding-vertical: 13px;
	--wsf-field-button-font-size: 1.25rem;
	--wsf-field-button-font-weight: 700;
	--wsf-field-button-line-height: 1.3;
	--wsf-field-button-primary-color-background-hover: #000;
	--wsf-field-button-primary-color-background-focus: #000;
	--wsf-field-button-primary-border-color-hover: #000;
	--wsf-field-button-primary-border-color-focus: #000;

	--wsf-field-message-success-color-background: var(--wp--preset--color--sand);
	--wsf-field-message-success-color: var(--wp--preset--color--ink);
	--wsf-field-message-success-border-color: var(--wp--preset--color--rule);
}

/* Legends are the form's own sub-headings; keep them in the prose rhythm
 * rather than the plugin's compact 10px gap above the first row. */
.wsf-form legend {
	margin-bottom: var(--wp--preset--spacing--xs);
}

.wsf-form .wsf-button {
	transition: background-color 150ms, border-color 150ms;
}

.wsf-form .wsf-button:active {
	transform: scale(0.97);
}

.wsf-form .wsf-section:not(:first-child) {
	margin-top: var(--wp--preset--spacing--xs);
}

/* Restores the site-wide offset focus ring; the selector depth is what it
 * takes to beat the plugin's per-input-type `outline: 0` (0,4,1). */
.wsf-form .wsf-fields .wsf-field-wrapper :is(.wsf-field, .wsf-button):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-text);
	outline-offset: 2px;
}
