/* WP Secure Forms — base front-end styles (intentionally minimal; override via per-form CSS) */

.wpsf-form-wrap {
	width: 100%;
	box-sizing: border-box;
	padding-top: 20px;
	padding-bottom: 20px;

	/* Styling tokens — overridden by the Settings → Form Styling panel. */
	--wpsf-accent: #2271b1;
	--wpsf-button-text: #ffffff;
	--wpsf-button-radius: 5px;
	--wpsf-field-bg: #eaeef2;
	--wpsf-field-text: #1c1c1c;
	--wpsf-field-radius: 5px;
	--wpsf-field-border: none;
	--wpsf-placeholder: #242424;
	--wpsf-label-weight: 600;
	--wpsf-font-size: 16px;
	--wpsf-field-gap: 18px;
}

.wpsf-form-desc {
	margin-bottom: 18px;
}

.wpsf-fields {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	margin: 0 -9px; /* gutter for column padding */
}

.wpsf-fields > .wpsf-field {
	box-sizing: border-box;
	padding: 0 9px;
	margin-bottom: var(--wpsf-field-gap);
	flex-basis: 100%;
}

/* Conditionally hidden fields / elements (also the submit button wrapper). */
.wpsf-cond-hidden {
	display: none !important;
}

/* Section break */
.wpsf-section {
	border-top: 1px solid #e3e3e3;
	padding-top: 14px;
	margin-top: 4px;
}
.wpsf-section-title {
	margin: 0 0 4px;
}
.wpsf-section-desc {
	color: #555;
}

/* Address composite */
.wpsf-address {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.wpsf-address .wpsf-addr-street,
.wpsf-address .wpsf-addr-line2 {
	grid-column: 1 / -1;
}

/* List field */
.wpsf-list-row {
	display: flex;
	gap: 6px;
	margin-bottom: 6px;
}
.wpsf-list-row input {
	flex: 1;
}
.wpsf-list-add,
.wpsf-list-del {
	width: 32px;
	border: 1px solid #ccc;
	background: #f6f7f7;
	border-radius: 4px;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}
.wpsf-list-add:hover,
.wpsf-list-del:hover {
	background: #e8e8e8;
}

/* Multi-select */
.wpsf-field-multiselect select[multiple] {
	min-height: 120px;
}

/* Tablet / narrow desktop (641–980px): collapse multi-column rows to two-up.
   Anything up to a half-width stays as halves; wider-than-half goes full.
   Scoped to a min-width so it never overlaps (and gets out-specificity'd by)
   the phone rule below. */
@media ( min-width: 641px ) and ( max-width: 980px ) {
	.wpsf-fields > .wpsf-field.wpsf-w-1,
	.wpsf-fields > .wpsf-field.wpsf-w-2,
	.wpsf-fields > .wpsf-field.wpsf-w-3,
	.wpsf-fields > .wpsf-field.wpsf-w-4,
	.wpsf-fields > .wpsf-field.wpsf-w-5,
	.wpsf-fields > .wpsf-field.wpsf-w-6 {
		flex-basis: 50% !important;
	}
	.wpsf-fields > .wpsf-field.wpsf-w-7,
	.wpsf-fields > .wpsf-field.wpsf-w-8,
	.wpsf-fields > .wpsf-field.wpsf-w-9,
	.wpsf-fields > .wpsf-field.wpsf-w-10,
	.wpsf-fields > .wpsf-field.wpsf-w-11 {
		flex-basis: 100% !important;
	}
}

/* Phone (≤640px): every field stacks full width, regardless of its set width.
   Targets the width classes so it matches the tablet rule's specificity. */
@media ( max-width: 640px ) {
	.wpsf-fields > .wpsf-field,
	.wpsf-fields > .wpsf-field.wpsf-w-1,
	.wpsf-fields > .wpsf-field.wpsf-w-2,
	.wpsf-fields > .wpsf-field.wpsf-w-3,
	.wpsf-fields > .wpsf-field.wpsf-w-4,
	.wpsf-fields > .wpsf-field.wpsf-w-5,
	.wpsf-fields > .wpsf-field.wpsf-w-6,
	.wpsf-fields > .wpsf-field.wpsf-w-7,
	.wpsf-fields > .wpsf-field.wpsf-w-8,
	.wpsf-fields > .wpsf-field.wpsf-w-9,
	.wpsf-fields > .wpsf-field.wpsf-w-10,
	.wpsf-fields > .wpsf-field.wpsf-w-11,
	.wpsf-fields > .wpsf-field.wpsf-w-12 {
		flex-basis: 100% !important;
	}
	.wpsf-address {
		grid-template-columns: 1fr;
	}
}

.wpsf-field label {
	display: block;
	font-weight: var(--wpsf-label-weight);
	font-size: var(--wpsf-font-size);
	line-height: 1.5;
	color: var(--wpsf-field-text);
	padding-bottom: 5px;
}

.wpsf-field input[type="text"],
.wpsf-field input[type="email"],
.wpsf-field input[type="tel"],
.wpsf-field input[type="url"],
.wpsf-field input[type="date"],
.wpsf-field input[type="number"],
.wpsf-field select,
.wpsf-field textarea {
	width: 100%;
	padding: 15px;
	background-color: var(--wpsf-field-bg);
	border: var(--wpsf-field-border);
	border-radius: var(--wpsf-field-radius);
	color: var(--wpsf-field-text);
	font-size: var(--wpsf-font-size);
	line-height: 1.2;
	box-sizing: border-box;
}

.wpsf-field input::placeholder,
.wpsf-field textarea::placeholder {
	color: var(--wpsf-placeholder);
	opacity: 1;
}

.wpsf-field textarea {
	min-height: 120px;
}

/* Custom dropdown arrow (replaces the native one). */
.wpsf-field select:not([multiple]) {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 40px;
	background-image: url("../select-arrow.svg");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 12px;
	cursor: pointer;
}

.wpsf-field select::-ms-expand {
	display: none;
}

.wpsf-name {
	display: flex;
	gap: 12px;
}

.wpsf-name input {
	flex: 1;
}

.wpsf-choices {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wpsf-choice,
.wpsf-consent {
	font-weight: 400 !important;
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.wpsf-req {
	color: #d63638;
	font-weight: var(--wpsf-label-weight);
}

/* Focus ring uses the accent color. */
.wpsf-field input:focus,
.wpsf-field select:focus,
.wpsf-field textarea:focus {
	outline: none;
	box-shadow: 0 0 0 2px var(--wpsf-accent);
}

.wpsf-field.has-error input,
.wpsf-field.has-error select,
.wpsf-field.has-error textarea,
.wpsf-field.has-error .wpsf-choices {
	border-color: #d63638;
	outline: 1px solid #d63638;
}

.wpsf-actions {
	margin-top: 20px;
	display: flex;
	align-items: center;
	gap: 14px;
}

.wpsf-submit {
	background: var(--wpsf-accent);
	color: var(--wpsf-button-text);
	border: 0;
	border-radius: var(--wpsf-button-radius);
	padding: 15px 45px;
	font-size: var(--wpsf-font-size);
	line-height: 1.2;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	height: auto;
}

.wpsf-submit:hover {
	opacity: 0.8;
}

.wpsf-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.wpsf-spinner {
	color: #555;
	font-style: italic;
}

.wpsf-message {
	margin-top: 14px;
}

.wpsf-message-error {
	color: #d63638;
}

.wpsf-confirmation {
	padding: 18px;
	background: #eef7f0;
	border: 1px solid #b7dcc2;
	border-radius: 6px;
}

.wpsf-notice {
	padding: 12px 14px;
	border-radius: 6px;
}

.wpsf-notice-error {
	background: #fcf0f1;
	border: 1px solid #d63638;
}
