/*
 * R12 + R25 (15 Oct): the one request form (js/request-form.js) and the
 * thank-you page (template-parts/thank-you.php).
 * Design: Lovable RequestForm.tsx and ThankYou.tsx.
 *
 * px, not rem: the site sets html{font-size:10px}. Scoped classes only (the
 * legacy bare-element rules outrank BEM, so every element states what it needs).
 * The button colour reads --sb-cta, which R32 owns; the fallback is today's orange.
 */
.sb-rf,
.sb-rf-dialog,
.sb-ty {
	--sb-rf-navy: #06038d;
	--sb-rf-accent: var(--sb-cta, #c24b14);
	--sb-rf-border: #e2e8f0;
	--sb-rf-muted: #64748b;
	--sb-rf-fg: #0f172a;
	--sb-rf-danger: #b91c1c;
	--sb-rf-success: #15803d;
	font-family: inherit;
	color: var(--sb-rf-fg);
}

/* ---- Form ---- */
.sb-rf { display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.4; }
.sb-rf__field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sb-rf__field--narrow { width: 160px; }
.sb-rf__grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .sb-rf__grid { grid-template-columns: 1fr 1fr; } }
.sb-rf__labelrow { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 8px; }
.sb-rf__label { font-size: 12px; font-weight: 500; margin: 0; padding: 0; color: var(--sb-rf-fg); }
.sb-rf__err { font-size: 12px; font-weight: 600; color: var(--sb-rf-danger); }
.sb-rf__input {
	display: block; width: 100%; box-sizing: border-box; min-height: 40px; margin: 0;
	border: 1px solid var(--sb-rf-border); border-radius: 6px; padding: 8px 12px;
	font-size: 16px; line-height: 1.4; background: #fff; color: var(--sb-rf-fg); box-shadow: none;
}
textarea.sb-rf__input { min-height: 96px; resize: vertical; }
.sb-rf__input:focus-visible { outline: 2px solid var(--sb-rf-navy); outline-offset: 1px; }
.sb-rf__input[aria-invalid="true"] { border-color: var(--sb-rf-danger); }
.sb-rf__fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.sb-rf__fieldset > legend { padding: 0; margin-bottom: 4px; }
.sb-rf__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-rf__chip {
	border: 1px solid var(--sb-rf-border); border-radius: 999px; padding: 4px 10px; margin: 0;
	font-size: 12px; line-height: 1.4; background: #fff; color: var(--sb-rf-fg); cursor: pointer;
	min-height: 32px; text-transform: none; letter-spacing: normal; font-weight: 400;
}
.sb-rf__chip:hover { border-color: rgb(6 3 141 / 0.5); }
.sb-rf__chip[aria-pressed="true"] { border-color: var(--sb-rf-navy); background: rgb(6 3 141 / 0.1); color: var(--sb-rf-navy); font-weight: 600; }
.sb-rf__chip:focus-visible { outline: 2px solid var(--sb-rf-navy); outline-offset: 2px; }
.sb-rf__consent { padding-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.sb-rf__consentlabel { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 400; margin: 0; }
.sb-rf__consentlabel a { color: var(--sb-rf-navy); text-decoration: underline; }
.sb-rf__check { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--sb-rf-navy); }
.sb-rf__fail { border: 1px solid rgb(185 28 28 / 0.3); background: rgb(185 28 28 / 0.08); color: var(--sb-rf-danger); border-radius: 6px; padding: 12px; font-size: 14px; }
.sb-rf__failLink { color: inherit; font-weight: 600; text-decoration: underline; }
/* Mobile: the button stays reachable above the keyboard. */
.sb-rf__actions { position: sticky; bottom: 0; background: #fff; padding-top: 4px; z-index: 1; }
.sb-rf__btn {
	display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 44px; margin: 0;
	border: 0; border-radius: 6px; background: var(--sb-rf-accent); color: #fff; font-size: 14px; font-weight: 600;
	cursor: pointer; text-transform: none; letter-spacing: normal;
}
.sb-rf__btn:hover { filter: brightness(0.95); }
.sb-rf__btn:disabled { opacity: 0.7; cursor: progress; }
.sb-rf__btn:focus-visible { outline: 2px solid var(--sb-rf-navy); outline-offset: 2px; }
.sb-rf__promise { text-align: center; font-size: 12px; color: var(--sb-rf-muted); margin: 0; }

/* Round 3: reCAPTCHA v2 (304x78), above the consent line. */
.sb-rf__captcha { display: flex; flex-direction: column; gap: 4px; min-height: 78px; }
.sb-rf__captcha-widget { min-height: 78px; }
.sb-rf__captcha-widget:focus { outline: none; }
@media (max-width: 380px) {
	.sb-rf__captcha-widget { transform: scale(0.85); transform-origin: 0 0; min-height: 66px; height: 66px; }
}

.sb-rf__hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.sb-rf { position: relative; }
.sb-rf-inline { max-width: 640px; }

/* ---- Dialog ---- */
.sb-rf-dialog {
	width: min(512px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto; box-sizing: border-box;
	border: 1px solid var(--sb-rf-border); border-radius: 8px; padding: 24px; background: #fff;
}
.sb-rf-dialog::backdrop { background: rgb(0 0 0 / 0.5); }
.sb-rf-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sb-rf-dialog__title { font-size: 18px; font-weight: 700; margin: 0; color: var(--sb-rf-fg); line-height: 1.3; }
.sb-rf-dialog__sub { font-size: 12px; color: var(--sb-rf-muted); margin: 4px 0 0; }
.sb-rf-dialog__close { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--sb-rf-muted); padding: 0 4px; }

/*
 * Owner feedback 20 Oct: "style the pop-up form like the rest". Aligned with the
 * site's other dialogs (Export CSV .sb-xg, the quote/sign-in dialog): navy title,
 * shadowed panel, small grey close, one input style. The legacy bare input rules
 * (#fcfcfc, 4px, grey text) beat .sb-rf__input on <input> but not on <textarea>,
 * which is why the two fields looked different; (0,2,0)+ selectors settle it.
 */
.sb-rf-dialog { border: 0; box-shadow: 0 10px 28px rgb(20 29 46 / 0.2); }
.sb-rf-dialog .sb-rf-dialog__title { font-size: 18px; color: var(--sb-rf-navy); }
.sb-rf-dialog .sb-rf-dialog__close {
	display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -4px -8px 0 0;
	padding: 0; border-radius: 4px; font-size: 20px; color: #6b7280;
}
.sb-rf-dialog .sb-rf-dialog__close:hover { background: #f1f3f6; color: var(--sb-rf-fg); }
.sb-rf .sb-rf__label { font-size: 12px; font-weight: 500; line-height: 1.45; color: #141d2e; border: 0; }
.sb-rf .sb-rf__fieldset > legend { width: auto; border: 0; margin-bottom: 4px; }
.sb-rf input.sb-rf__input,
.sb-rf textarea.sb-rf__input {
	min-height: 40px; height: auto; padding: 9px 12px; border: 1px solid #dce0e6; border-radius: 6px;
	background: #fff; color: var(--sb-rf-fg); font-family: inherit; font-size: 14px; font-weight: 400; line-height: 20px; box-shadow: none;
}
.sb-rf textarea.sb-rf__input { min-height: 88px; }
.sb-rf .sb-rf__input::placeholder { color: #8a94a6; opacity: 1; }
.sb-rf input.sb-rf__input:focus,
.sb-rf textarea.sb-rf__input:focus { border-color: var(--sb-rf-navy); outline: none; box-shadow: 0 0 0 3px rgb(6 3 141 / 0.12); }
.sb-rf .sb-rf__input[aria-invalid="true"] { border-color: var(--sb-rf-danger); }
/* Phones: 16px stops iOS zooming into the field. */
@media (max-width: 767px) {
	.sb-rf input.sb-rf__input,
	.sb-rf textarea.sb-rf__input { font-size: 16px; }
}
.sb-rf .sb-rf__chips { gap: 6px; }
.sb-rf .sb-rf__chip { min-height: 28px; padding: 3px 10px; font-size: 12px; border-color: #dce0e6; color: #141d2e; }
.sb-rf .sb-rf__chip:hover { border-color: rgb(6 3 141 / 0.5); background: #fff; color: var(--sb-rf-navy); }
.sb-rf .sb-rf__chip[aria-pressed="true"] { border-color: var(--sb-rf-navy); background: rgb(6 3 141 / 0.08); color: var(--sb-rf-navy); }
.sb-rf .sb-rf__field--narrow { width: 220px; max-width: 100%; }
.sb-rf .sb-rf__btn { height: 40px; }
.sb-rf .sb-rf__btn:hover { filter: none; }
/*
 * The sticky Send button: a sticky box stops at the scroller's padding edge, so
 * with the dialog's 24px bottom padding the fields peeked out beneath it. The
 * padding moves onto the form and the button sits flush with the dialog's edge.
 */
.sb-rf-dialog { padding-top: 0; padding-bottom: 0; }
.sb-rf-dialog .sb-rf { padding-bottom: 20px; }
.sb-rf-dialog .sb-rf__actions { bottom: 0; margin: 0 -24px; padding: 8px 24px 12px; border-top: 1px solid #eef0f3; }
/* Title and close stay put while the dialog scrolls (phones have no Esc key). */
.sb-rf-dialog .sb-rf-dialog__head { position: sticky; top: 0; z-index: 2; background: #fff; padding: 24px 0 12px; margin-bottom: 4px; }
.sb-rf-dialog .sb-rf-dialog__close { margin: -8px -12px 0 0; }
.sb-rf-dialog::backdrop { background: rgb(0 0 0 / 0.8); }
/* The subtitle already says it; one "we reply within one business day" is enough in the dialog. */
.sb-rf-dialog .sb-rf__promise { display: none; }

/* QC 20 Oct: the BB skin's button:focus / a:focus paint a dark-red fill; restate every focus state. */
.sb-rf .sb-rf__chip:not([aria-pressed="true"]):focus { background: #fff; color: #141d2e; }
.sb-rf .sb-rf__chip[aria-pressed="true"]:focus { background: rgb(6 3 141 / 0.08); color: var(--sb-rf-navy); }
.sb-rf-dialog .sb-rf-dialog__close,
.sb-rf-dialog .sb-rf-dialog__close:focus { background: transparent; color: #6b7280; }
.sb-rf-dialog .sb-rf-dialog__close:hover,
.sb-rf-dialog .sb-rf-dialog__close:focus-visible { outline: 2px solid var(--sb-rf-navy); outline-offset: 2px; background: #f1f3f6; color: var(--sb-rf-fg); }
.sb-rf-dialog .sb-rf-dialog__close:hover { outline: none; }
.sb-rf .sb-rf__btn,
.sb-rf .sb-rf__btn:focus { background: var(--sb-rf-accent); color: #fff; font-size: 14px; }
.sb-rf .sb-rf__btn:hover { background: #a83f10; }
.sb-rf input.sb-rf__input:focus,
.sb-rf textarea.sb-rf__input:focus { background: #fff; }
.sb-rf .sb-rf__consentlabel a:focus { color: var(--sb-rf-navy); background: transparent; }
.sb-rf .sb-rf__consentlabel a:focus-visible { outline: 2px solid var(--sb-rf-navy); outline-offset: 2px; }
/* Legacy ::placeholder !important rules (custom_style.css, style.css) reach the inline form. */
.sb-rf .sb-rf__input::placeholder { font-family: inherit !important; font-size: inherit !important; color: #8a94a6 !important; }

/* ---- Thank-you page ---- */
.sb-ty { max-width: 768px; margin: 0 auto; padding: 40px 16px; display: flex; flex-direction: column; gap: 24px; font-size: 14px; }
.sb-ty__head { display: flex; align-items: flex-start; gap: 12px; }
.sb-ty__tick { width: 28px; height: 28px; margin-top: 4px; flex: none; color: var(--sb-rf-success); }
.sb-ty__eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sb-rf-muted); margin: 0; }
.sb-ty__title { font-size: 30px; font-weight: 700; color: var(--sb-rf-navy); margin: 0; line-height: 1.2; }
.sb-ty__lede { font-size: 16px; margin: 4px 0 0; }
.sb-ty__card { border: 1px solid var(--sb-rf-border); border-radius: 8px; padding: 20px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.sb-ty__card--lots { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-color: rgb(21 128 61 / 0.3); background: rgb(21 128 61 / 0.05); }
.sb-ty__h2 { font-size: 16px; font-weight: 700; margin: 0; }
.sb-ty__dl { display: grid; gap: 8px; margin: 0; }
@media (min-width: 640px) { .sb-ty__dl { grid-template-columns: 140px 1fr; } }
.sb-ty__dl dt { color: var(--sb-rf-muted); margin: 0; }
.sb-ty__dl dd { margin: 0; }
.sb-ty__pre { white-space: pre-line; }
.sb-ty__muted { color: var(--sb-rf-muted); margin: 0; }
.sb-ty__copyrow { display: flex; align-items: center; gap: 8px; }
.sb-ty__copyval { user-select: all; font-weight: 600; color: var(--sb-rf-fg); text-decoration: underline; text-underline-offset: 2px; }
.sb-ty__copy { background: none; border: 0; border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; color: var(--sb-rf-navy); }
.sb-ty__copy:hover { background: rgb(6 3 141 / 0.06); }
.sb-ty__toast { font-size: 12px; color: var(--sb-rf-muted); margin: 0; min-height: 1em; }
.sb-ty__lots { font-weight: 600; margin: 0; }
.sb-ty__btn { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 6px; background: var(--sb-rf-accent); color: #fff; font-weight: 600; text-decoration: none; }
.sb-ty__btn:hover, .sb-ty__btn:focus { color: #fff; filter: brightness(0.95); }
