/**
 * Front-end styles. Deliberately tiny: the form's own theme owns the look,
 * this only styles the one element the plugin adds.
 */

.bhr-adjust-note {
	margin: .4em 0 0;
	padding: .4em .6em;
	font-size: .875em;
	line-height: 1.4;
	color: #6b4d05;
	background: #fdf6e3;
	border-left: 3px solid #d9a400;
	border-radius: 2px;
}

/* A calculated field the visitor cannot type into should not look typable. */
.gform_wrapper .gfield input[readonly].bhr-locked,
.gform_wrapper .gfield input[aria-readonly="true"] {
	background-color: #f2f2f2;
	cursor: default;
}

@media (prefers-reduced-motion: no-preference) {
	.bhr-adjust-note {
		animation: bhr-note-in 160ms ease-out;
	}

	@keyframes bhr-note-in {
		from { opacity: 0; transform: translateY(-2px); }
		to   { opacity: 1; transform: none; }
	}
}

/* ---------------------------------------------------------------------------
 * Legacy shortcodes
 * ------------------------------------------------------------------------- */

/*
 * The calculator is dropped into themes nobody has seen, so it cannot rely on
 * inheriting anything sane. Everything it needs is stated explicitly and
 * scoped under .bhr-calculator, and the selectors below are deliberately more
 * specific than a typical theme's bare element rules so they win without
 * !important. Themes that style inputs with their own class still override,
 * which is intended: that is the site owner's call, not ours.
 */
.bhr-calculator {
	--bhr-blue: #2678f0;
	--bhr-blue-light: #26bbf0;
	--bhr-ink: #222222;
	--bhr-border: #333333;

	box-sizing: border-box;
	max-width: 450px;
	margin: 0;
	padding: 0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: var(--bhr-calc-size, 0.8em);
	line-height: 1.4;
	color: var(--bhr-ink);
	text-align: left;
}

.bhr-calculator *,
.bhr-calculator *::before,
.bhr-calculator *::after { box-sizing: border-box; }

/* Themes love putting margins on p and label. */
.bhr-calculator p,
.bhr-calculator label,
.bhr-calculator div,
.bhr-calculator span { margin: 0; padding: 0; font-family: inherit; }

/*
 * Alignment.
 *
 * Three groups have to move together, and each needs a different property.
 *
 *  - text-align handles the heading, the result line, the contact block and
 *    the disclaimer.
 *  - The label/input rows and the button strip are flex containers, so they
 *    ignore text-align entirely. In the wide layout the row runs horizontally
 *    and justify-content moves its children. Below 600px the row turns into a
 *    column, which swaps the axes, and align-items moves them instead. Both
 *    are set, the second in the media query at the end of this file.
 *  - Labels get a shared min-width so the inputs still line up in a column
 *    once a row is packed together rather than spread apart.
 *
 * Every selector names both classes (.bhr-calculator.bhr-align-left) so it
 * outranks the .bhr-calculator .bhr-calculator-row base rules further down,
 * which it ties with on specificity and would otherwise lose to on order.
 */
.bhr-align-center { margin-left: auto; margin-right: auto; text-align: center; }
.bhr-align-right  { margin-left: auto; text-align: right; }

.bhr-calculator.bhr-align-left   .bhr-calculator-row { justify-content: flex-start; }
.bhr-calculator.bhr-align-center .bhr-calculator-row { justify-content: center; }
.bhr-calculator.bhr-align-right  .bhr-calculator-row { justify-content: flex-end; }

.bhr-calculator.bhr-align-left   .bhr-calculator-buttons { justify-content: flex-start; }
.bhr-calculator.bhr-align-center .bhr-calculator-buttons { justify-content: center; }
.bhr-calculator.bhr-align-right  .bhr-calculator-buttons { justify-content: flex-end; }

.bhr-calculator.bhr-align-left   .bhr-calculator-row label,
.bhr-calculator.bhr-align-center .bhr-calculator-row label,
.bhr-calculator.bhr-align-right  .bhr-calculator-row label { min-width: 10em; }

.bhr-calculator p.bhr-calculator-heading {
	font-size: 1.6em;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 .5em;
	color: var(--bhr-ink);
}

.bhr-calculator .bhr-calculator-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin: 0 0 .5em;
}

.bhr-calculator .bhr-calculator-row label {
	display: inline-block;
	width: auto;
	font-size: 1.25em;
	font-weight: 400;
	line-height: 1.3;
	color: inherit;
	text-transform: none;
	letter-spacing: normal;
}

/* Themes routinely force inputs to width:100%, their own border radius, a
   background image, and a min-height. All of it is overridden here. */
.bhr-calculator .bhr-calculator-row input[type="text"],
.bhr-calculator .bhr-calculator-row input {
	display: block;
	width: 12em;
	max-width: 12em;
	min-width: 0;
	min-height: 0;
	height: auto;
	margin: 0;
	padding: .2em .4em;
	font-family: inherit;
	font-size: 1.25em;
	line-height: 1.3;
	color: var(--bhr-ink);
	background: #ffffff;
	background-image: none;
	border: 2px solid var(--bhr-border);
	border-radius: 0;
	box-shadow: none;
	outline-offset: 2px;
	text-align: left;
	-webkit-appearance: none;
	appearance: none;
}

.bhr-calculator p.bhr-calculator-result {
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.3;
	margin: .75em 0;
}

/* The figure itself is the thing people look for, so it carries the brand
   blue while the label stays in the body colour. */
.bhr-calculator .bhr-calculator-amount { white-space: nowrap; color: var(--bhr-blue); }

.bhr-calculator .bhr-calculator-buttons {
	display: flex;
	align-items: center;
	gap: .5em;
	flex-wrap: wrap;
	margin: 1em 0;
}

.bhr-calculator .bhr-calculator-or { opacity: .7; }

.bhr-calculator .bhr-calculator-logo { margin: 0 0 .5em; }

/*
 * The only place this file uses !important, and only on the handful of
 * properties a theme's blanket img rule ruins outright. Plenty of themes ship
 * something like `img { max-width: 120px !important; border: 4px solid }` for
 * their own galleries, and a specificity war is not winnable against it.
 * Everything else here beats a theme on specificity alone.
 */
.bhr-calculator .bhr-calculator-logo img {
	display: block;
	width: 100%;
	max-width: 20rem !important;
	min-width: 0 !important;
	height: auto !important;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}
.bhr-align-center .bhr-calculator-logo img { margin-left: auto; margin-right: auto; }
.bhr-align-right  .bhr-calculator-logo img { margin-left: auto; }

.bhr-calculator p.bhr-calculator-contact {
	font-size: 1.2em;
	font-weight: 700;
	line-height: 1.3;
	margin: .75em 0;
}

.bhr-calculator a { text-decoration: none; }

.bhr-calculator .bhr-button,
.bhr-button {
	display: inline-block;
	box-sizing: border-box;
	width: auto;
	min-height: 0;
	margin: 0;
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
	padding: .7em 1.2em;
	font-size: 1em;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	color: #fff;
	background-image: linear-gradient(to bottom, #26bbf0, #2678f0);
	border: 0;
	border-radius: 3px;
	cursor: pointer;
}
.bhr-calculator .bhr-button:hover, .bhr-calculator .bhr-button:focus-visible,
.bhr-button:hover, .bhr-button:focus-visible { filter: brightness(1.08); color: #fff; }
.bhr-calculator .bhr-button-secondary,
.bhr-button-secondary { background-image: linear-gradient(to bottom, #8a93a5, #5d6677); }

.bhr-calculator .bhr-disclaimer { margin-top: 1em; }
.bhr-disclaimer { font-size: 10px; font-weight: 600; line-height: 1.35; margin-top: 1em; }
.bhr-dealer-ref { font-size: 9px; opacity: .7; }
.bhr-hint { font-size: .85em; font-weight: 400; opacity: .8; margin: .15em 0 0; }

/* --- quote result --------------------------------------------------------- */
.bhr-quote-lead { margin: 0 0 .2em; }
.bhr-quote-amount { font-size: 3.5rem; line-height: 1.1; font-weight: 700; color: #26bbf0; margin: .1em 0; }
.bhr-quote-term { font-size: 1.1rem; margin: 0 0 .2em; }
.bhr-quote-note { opacity: .8; }
.bhr-quote-breakdown { border-collapse: collapse; margin: 1em 0; }
.bhr-quote-breakdown th { text-align: left; padding: .25em 1.5em .25em 0; font-weight: 600; }
.bhr-quote-breakdown td { padding: .25em 0; }
.bhr-quote-errors { border-left: 4px solid #b32d2e; padding-left: 1em; }
.bhr-quote-cta { margin: 1.2em 0; }

/* --- card form ------------------------------------------------------------
 *
 * The showroom-facing generator. Same theme-proofing discipline as the
 * calculator: a theme cannot be trusted to leave inputs, labels, selects or
 * buttons alone, so every property that matters is stated explicitly, scoped
 * under .bhr-card-form and specific enough to beat a bare element rule
 * without reaching for !important.
 *
 * Two columns, because six fields in one tall stack is a lot of scrolling on
 * the one screen a salesperson uses while a customer waits.
 */
.bhr-card-form {
	--bhr-blue: #2678f0;
	--bhr-ink: #201f3a;
	--bhr-muted: #6e6c8a;
	--bhr-line: #d8d9e3;

	box-sizing: border-box;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.1em 1.25em;
	max-width: 40em;
	margin: 0;
	padding: 1.6em;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 1rem;
	line-height: 1.45;
	color: var(--bhr-ink);
	background: #ffffff;
	border: 1px solid var(--bhr-line);
	border-radius: 10px;
}

.bhr-card-form *,
.bhr-card-form *::before,
.bhr-card-form *::after { box-sizing: border-box; }

.bhr-card-form .bhr-card-form-row { margin: 0; padding: 0; min-width: 0; }
.bhr-card-form .bhr-card-form-actions { grid-column: 1 / -1; margin: .2em 0 0; }

.bhr-card-form .bhr-card-form-row label {
	display: block;
	width: auto;
	margin: 0 0 .35em;
	padding: 0;
	font-family: inherit;
	font-size: .82em;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--bhr-muted);
}

.bhr-card-form .bhr-card-form-row input,
.bhr-card-form .bhr-card-form-row select {
	display: block;
	width: 100%;
	max-width: none;
	min-width: 0;
	min-height: 0;
	height: auto;
	margin: 0;
	padding: .6em .7em;
	font-family: inherit;
	font-size: 1em;
	line-height: 1.3;
	color: var(--bhr-ink);
	background-color: #ffffff;
	background-image: none;
	border: 1px solid var(--bhr-line);
	border-radius: 6px;
	box-shadow: none;
	text-align: left;
	-webkit-appearance: none;
	appearance: none;
}

/* appearance:none takes the select's arrow with it, so draw one back. */
.bhr-card-form .bhr-card-form-row select {
	padding-right: 2.2em;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236e6c8a' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .7em center;
	background-size: .72em;
}

.bhr-card-form .bhr-card-form-row input:focus-visible,
.bhr-card-form .bhr-card-form-row select:focus-visible {
	outline: 2px solid var(--bhr-blue);
	outline-offset: 1px;
	border-color: var(--bhr-blue);
}

.bhr-card-form .bhr-hint {
	margin: .35em 0 0;
	font-size: .8em;
	font-weight: 400;
	line-height: 1.35;
	color: var(--bhr-muted);
	opacity: 1;
}

.bhr-card-form .bhr-button { width: auto; padding: .85em 1.6em; font-size: 1em; }

/* One column before the fields get too narrow to read. */
@media (max-width: 560px) {
	.bhr-card-form { grid-template-columns: 1fr; padding: 1.2em; }
	.bhr-card-form .bhr-button { width: 100%; }
}

/* --- payment card --------------------------------------------------------- */
.bhr-card {
	/* border-box so the padding stays inside the border rather than widening
	   the card past whatever column it was dropped into. */
	box-sizing: border-box;
	padding: 2.75rem 2.25rem;
	text-align: center;
	background: #ffffff;
	border: 1px solid #d8d9e3;
	border-radius: 10px;
	font-family: 'Lucida Sans Unicode', 'Lucida Grande', sans-serif;
}

.bhr-card *,
.bhr-card *::before,
.bhr-card *::after { box-sizing: border-box; }
.bhr-card-headline { font-size: 2.6rem; font-weight: 700; margin: 0; }
.bhr-card-amount { font-size: 5rem; line-height: 1.2; font-weight: 700; color: #1B3F95; margin: 0; }
.bhr-card-permonth { display: block; font-size: 1.3rem; font-weight: 400; color: #333; }
.bhr-card-vehicle { font-size: 2rem; font-weight: 700; margin: .3em 0; }
.bhr-card-terms { font-size: 1.4rem; margin: .3em 0 1em; }
.bhr-card-logo img { max-width: 495px; width: 100%; height: auto; margin: 0 auto; display: block; }
.bhr-card-tagline { font-size: 1.4rem; color: #999; margin: .2em 0 1em; }
.bhr-card-tagline span { display: block; font-size: 1.1rem; }
.bhr-card-contact { font-size: 1.3rem; font-weight: 700; margin-bottom: 1em; }
.bhr-card-footnote { font-size: .78rem; line-height: 1.4; margin: .3em auto; max-width: 46rem; }
.bhr-card-empty { border: 1px dashed #bbb; }

.bhr-admin-note {
	border-left: 4px solid #d9a400;
	background: #fdf6e3;
	padding: .8em 1em;
	margin: 1em 0;
	font-size: .95em;
}

@media print {
	.no-print, .bhr-card-print { display: none !important; }
	.bhr-card { padding: 1.5rem 1.25rem; border-color: #999; border-radius: 0; }
	.bhr-card-amount { color: #1B3F95 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 600px) {
	.bhr-card { padding: 1.75rem 1.1rem; }

	/*
	 * Stacking swaps the flex axes, so align-items is now the horizontal
	 * control and the alignment has to be restated. These name .bhr-calculator
	 * so they beat the base rule's align-items: center, which used to centre
	 * the label and the input whatever the alignment said — that is why a
	 * left-aligned embed showed centred fields sitting above left-aligned
	 * buttons. Every published iframe size is under 600px, so this block is
	 * what the embeds actually use.
	 *
	 * The input keeps its 12em cap rather than filling the row, so there is
	 * something for the alignment to move.
	 */
	.bhr-calculator .bhr-calculator-row { flex-direction: column; align-items: flex-start; }
	.bhr-calculator.bhr-align-center .bhr-calculator-row { align-items: center; }
	.bhr-calculator.bhr-align-right  .bhr-calculator-row { align-items: flex-end; }

	.bhr-card-headline { font-size: 1.8rem; }
	.bhr-card-amount { font-size: 3rem; }
}
