/**
 * Boat Sales Hub — broker enquiry form.
 *
 * Every colour/radius comes from a CSS custom property set inline from the
 * admin appearance settings, so the form inherits the site's palette. Kept at
 * low specificity so a theme (or the Custom CSS box) can override anything.
 */

.rb-enquiry {
	--rbe-accent: #1c2d39;
	--rbe-accent-text: #fff;
	--rbe-text: #1c2d39;
	--rbe-border: #dfe3e6;
	--rbe-bg: #fff;
	--rbe-head-bg: #f5f7f9;
	--rbe-radius: 10px;

	/* Defaults; the shortcode's max_width / logo_width attributes override
	   these by setting the same properties inline. */
	--rbe-max-width: none;
	--rbe-logo-width: 120px;

	background: var(--rbe-bg);
	color: var(--rbe-text);
	border: 1px solid var(--rbe-border);
	border-radius: var(--rbe-radius);
	overflow: hidden;
	font-family: inherit;
	max-width: var(--rbe-max-width);
}

/* --- header --- */
.rbe-head {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 20px;
	background: var(--rbe-head-bg);
	border-bottom: 1px solid var(--rbe-border);
}

/* Broker logos arrive at wildly different aspect ratios, so the mark is
   bounded on BOTH axes and scaled inside that box — never cropped. Height is
   capped so a tall, narrow logo cannot stretch the header. */
.rbe-logo {
	flex: none;
	display: flex;
	align-items: center;
	max-width: var(--rbe-logo-width);
}

.rbe-logo img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 56px;
	object-fit: contain;
}

.rbe-head-text { display: flex; flex-direction: column; gap: 3px; }

.rbe-title { font-size: 1.15em; line-height: 1.25; }

.rbe-subtitle { font-size: .875em; opacity: .75; }

/* --- fields --- */
.rbe-form { padding: 20px; }

.rbe-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.rbe-field { display: block; margin-bottom: 14px; }

.rbe-field > span {
	display: block;
	margin-bottom: 5px;
	font-size: .9em;
	font-weight: 600;
}

.rbe-field input,
.rbe-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 11px 13px;
	border: 1px solid var(--rbe-border);
	border-radius: calc(var(--rbe-radius) - 3px);
	background: var(--rbe-bg);
	color: inherit;
	font: inherit;
}

.rbe-field textarea { resize: vertical; min-height: 110px; }

.rbe-field input:focus,
.rbe-field textarea:focus {
	outline: none;
	border-color: var(--rbe-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rbe-accent) 18%, transparent);
}

.rbe-field.is-invalid input,
.rbe-field.is-invalid textarea { border-color: #d63638; }

/* --- honeypot: hidden from people, still filled by bots --- */
.rbe-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.rbe-turnstile { margin: 4px 0 14px; }

/* --- actions --- */
.rbe-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.rbe-submit {
	padding: 13px 22px;
	border: 0;
	border-radius: calc(var(--rbe-radius) - 3px);
	background: var(--rbe-accent);
	color: var(--rbe-accent-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.rbe-submit:hover { filter: brightness(1.08); }
.rbe-submit[disabled] { opacity: .65; cursor: progress; }

.rbe-privacy { margin: 0; font-size: .85em; opacity: .7; flex: 1; min-width: 180px; }

/* --- result --- */
.rbe-message { margin: 14px 0 0; font-size: .92em; }
.rbe-message:empty { display: none; }
.rbe-message.is-error { color: #d63638; }
.rbe-message.is-success { color: #0f7a4f; }

.rb-enquiry.is-sent .rbe-row,
.rb-enquiry.is-sent .rbe-field,
.rb-enquiry.is-sent .rbe-actions,
.rb-enquiry.is-sent .rbe-turnstile { display: none; }

@media (max-width: 600px) {
	.rbe-row { grid-template-columns: 1fr; gap: 0; }
}
