/*
 * BBAG Leads: forms, the contact chooser, and the contact sheet.
 * Uses the theme's presets when present (Blue Box), with the same values as fallbacks.
 * Square corners, hairline rules, gold only on the primary action, cobalt for links and focus.
 */

:where(.bbag-form, .bbag-chooser, .bbag-sheet, .bbag-form-block, .bbag-chooser-block, .bbag-guide-download) {
	--bl-ink: var(--wp--preset--color--ink, #0b1f3a);
	--bl-navy: var(--wp--preset--color--navy, #1a3a6b);
	--bl-cobalt: var(--wp--preset--color--cobalt, #0e5c98);
	--bl-gold: var(--wp--preset--color--gold, #c5a253);
	--bl-gold-deep: var(--wp--preset--color--gold-deep, #b08e3e);
	--bl-ivory: var(--wp--preset--color--ivory, #f4f1ea);
	--bl-mist: var(--wp--preset--color--mist, #f3f5f8);
	--bl-paper: var(--wp--preset--color--paper, #fff);
	--bl-slate: var(--wp--preset--color--slate, #56606f);
	--bl-line: var(--wp--preset--color--line, #dde2ea);
	--bl-edge: #8a94a3; /* 3:1 against white, for field borders */
	--bl-danger: var(--wp--preset--color--danger, #b42318);
	--bl-success: var(--wp--preset--color--success, #1e6b45);
	--bl-display: var(--wp--preset--font-family--display, Georgia, "Times New Roman", serif);
	--bl-sans: var(--wp--preset--font-family--sans, system-ui, -apple-system, "Segoe UI", sans-serif);
	--bl-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	color: var(--bl-ink);
	font-family: var(--bl-sans);
}

.bbag-form *,
.bbag-chooser *,
.bbag-sheet * {
	box-sizing: border-box;
}

.bbag-icon {
	display: inline-block;
	flex: none;
	width: 1.5em;
	height: 1.5em;
	vertical-align: middle;
}

:is(.bbag-form, .bbag-chooser, .bbag-sheet) .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------- Block wrappers ---------- */

.bbag-form-block.is-style-card,
.bbag-form-block:not([class*="is-style-"]) {
	padding: clamp(20px, 4vw, 40px);
	background: var(--bl-paper);
	border: 1px solid var(--bl-line);
}

.bbag-form-block,
.bbag-chooser-block {
	max-width: 760px;
	margin-inline: auto;
}

.bbag-chooser-block.alignwide {
	max-width: 1100px;
}

/* ---------- Form ---------- */

.bbag-form {
	container-type: inline-size;
	scroll-margin-top: calc(var(--bluebox-header-h, 0px) + 16px);
	margin: 0;
}

.bbag-form__head {
	margin-bottom: 24px;
}

.bbag-form__title,
.bbag-chooser__title {
	margin: 0;
	font-family: var(--bl-display);
	font-size: var(--wp--preset--font-size--xl, clamp(1.625rem, 1.4rem + 1vw, 2.125rem)); /* the theme's small title */
	font-weight: 500;
	line-height: 1.18;
	letter-spacing: -0.01em;
	color: var(--bl-ink);
	outline: none;
}

.bbag-form__title::after,
.bbag-chooser__title::after {
	content: "";
	display: block;
	width: 64px;
	height: 2px;
	margin-top: 16px;
	background: var(--bl-gold);
}

.bbag-form__progress {
	display: flex;
	gap: 4px;
	margin-top: 20px;
}

.bbag-form__progress-step {
	flex: 1;
	height: 3px;
	background: var(--bl-line);
	transition: background-color 0.3s;
}

.bbag-form__progress-step.is-done {
	background: var(--bl-navy);
}

.bbag-form__progress-step.is-current {
	background: var(--bl-gold);
}

.bbag-form__count {
	margin: 8px 0 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bl-slate);
}

.bbag-form__step {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.bbag-form.is-ready .bbag-form__step:not([hidden]) {
	animation: bbag-in 0.28s var(--bl-ease);
}

.bbag-form__legend {
	float: left; /* Lets the legend sit inside the fieldset flow. */
	width: 100%;
	margin: 0 0 6px;
	padding: 0;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--bl-ink);
	outline: none;
}

.bbag-form__legend + * {
	clear: both;
}

.bbag-form__intro {
	clear: both;
	margin: 0 0 18px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--bl-slate);
}

.bbag-form__fields {
	clear: both;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px 16px;
	padding-top: 12px;
}

.bbag-field {
	grid-column: 1 / -1;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.bbag-field--half {
	grid-column: span 1;
}

@container (max-width: 479px) {
	.bbag-field--half {
		grid-column: 1 / -1;
	}
}

.bbag-field__label {
	display: block;
	margin: 0 0 7px;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--bl-ink);
}

.bbag-field__optional {
	font-weight: 400;
	color: var(--bl-slate);
}

.bbag-field :is(input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select, textarea) {
	display: block;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 12px 14px;
	font: 400 16px/1.4 var(--bl-sans); /* 16px keeps iOS from zooming in. */
	color: var(--bl-ink);
	background: var(--bl-paper);
	border: 1px solid var(--bl-edge);
	border-radius: 0;
	box-shadow: none;
	appearance: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.bbag-field textarea {
	min-height: 140px;
	resize: vertical;
}

.bbag-field select {
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230b1f3a' stroke-width='2'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	cursor: pointer;
}

.bbag-field ::placeholder {
	color: #6b7483;
	opacity: 1;
}

.bbag-field :is(input, select, textarea):hover {
	border-color: var(--bl-ink);
}

.bbag-field :is(input, select, textarea):focus-visible {
	border-color: var(--bl-cobalt);
	outline: 2px solid var(--bl-cobalt);
	outline-offset: 0;
}

.bbag-field.has-error :is(input, select, textarea) {
	border-color: var(--bl-danger);
}

.bbag-field__help {
	margin: 7px 0 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--bl-slate);
}

.bbag-field__error {
	display: flex;
	gap: 6px;
	margin: 7px 0 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--bl-danger);
}

.bbag-field__error[hidden] {
	display: none;
}

/* Choices: large, tappable options */

.bbag-choice > .bbag-field__label {
	float: left;
	width: 100%;
}

.bbag-choice__options {
	clear: both;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
	gap: 8px;
}

.bbag-choice.is-compact .bbag-choice__options {
	display: flex;
	flex-wrap: wrap;
}

.bbag-choice__option {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 52px;
	padding: 12px 14px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--bl-ink);
	background: var(--bl-paper);
	border: 1px solid var(--bl-edge);
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.bbag-choice.is-compact .bbag-choice__option {
	min-height: 46px;
	padding-block: 10px;
}

.bbag-choice__option.is-single {
	border: 0;
	padding: 4px 0;
	min-height: 0;
	align-items: flex-start;
}

.bbag-choice__option input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.bbag-choice__box {
	display: grid;
	place-items: center;
	flex: none;
	width: 22px;
	height: 22px;
	color: transparent;
	background: var(--bl-paper);
	border: 1.5px solid var(--bl-edge);
	transition: background-color 0.15s, border-color 0.15s;
}

/* The checkmark is drawn once here rather than repeated as an SVG in every option. */
input[type="checkbox"] + .bbag-choice__box::after {
	content: "";
	width: 15px;
	height: 15px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='square'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='square'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

input[type="radio"] + .bbag-choice__box {
	border-radius: 50%;
}

input[type="radio"]:checked + .bbag-choice__box {
	border: 7px solid var(--bl-ink);
}

input[type="checkbox"]:checked + .bbag-choice__box {
	color: var(--bl-paper);
	background: var(--bl-ink);
	border-color: var(--bl-ink);
}

.bbag-choice__option:hover {
	border-color: var(--bl-ink);
}

.bbag-choice__option:has(input:checked):not(.is-single) {
	background: var(--bl-ivory);
	border-color: var(--bl-ink);
	box-shadow: inset 0 0 0 1px var(--bl-ink);
}

.bbag-choice__option input:focus-visible + .bbag-choice__box {
	outline: 2px solid var(--bl-cobalt);
	outline-offset: 2px;
}

.bbag-choice__option:has(input:focus-visible):not(.is-single) {
	outline: 2px solid var(--bl-cobalt);
	outline-offset: 2px;
}

.bbag-choice__option:has(input:focus-visible) input:focus-visible + .bbag-choice__box {
	outline: none;
}

.bbag-field.has-error .bbag-choice__option:not(:has(input:checked)) {
	border-color: var(--bl-danger);
}

/* Photos */

.bbag-files__input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.bbag-files__pick {
	display: grid;
	justify-items: center;
	gap: 4px;
	padding: 26px 18px;
	text-align: center;
	background: var(--bl-mist);
	border: 1px dashed var(--bl-edge);
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
}

.bbag-files__pick .bbag-icon {
	width: 32px;
	height: 32px;
	margin-bottom: 4px;
	color: var(--bl-navy);
}

.bbag-files__pick:hover,
.bbag-files.is-dragover .bbag-files__pick {
	background: var(--bl-ivory);
	border-color: var(--bl-ink);
}

.bbag-files__input:focus-visible + .bbag-files__pick {
	outline: 2px solid var(--bl-cobalt);
	outline-offset: 2px;
}

.bbag-files__pick-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--bl-ink);
}

.bbag-files__pick-note {
	font-size: 14px;
	color: var(--bl-slate);
}

.bbag-files__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.bbag-files__list:empty {
	display: none;
}

.bbag-file {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--bl-mist);
	border: 1px solid var(--bl-line);
	animation: bbag-in 0.2s var(--bl-ease);
}

.bbag-file img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.2s;
}

.bbag-file__doc {
	display: grid;
	place-items: center;
	align-content: center;
	gap: 4px;
	height: 100%;
	padding: 8px;
	color: var(--bl-navy);
}

.bbag-file__name {
	max-width: 100%;
	overflow: hidden;
	font-size: 12px;
	color: var(--bl-slate);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bbag-file.is-queued img,
.bbag-file.is-uploading img {
	opacity: 0.55;
}

.bbag-file__bar {
	position: absolute;
	inset: auto 0 0;
	height: 4px;
	background: rgb(11 31 58 / 0.15);
}

.bbag-file__bar > span {
	display: block;
	height: 100%;
	background: var(--bl-gold);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.2s linear;
}

.bbag-file.is-done .bbag-file__bar,
.bbag-file.is-error .bbag-file__bar {
	display: none;
}

.bbag-file.is-error {
	border: 2px solid var(--bl-danger);
}

.bbag-file :is(.bbag-file__remove, .bbag-file__retry) {
	position: absolute;
	display: grid;
	place-items: center;
	margin: 0;
	padding: 0;
	color: var(--bl-paper);
	background: rgb(11 31 58 / 0.82);
	border: 0;
	border-radius: 0;
	cursor: pointer;
}

.bbag-file__remove {
	top: 0;
	right: 0;
	width: 32px;
	height: 32px;
}

.bbag-file__remove .bbag-icon {
	width: 18px;
	height: 18px;
}

.bbag-file__retry {
	inset: 50% auto auto 50%;
	width: 44px;
	height: 44px;
	transform: translate(-50%, -50%);
	background: var(--bl-danger);
}

.bbag-file__retry[hidden] {
	display: none;
}

.bbag-file :is(.bbag-file__remove, .bbag-file__retry):focus-visible {
	outline: 2px solid var(--bl-paper);
	outline-offset: -4px;
}

.bbag-files__status {
	min-height: 1.4em;
	margin: 8px 0 0;
	font-size: 14px;
	color: var(--bl-slate);
}

/* Navigation and sending */

.bbag-form__hp {
	position: absolute !important;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.bbag-form__turnstile:not(:empty) {
	margin-top: 18px;
}

.bbag-form__nav {
	clear: both;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 28px;
}

.bbag-form__back,
.bbag-chooser__back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 44px;
	margin: 0 auto 0 0;
	padding: 0 8px 0 0;
	font: 600 14px/1 var(--bl-sans);
	color: var(--bl-cobalt);
	background: none;
	border: 0;
	cursor: pointer;
}

.bbag-form__back .bbag-icon,
.bbag-chooser__back .bbag-icon {
	width: 20px;
	height: 20px;
}

.bbag-form__back:hover span,
.bbag-chooser__back:hover span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bbag-form__next,
.bbag-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 180px;
	min-height: 52px;
	margin: 0;
	padding: 14px 28px;
	font: 700 14px/1.2 var(--bl-sans); /* the theme's button label */
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bl-ink);
	background: var(--bl-gold);
	border: 0;
	border-radius: 0;
	cursor: pointer;
	transition: background-color 0.15s;
}

.bbag-form__next:hover,
.bbag-form__submit:hover {
	background: var(--bl-gold-deep);
}

:is(.bbag-form__next, .bbag-form__submit, .bbag-form__back, .bbag-chooser__back, .bbag-chooser__option, .bbag-sheet__close):focus-visible {
	outline: 2px solid var(--bl-cobalt);
	outline-offset: 3px;
}

.bbag-form__submit:disabled {
	cursor: progress;
	opacity: 0.75;
}

.bbag-form[aria-busy] .bbag-form__submit::before {
	content: "";
	width: 14px;
	height: 14px;
	margin-right: 10px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: bbag-spin 0.8s linear infinite;
}

@container (max-width: 479px) {
	.bbag-form__nav :is(.bbag-form__next, .bbag-form__submit) {
		flex: 1 1 100%;
		order: -1;
	}

	.bbag-form__nav .bbag-form__back {
		margin: 0 auto;
	}
}

.bbag-form__alert {
	margin: 18px 0 0;
	padding: 12px 14px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--bl-ink);
	background: #fdf1f0;
	border: 1px solid var(--bl-danger);
}

.bbag-form__alert[hidden] {
	display: none;
}

.bbag-form__privacy {
	margin: 20px 0 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--bl-slate);
}

.bbag-form__privacy a,
.bbag-chooser__direct a {
	color: var(--bl-cobalt);
}

/* Equal opportunity statement under job applications (Lead settings). */
.bbag-form__eoe {
	margin: 10px 0 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--bl-slate);
}

.bbag-form__done {
	padding: 12px 0 4px;
	text-align: center;
	animation: bbag-in 0.35s var(--bl-ease);
}

.bbag-form__done[hidden] {
	display: none;
}

.bbag-form__done-mark {
	display: inline-grid;
	place-items: center;
	width: 56px;
	height: 56px;
	color: var(--bl-paper);
	background: var(--bl-ink);
}

.bbag-form__done-mark .bbag-icon {
	width: 30px;
	height: 30px;
	stroke-width: 2;
}

.bbag-form__done-title {
	margin: 18px 0 8px;
	font-family: var(--bl-display);
	font-size: var(--wp--preset--font-size--xl, clamp(1.625rem, 1.4rem + 1vw, 2.125rem));
	font-weight: 500;
	line-height: 1.18;
	letter-spacing: -0.01em;
	outline: none;
}

.bbag-form__done-text {
	max-width: 46ch;
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.6;
	color: var(--bl-slate);
}

.bbag-form__noscript {
	padding: 12px 14px;
	background: var(--bl-ivory);
}

/* Newsletter: one line on wider screens */

.bbag-form--newsletter .bbag-form__step {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: end;
	gap: 0 10px;
}

.bbag-form--newsletter :is(.bbag-form__fields, .bbag-form__nav) {
	padding: 0;
	margin: 0;
}

.bbag-form--newsletter :is(.bbag-form__hp, .bbag-form__turnstile) {
	grid-column: 1 / -1;
}

.bbag-form--newsletter .bbag-form__submit {
	min-width: 0;
}

/* The button sits beside the field; the spam check takes its own row underneath. */
.bbag-form--newsletter .bbag-form__fields {
	grid-area: 1 / 1;
}

.bbag-form--newsletter .bbag-form__nav {
	grid-area: 1 / 2;
}

@container (max-width: 419px) {
	.bbag-form--newsletter .bbag-form__step {
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
	}

	.bbag-form--newsletter .bbag-form__nav {
		grid-area: 2 / 1;
	}
}

/* ---------- Chooser ---------- */

.bbag-chooser {
	container-type: inline-size;
	scroll-margin-top: calc(var(--bluebox-header-h, 0px) + 16px);
}

.bbag-chooser__intro {
	margin: 16px 0 0;
	font-size: 17px;
	line-height: 1.55;
	color: var(--bl-slate);
}

.bbag-chooser__options {
	display: grid;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--bl-line);
}

.bbag-chooser__options > li {
	margin: 0;
	border-bottom: 1px solid var(--bl-line);
}

.bbag-chooser__option {
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-areas: "icon label chev" "icon blurb chev";
	align-items: center;
	gap: 2px 16px;
	width: 100%;
	margin: 0;
	padding: 18px 4px;
	font: inherit; /* a button does not take the page's typeface by itself */
	text-align: left;
	color: var(--bl-ink);
	background: none;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	transition: background-color 0.15s;
}

.bbag-chooser__option:hover {
	background: var(--bl-ivory);
}

.bbag-chooser__icon {
	grid-area: icon;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	color: var(--bl-navy);
	border: 1px solid var(--bl-line);
}

.bbag-chooser__icon .bbag-icon {
	width: 26px;
	height: 26px;
}

.bbag-chooser__label {
	grid-area: label;
	align-self: end;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
}

.bbag-chooser__blurb {
	grid-area: blurb;
	align-self: start;
	font-size: 15px;
	line-height: 1.5;
	color: var(--bl-slate);
}

.bbag-chooser__chev {
	grid-area: chev;
	width: 20px;
	height: 20px;
	color: var(--bl-navy);
	transition: transform 0.2s var(--bl-ease);
}

.bbag-chooser__option:hover .bbag-chooser__chev {
	transform: translateX(3px);
}

@container (min-width: 720px) {
	.bbag-chooser.is-inline .bbag-chooser__options {
		grid-template-columns: repeat(3, 1fr);
		gap: 16px;
		border: 0;
	}

	.bbag-chooser.is-inline .bbag-chooser__options > li {
		border: 0;
	}

	.bbag-chooser.is-inline .bbag-chooser__option {
		grid-template-columns: 1fr auto;
		grid-template-areas: "icon icon" "label chev" "blurb blurb";
		align-content: start;
		gap: 8px;
		height: 100%;
		padding: 28px 24px;
		border: 1px solid var(--bl-line);
		background: var(--bl-paper);
	}

	.bbag-chooser.is-inline .bbag-chooser__option:hover {
		border-color: var(--bl-ink);
		background: var(--bl-paper);
	}

	.bbag-chooser.is-inline .bbag-chooser__icon {
		margin-bottom: 12px;
	}
}

.bbag-chooser__direct {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 18px;
	margin: 12px 0 0;
	font-size: 15px;
	color: var(--bl-slate);
}

.bbag-chooser__direct a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	font-weight: 600;
	text-decoration: none;
}

.bbag-chooser__direct a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.bbag-chooser__direct .bbag-icon {
	width: 18px;
	height: 18px;
}

.bbag-chooser__panel:not([hidden]) {
	animation: bbag-in 0.28s var(--bl-ease);
}

.bbag-chooser__back {
	margin-bottom: 12px;
}

/* ---------- Sheet: bottom sheet on phones, dialog on larger screens ---------- */

.bbag-sheet {
	position: fixed;
	inset: auto 0 0;
	width: 100%;
	max-width: 100%;
	height: auto;
	max-height: min(92dvh, calc(100% - 16px));
	margin: 0;
	padding: 0;
	overflow: hidden;
	color: var(--bl-ink);
	background: var(--bl-paper);
	border: 0;
	box-shadow: 0 -10px 40px rgb(11 31 58 / 0.2);
}

.bbag-sheet[open] {
	display: flex;
	flex-direction: column;
}

.bbag-sheet::backdrop {
	background: rgb(11 31 58 / 0.55);
}

html.bbag-sheet-open {
	overflow: hidden;
	scrollbar-gutter: stable;
}

.bbag-sheet__bar {
	position: relative;
	display: flex;
	flex: none;
	justify-content: flex-end;
	min-height: 52px;
	padding: 4px 6px 0;
	touch-action: none;
}

.bbag-sheet__handle {
	position: absolute;
	top: 9px;
	left: 50%;
	width: 44px;
	height: 4px;
	margin-left: -22px;
	background: var(--bl-line);
}

.bbag-sheet__close {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	color: var(--bl-ink);
	background: none;
	border: 0;
	border-radius: 0;
	cursor: pointer;
}

.bbag-sheet__close:hover {
	background: var(--bl-mist);
}

.bbag-sheet__body {
	flex: 1 1 auto;
	padding: 0 20px; /* No bottom padding: sticky step buttons must reach the bottom edge. */
	overflow-y: auto;
	overscroll-behavior: contain;
	scroll-padding-bottom: 96px;
}

.bbag-sheet__body > .bbag-chooser {
	padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.bbag-sheet .bbag-chooser__title {
	font-size: 28px;
}

.bbag-sheet .bbag-form__title {
	font-size: 28px;
}

/* Keep the step buttons in reach while scrolling a long step on a phone. */
.bbag-sheet .bbag-form__nav {
	position: sticky;
	bottom: 0;
	z-index: 1;
	margin-inline: -20px;
	padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
	background: var(--bl-paper);
	border-top: 1px solid var(--bl-line);
}

@media (min-width: 700px) {
	.bbag-sheet {
		inset: 0;
		width: min(680px, calc(100% - 48px));
		max-height: min(88vh, 920px);
		height: fit-content;
		margin: auto;
		box-shadow: 0 24px 80px rgb(11 31 58 / 0.3);
	}

	.bbag-sheet__handle {
		display: none;
	}

	.bbag-sheet__body {
		padding: 0 44px;
	}

	.bbag-sheet__body > .bbag-chooser {
		padding-bottom: 40px;
	}

	.bbag-sheet .bbag-form__nav {
		margin-inline: -44px;
		padding: 14px 44px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.bbag-sheet {
		transform: translateY(100%);
		transition: transform 0.34s var(--bl-ease), opacity 0.34s, overlay 0.34s allow-discrete, display 0.34s allow-discrete;
	}

	.bbag-sheet[open] {
		transform: none;
	}

	@starting-style {
		.bbag-sheet[open] {
			transform: translateY(100%);
		}
	}

	.bbag-sheet::backdrop {
		background: rgb(11 31 58 / 0);
		transition: background-color 0.34s, overlay 0.34s allow-discrete, display 0.34s allow-discrete;
	}

	.bbag-sheet[open]::backdrop {
		background: rgb(11 31 58 / 0.55);
	}

	@starting-style {
		.bbag-sheet[open]::backdrop {
			background: rgb(11 31 58 / 0);
		}
	}

	.bbag-sheet.is-dragging {
		transition: none;
	}

	@media (min-width: 700px) {
		.bbag-sheet {
			opacity: 0;
			transform: translateY(14px);
		}

		.bbag-sheet[open] {
			opacity: 1;
			transform: none;
		}

		@starting-style {
			.bbag-sheet[open] {
				opacity: 0;
				transform: translateY(14px);
			}
		}
	}
}

@keyframes bbag-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}

@keyframes bbag-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.bbag-form *,
	.bbag-chooser *,
	.bbag-sheet * {
		animation: none !important;
		transition: none !important;
	}
}

/* Editor previews are for layout only. */
.bbag-ssr-preview > * {
	pointer-events: none;
}

.is-style-plain > .bbag-ssr-preview .bbag-form-block {
	padding: 0;
	background: none;
	border: 0;
}

/* ---------- Guide download (a PDF offered by email) ---------- */

.bbag-guide-download {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	gap: clamp(24px, 4vw, 56px);
	align-items: start;
	max-width: 1100px;
	margin-inline: auto;
	padding: clamp(24px, 4vw, 48px);
	background: var(--bl-ivory);
	border-top: 3px solid var(--bl-gold);
}

.bbag-guide-download__kicker {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-ink, #7a5c16);
}

.bbag-guide-download__title {
	margin: 0;
	font-family: var(--bl-display);
	font-size: var(--wp--preset--font-size--xl, clamp(1.625rem, 1.4rem + 1vw, 2.125rem));
	font-weight: 500;
	line-height: 1.18;
	letter-spacing: -0.01em;
}

.bbag-guide-download__text {
	margin: 14px 0 0;
	font-size: 1.0625rem;
	line-height: 1.55;
	color: var(--bl-slate);
}

.bbag-guide-download__form .bbag-form {
	padding: clamp(18px, 3vw, 28px);
	background: var(--bl-paper);
	border: 1px solid var(--bl-line);
}

.bbag-guide-download__note {
	margin: 12px 0 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--bl-slate);
}

.bbag-guide-download__note a {
	color: var(--bl-cobalt);
}

@media (max-width: 781px) {
	.bbag-guide-download {
		grid-template-columns: minmax(0, 1fr);
	}
}

.bbag-form__download {
	margin-top: 18px;
}
