/**
 * Contact Us form. Colors come from the theme's variables, with fallbacks so
 * the form still looks right under another theme.
 */

.bb-contact {
	--bbc-ink: var( --bounce-ink, #1d2330 );
	--bbc-muted: var( --bounce-muted, #5b6375 );
	--bbc-line: var( --bounce-line, #e3e6ee );
	--bbc-accent: var( --bounce-primary, #f4543c );
	--bbc-surface: var( --bounce-surface, #fff );

	max-width: 720px;
	margin: 32px 0 0;
	padding: 28px;
	border: 1px solid var( --bbc-line );
	border-radius: 18px;
	background: var( --bbc-surface );
	box-shadow: 0 10px 30px rgba( 29, 35, 48, 0.06 );
	scroll-margin-top: 110px;
}

.bb-contact-field {
	margin: 0 0 20px;
	min-width: 0;
}

.bb-contact-field label,
.bb-contact-field legend {
	display: block;
	margin: 0 0 8px;
	padding: 0;
	font-weight: 700;
	font-size: 0.95rem;
	color: var( --bbc-ink );
}

.bb-contact-optional {
	font-weight: 400;
	font-size: 0.85em;
	color: var( --bbc-muted );
}

.bb-contact-field input[type="text"],
.bb-contact-field input[type="email"],
.bb-contact-field input[type="tel"],
.bb-contact-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 2px solid var( --bbc-line );
	border-radius: 10px;
	background: var( --bounce-card, #fff );
	color: var( --bbc-ink );
	font: inherit;
	font-size: 1rem;
	transition: border-color 0.15s ease;
}

.bb-contact-field textarea {
	min-height: 150px;
	resize: vertical;
}

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

.bb-contact-field.has-error input,
.bb-contact-field.has-error textarea {
	border-color: #c62828;
}

.bb-contact-field-error {
	margin: 6px 0 0;
	color: #b3261e;
	font-size: 0.88rem;
	font-weight: 600;
}

.bb-contact-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 18px;
}

.bb-contact-times {
	border: 0;
	margin: 0 0 20px;
	padding: 0;
}

.bb-contact-radios {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Radio buttons styled as pill buttons; the real input stays for keyboards
 * and screen readers. */
.bb-contact-radio {
	position: relative;
	margin: 0 !important;
	font-weight: 600 !important;
	cursor: pointer;
}

.bb-contact-radio input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.bb-contact-radio span {
	display: inline-block;
	padding: 10px 16px;
	border: 2px solid var( --bbc-line );
	border-radius: 999px;
	background: var( --bounce-card, #fff );
	color: var( --bbc-ink );
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.bb-contact-radio:hover span {
	border-color: var( --bbc-accent );
}

.bb-contact-radio input:checked + span {
	border-color: var( --bbc-accent );
	background: var( --bbc-accent );
	color: #fff;
}

.bb-contact-radio input:focus-visible + span {
	outline: 3px solid var( --bbc-ink );
	outline-offset: 2px;
}

.bb-contact-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.bb-contact-submit {
	cursor: pointer;
	border: 0;
}

.bb-contact-note {
	margin: 14px 0 0;
	color: var( --bbc-muted );
	font-size: 0.92rem;
}

.bb-contact-note a {
	font-weight: 700;
	white-space: nowrap;
}

.bb-contact-sent,
.bb-contact-error {
	margin: 0 0 22px;
	padding: 16px 18px;
	border-radius: 12px;
	font-size: 0.98rem;
}

.bb-contact-sent {
	background: #e8f6ec;
	border: 1px solid #b7e0c3;
	color: #1d5c32;
}

.bb-contact-sent strong {
	display: block;
	font-size: 1.05rem;
}

.bb-contact-sent p {
	margin: 4px 0 0;
}

.bb-contact-error {
	background: #fdecea;
	border: 1px solid #f5c2bd;
	color: #8c1d18;
	font-weight: 600;
}

@media ( max-width: 640px ) {
	.bb-contact {
		padding: 20px 16px;
		border-radius: 14px;
	}

	.bb-contact-row {
		grid-template-columns: 1fr;
	}

	.bb-contact-submit {
		width: 100%;
		justify-content: center;
	}
}
