/* Survey Order Form — inherits fonts and colors from the active theme where possible. */
.sof-form {
	--sof-accent: #1f5f8b;
	--sof-border: #c9ced6;
	--sof-error: #b42318;
	/* A fixed, compact size: many themes use very large body text. */
	font-size: 15px;
	line-height: 1.45;
	/* Use the theme's wide width instead of its narrow reading column. */
	max-width: min(1040px, 100%) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.sof-section {
	border: 1px solid var(--sof-border);
	border-radius: 6px;
	padding: .75rem 1rem 1rem;
	margin: 0 0 1rem;
	min-width: 0;
	container-type: inline-size;
}

.sof-section > legend {
	font-weight: 700;
	font-size: 1.05em;
	padding: 0 .4rem;
}

/*
 * Columns follow each section's own width: 4 on wide screens, 2 on tablets,
 * 1 on phones. "wide" fields span 2 columns, "full" fields span the row.
 */
.sof-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: .65rem 1rem;
}

.sof-full {
	grid-column: 1 / -1;
}

@container (min-width: 460px) {
	.sof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sof-wide { grid-column: span 2; }
}

@container (min-width: 760px) {
	.sof-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Fields grouped with 'row' in fields.php: dates stay narrow, others take the rest. */
.sof-row {
	display: flex;
	flex-wrap: wrap;
	gap: .65rem 1rem;
}

.sof-row > .sof-field {
	flex: 1 1 200px;
	min-width: 0;
}

.sof-row > .sof-type-date {
	flex: 0 0 9.5rem;
}

.sof-row > .sof-narrow {
	flex: 0 0 7rem;
}

/* Bill To and Deliver To: the details only appear when "same as" is cleared. */
.sof-same-group:has(input[data-sof-same]:checked) .sof-if-different {
	display: none;
}

/* Selectable cards: quote or survey, guest or account. */
.sof-choices {
	display: grid;
	grid-template-columns: 1fr;
	gap: .65rem;
}

@container (min-width: 460px) {
	.sof-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.sof-choice {
	display: flex;
	gap: .55rem;
	align-items: flex-start;
	padding: .6rem .75rem;
	border: 1px solid var(--sof-border);
	border-radius: 6px;
	cursor: pointer;
	font-weight: normal;
}

.sof-choice:has(input:checked) {
	border-color: var(--sof-accent);
	box-shadow: inset 0 0 0 1px var(--sof-accent);
	background: #f3f8fc;
}

.sof-choice input {
	margin-top: .25rem;
}

.sof-choice strong,
.sof-choice small {
	display: block;
}

.sof-choice small {
	font-size: .9em;
	opacity: .8;
	margin-top: .1rem;
}

.sof-signin-link {
	margin-top: .6rem;
}

.sof-field fieldset {
	border: 0;
	padding: 0;
	margin: 0;
}

.sof-label {
	display: block;
	font-weight: 600;
	font-size: .93em;
	margin-bottom: .2rem;
	padding: 0;
}

.sof-req {
	color: var(--sof-error);
}

.sof-form input[type="text"],
.sof-form input[type="email"],
.sof-form input[type="tel"],
.sof-form input[type="number"],
.sof-form input[type="date"],
.sof-form select,
.sof-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: .4rem .55rem;
	border: 1px solid var(--sof-border);
	border-radius: 4px;
	font: inherit;
	background: #fff;
	color: inherit;
}

.sof-form textarea {
	min-height: 0;
	resize: vertical;
}

.sof-form input:focus,
.sof-form select:focus,
.sof-form textarea:focus {
	outline: 2px solid var(--sof-accent);
	outline-offset: 1px;
	border-color: var(--sof-accent);
}

.sof-options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: .25rem 1rem;
}

.sof-option {
	display: flex;
	gap: .5rem;
	align-items: baseline;
	font-weight: normal;
	cursor: pointer;
}

.sof-has-error input,
.sof-has-error select,
.sof-has-error textarea {
	border-color: var(--sof-error);
}

.sof-error-text {
	color: var(--sof-error);
	font-size: .9em;
	margin: .3rem 0 0;
}

.sof-notice {
	padding: .75rem 1rem;
	border-radius: 6px;
	margin: 0 0 1rem;
	border-left: 4px solid;
}

.sof-success { background: #ecfdf3; border-color: #12b76a; }
.sof-error   { background: #fef3f2; border-color: var(--sof-error); }

.sof-zelle {
	margin-top: .75rem;
	padding: .75rem 1rem;
	background: #fff;
	border: 1px solid #12b76a;
	border-radius: 6px;
}
.sof-zelle p { margin: 0 0 .5rem; }
.sof-zelle p:last-child { margin-bottom: 0; }

.sof-button {
	background: var(--sof-accent);
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: .65rem 1.75rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.sof-button:hover { filter: brightness(1.1); }

/* Honeypot field: hidden from people, visible to spam bots. */
.sof-hp {
	position: absolute !important;
	left: -9999px !important;
	height: 1px;
	overflow: hidden;
}

/* Customer accounts */
.sof-account-bar {
	background: #f3f6f9;
	border-radius: 6px;
	padding: .75rem 1rem;
	margin: 0 0 1.5rem;
}

.sof-help {
	font-size: .9em;
	opacity: .75;
	margin: .3rem 0 0;
}

.sof-signup-password {
	margin-top: 1rem;
	max-width: 760px;
}

/* Only show the username and password boxes once "create an account" is chosen. */
.sof-signup:not(:has(input[name="sof_create_account"][value="1"]:checked)) .sof-signup-password:not(.sof-has-error) {
	display: none;
}

.sof-form input[type="password"] {
	width: 100%;
	box-sizing: border-box;
	padding: .55rem .7rem;
	border: 1px solid var(--sof-border);
	border-radius: 4px;
	font: inherit;
}

.sof-account h2 {
	margin-top: 0;
	font-size: 1.2em;
}

.sof-account-columns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem;
}

@media (max-width: 760px) {
	.sof-account-columns { grid-template-columns: 1fr; }
}

.sof-account #loginform label {
	display: block;
	font-weight: 600;
	margin-bottom: .35rem;
}

.sof-account #loginform input[type="text"],
.sof-account #loginform input[type="password"] {
	width: 100%;
	box-sizing: border-box;
	padding: .55rem .7rem;
	border: 1px solid var(--sof-border);
	border-radius: 4px;
	font: inherit;
}

.sof-account #loginform .login-remember label {
	font-weight: normal;
}

.sof-account #loginform input[type="submit"] {
	background: var(--sof-accent);
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: .7rem 1.5rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.sof-orders {
	width: 100%;
	border-collapse: collapse;
	font-size: .95em;
}

.sof-orders th,
.sof-orders td {
	text-align: left;
	padding: .5rem .6rem;
	border-bottom: 1px solid var(--sof-border);
	vertical-align: top;
}

@media (max-width: 640px) {
	.sof-orders thead { display: none; }
	.sof-orders tr { display: block; padding: .5rem 0; border-bottom: 1px solid var(--sof-border); }
	.sof-orders td { display: block; border: 0; padding: .1rem 0; }
}

.sof-section-help {
	margin: 0 0 1rem;
}

.sof-save-option {
	margin-top: 1rem;
}

/* Multiple file upload list */
/* Address suggestions */
.sof-lookup {
	position: relative;
}

.sof-suggestions {
	position: absolute;
	z-index: 50;
	left: 0;
	right: 0;
	top: 100%;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
	background: #fff;
	color: #1d2327;
	border: 1px solid var(--sof-border);
	border-radius: 4px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
	max-height: 300px;
	overflow-y: auto;
}

.sof-suggestions li {
	padding: .55rem .75rem;
	cursor: pointer;
}

.sof-suggestions li.sof-active,
.sof-suggestions li[role="option"]:hover {
	background: #eaf2f8;
}

.sof-suggestions .sof-suggestions-hint {
	cursor: default;
	font-size: .85em;
	opacity: .7;
	border-top: 1px solid var(--sof-border);
}

.sof-lookup-status:empty {
	display: none;
}

.sof-lookup-status.sof-matched {
	color: #067647;
	opacity: 1;
}

/* Center the theme's page title on pages that show the order form or account page. */
body:has(.sof-form) .wp-block-post-title,
body:has(.sof-form) .entry-title {
	text-align: center;
}

/* Follow-up questions hidden until the answer that needs them is chosen. */
.sof-field[data-show-name][hidden] {
	display: none !important;
}

.sof-type-radio .sof-label {
	margin-bottom: .35rem;
}

/* Terms & Conditions agreement above the submit button. */
.sof-agree {
	align-items: flex-start;
	font-weight: 600;
}

.sof-agree input {
	margin-top: .3rem;
}

/* Zelle banner with its checkbox (field type 'check'). */
.sof-check-callout {
	color: #067647;
	background: #ecfdf3;
	border-left: 4px solid #12b76a;
	border-radius: 4px;
	padding: .5rem .75rem;
}
.sof-check-callout p {
	margin: 0 0 .35rem;
	font-weight: 600;
}
.sof-check-callout .sof-option + .sof-option {
	margin-top: .3rem;
}
.sof-check-callout .sof-option {
	color: inherit;
	align-items: flex-start;
}
.sof-check-callout input {
	margin-top: .25rem;
	accent-color: #12b76a;
}

/* Highlighted section note, e.g. the Zelle discount. */
.sof-help.sof-callout {
	opacity: 1;
	font-size: .95em;
	font-weight: 600;
	color: #067647;
	background: #ecfdf3;
	border-left: 4px solid #12b76a;
	border-radius: 4px;
	padding: .45rem .75rem;
}
