/* Brochure Gate popup – matches site palette (gold #988030 / #C9A673, Raleway + Playfair Display) */
#jbg-modal {
	--jbg-gold: #988030;
	--jbg-gold-2: #C9A673;
	--jbg-gold-3: #EEBA74;
	--jbg-ink: #141414;
	--jbg-text: #4D4D4D;
	--jbg-muted: #8a8a8a;
	--jbg-line: #dcd6c8;
	--jbg-bg: #ffffff;
	--jbg-head: "Playfair Display", Georgia, "Times New Roman", serif;
	--jbg-body: "Raleway", "Helvetica Neue", Arial, sans-serif;
}
.jbg-lock, .jbg-lock body { overflow: hidden !important; }

.jbg-modal { position: fixed; inset: 0; z-index: 999999; display: none; align-items: center; justify-content: center; padding: 16px; font-family: var(--jbg-body); }
.jbg-modal.is-open { display: flex; }
.jbg-modal *, .jbg-modal *::before, .jbg-modal *::after { box-sizing: border-box; }

.jbg-backdrop { position: absolute; inset: 0; background: rgba(10, 9, 6, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: jbgFade .3s ease; }

.jbg-box {
	position: relative; display: flex; width: 100%; max-width: 880px; max-height: calc(100vh - 32px);
	background: var(--jbg-bg); border-radius: 4px; overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
	animation: jbgIn .4s cubic-bezier(.2, .8, .2, 1);
}
.jbg-noimg .jbg-box { max-width: 500px; }

/* ---------- Left image panel ---------- */
.jbg-media {
	position: relative; flex: 0 0 42%; min-height: min(520px, calc(100vh - 32px));
	background-size: cover; background-position: center; color: #fff;
}
.jbg-media::before {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.35) 40%, rgba(12,10,5,.92) 100%);
}
.jbg-media::after { /* inner gold frame */
	content: ""; position: absolute; inset: 14px; border: 1px solid rgba(201, 166, 115, .45); pointer-events: none;
}
.jbg-media-inner { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 34px 38px; }
.jbg-eyebrow {
	display: inline-block; margin-bottom: 18px; padding-bottom: 8px;
	font-size: 11px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--jbg-gold-3);
	border-bottom: 1px solid rgba(238, 186, 116, .5);
}
.jbg-points { list-style: none; margin: 0; padding: 0; }
.jbg-points li {
	position: relative; padding: 7px 0 7px 22px; font-size: 14px; font-weight: 500; letter-spacing: .02em; color: rgba(255,255,255,.92);
}
.jbg-points li::before {
	content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 8px; margin-top: -4px;
	border: 1px solid var(--jbg-gold-2); transform: rotate(45deg);
}

/* ---------- Right form panel ---------- */
.jbg-panel { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; padding: 48px 46px 34px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* auto margins = vertical centering that never clips content when it overflows */
.jbg-panel > .jbg-head, .jbg-panel > .jbg-thanks { margin-top: auto; }
.jbg-panel > .jbg-privacy, .jbg-panel > .jbg-thanks { margin-bottom: auto; }
.jbg-box:focus { outline: none; }
.jbg-panel::before { /* gold accent bar */
	content: ""; position: absolute; top: 0; left: 46px; width: 56px; height: 3px; background: linear-gradient(90deg, var(--jbg-gold), var(--jbg-gold-2));
}

.jbg-close {
	position: absolute; top: 14px; right: 14px; z-index: 3; display: grid; place-items: center;
	width: 38px; height: 38px; padding: 0; border: 1px solid var(--jbg-line); border-radius: 50%;
	background: #fff; color: var(--jbg-ink); cursor: pointer; transition: all .25s ease;
}
.jbg-close:hover, .jbg-close:focus-visible { background: var(--jbg-ink); border-color: var(--jbg-ink); color: #fff; transform: rotate(90deg); }

.jbg-kicker {
	display: inline-flex; align-items: center; gap: 12px; margin-bottom: 14px;
	font-size: 11px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--jbg-gold);
}
.jbg-kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.jbg-title { margin: 0 0 10px; font-family: var(--jbg-head); font-size: 32px; font-weight: 500; line-height: 1.15; color: var(--jbg-ink); letter-spacing: 0; text-transform: none; }
.jbg-sub { margin: 0 0 28px; font-size: 14.5px; line-height: 1.6; color: var(--jbg-text); }

/* ---------- Built-in form: floating labels ---------- */
.jbg-row { display: flex; gap: 22px; }
.jbg-row .jbg-field { flex: 1; min-width: 0; }
.jbg-field { position: relative; margin: 0 0 22px; }
.jbg-field input {
	display: block; width: 100%; height: 48px; margin: 0; padding: 18px 0 6px;
	font: 500 15px/1.2 var(--jbg-body); color: var(--jbg-ink);
	background: transparent; border: 0; border-bottom: 1px solid var(--jbg-line); border-radius: 0; box-shadow: none; outline: none;
	transition: border-color .25s ease;
}
.jbg-field label {
	position: absolute; left: 0; top: 16px; margin: 0; font-size: 14px; font-weight: 500; color: var(--jbg-muted);
	pointer-events: none; transform-origin: left top; transition: transform .2s ease, color .2s ease;
}
.jbg-field::after { /* animated gold underline */
	content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: var(--jbg-gold);
	transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.jbg-field:focus-within::after { transform: scaleX(1); }
.jbg-field input:focus + label,
.jbg-field input:not(:placeholder-shown) + label { transform: translateY(-15px) scale(.78); color: var(--jbg-gold); letter-spacing: .04em; }
.jbg-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; -webkit-text-fill-color: var(--jbg-ink); }

.jbg-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.jbg-error { min-height: 18px; margin: -6px 0 10px; color: #b3261e; font-size: 13px; font-weight: 500; }

.jbg-submit,
.jbg-fluent .ff-btn-submit {
	position: relative; display: inline-flex !important; align-items: center; justify-content: center; gap: 10px;
	width: 100% !important; height: 54px; margin: 4px 0 0 !important; padding: 0 28px !important; overflow: hidden;
	font: 700 13px/1 var(--jbg-body) !important; letter-spacing: .2em !important; text-transform: uppercase !important;
	color: #fff !important; background: var(--jbg-ink) !important; border: 0 !important; border-radius: 2px !important;
	box-shadow: none !important; cursor: pointer; transition: color .3s ease, box-shadow .3s ease;
	z-index: 0;
}
.jbg-submit::before,
.jbg-fluent .ff-btn-submit::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(100deg, var(--jbg-gold) 0%, var(--jbg-gold-2) 100%);
	transform: scaleX(1); transform-origin: right; transition: transform .45s cubic-bezier(.7, 0, .2, 1);
}
.jbg-submit:hover::before,
.jbg-fluent .ff-btn-submit:hover::before { transform: scaleX(0); }
.jbg-submit:hover, .jbg-fluent .ff-btn-submit:hover { box-shadow: 0 12px 28px rgba(152, 128, 48, .35) !important; }
.jbg-submit svg { transition: transform .3s ease; }
.jbg-submit:hover svg { transform: translateY(2px); }
.jbg-submit:disabled, .jbg-fluent .ff-btn-submit:disabled { opacity: .75; cursor: wait; }

.jbg-privacy { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 0; font-size: 12px; color: var(--jbg-muted); }

/* ---------- Fluent Form overrides ---------- */
.jbg-fluent .fluentform, .jbg-fluent .frm-fluent-form { margin: 0; }
.jbg-fluent .ff-el-group { margin-bottom: 20px !important; }
.jbg-fluent .ff-t-container { gap: 22px; }
.jbg-fluent .ff-el-input--label { margin-bottom: 2px !important; }
.jbg-fluent .ff-el-input--label label {
	font: 600 11px/1.4 var(--jbg-body) !important; letter-spacing: .12em; text-transform: uppercase; color: var(--jbg-gold) !important;
}
.jbg-fluent .ff-el-form-control,
.jbg-fluent input[type="text"], .jbg-fluent input[type="email"], .jbg-fluent input[type="tel"], .jbg-fluent input[type="number"], .jbg-fluent textarea, .jbg-fluent select {
	width: 100% !important; height: 46px !important; padding: 10px 0 !important;
	font: 500 15px/1.3 var(--jbg-body) !important; color: var(--jbg-ink) !important;
	background: transparent !important; border: 0 !important; border-bottom: 1px solid var(--jbg-line) !important; border-radius: 0 !important;
	box-shadow: none !important; outline: none !important; transition: border-color .25s ease, box-shadow .25s ease !important;
}
.jbg-fluent textarea { height: 80px !important; }
.jbg-fluent .ff-el-form-control::placeholder, .jbg-fluent input::placeholder { color: var(--jbg-muted) !important; opacity: 1; }
.jbg-fluent .ff-el-form-control:focus, .jbg-fluent input:focus, .jbg-fluent textarea:focus {
	border-bottom-color: var(--jbg-gold) !important; box-shadow: 0 1px 0 0 var(--jbg-gold) !important;
}
.jbg-fluent .ff-el-is-error .ff-el-form-control { border-bottom-color: #b3261e !important; }
.jbg-fluent .error, .jbg-fluent .text-danger { font-size: 12px !important; color: #b3261e !important; margin-top: 4px; }
.jbg-fluent .ff_submit_btn_wrapper { margin-top: 6px; }
.jbg-fluent .ff-message-success { display: none !important; } /* we show our own thank-you */

/* ---------- Thank-you state ---------- */
.jbg-thanks { padding: 30px 0 10px; text-align: center; animation: jbgIn .4s ease; }
.jbg-check {
	display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 50%;
	color: #fff; background: linear-gradient(135deg, var(--jbg-gold), var(--jbg-gold-2));
	box-shadow: 0 0 0 8px rgba(201, 166, 115, .18);
}
.jbg-thanks .jbg-sub { margin-bottom: 20px; }
.jbg-manual { font-size: 13px; font-weight: 600; color: var(--jbg-gold) !important; text-decoration: underline; text-underline-offset: 3px; }
.jbg-modal.is-done .jbg-head,
.jbg-modal.is-done .jbg-form,
.jbg-modal.is-done .jbg-fluent,
.jbg-modal.is-done .jbg-privacy { display: none; }

@keyframes jbgIn { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes jbgFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
	.jbg-modal { align-items: flex-end; padding: 0; }
	.jbg-box { flex-direction: column; max-height: 94vh; max-height: 94dvh; border-radius: 14px 14px 0 0; animation-name: jbgUp; }
	.jbg-media { flex: 0 0 auto; min-height: 130px; }
	/* 16px stops iOS Safari from zooming into inputs */
	.jbg-field input, .jbg-fluent .ff-el-form-control,
	.jbg-fluent input[type="text"], .jbg-fluent input[type="email"], .jbg-fluent input[type="tel"], .jbg-fluent input[type="number"], .jbg-fluent textarea, .jbg-fluent select { font-size: 16px !important; }
	.jbg-kicker { letter-spacing: .2em; }
	.jbg-media::after { inset: 10px; }
	.jbg-media-inner { padding: 20px 22px; }
	.jbg-eyebrow { margin: 0; padding: 0; border: 0; }
	.jbg-points { display: none; }
	.jbg-panel { padding: 32px 22px calc(26px + env(safe-area-inset-bottom, 0px)); }
	.jbg-panel::before { left: 22px; }
	.jbg-close { top: 12px; right: 12px; background: rgba(255,255,255,.92); }
	.jbg-title { font-size: 26px; }
	.jbg-sub { margin-bottom: 20px; }
}
@media (max-width: 420px) {
	.jbg-row { flex-direction: column; gap: 0; }
	.jbg-fluent .ff-t-container { flex-direction: column; gap: 0; }
}
@media (max-width: 760px) and (max-height: 720px) {
	.jbg-media { min-height: 84px; }
	.jbg-media-inner { padding: 14px 20px; }
	.jbg-panel { padding-top: 24px; }
	.jbg-kicker { margin-bottom: 8px; }
	.jbg-title { font-size: 23px; margin-bottom: 6px; }
	.jbg-sub { font-size: 13.5px; margin-bottom: 12px; }
	.jbg-field { margin-bottom: 14px; }
	.jbg-fluent .ff-el-group { margin-bottom: 12px !important; }
	.jbg-submit, .jbg-fluent .ff-btn-submit { height: 50px; }
	.jbg-privacy { margin-top: 12px; }
}
@keyframes jbgUp { from { transform: translateY(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
	.jbg-modal *, .jbg-backdrop, .jbg-box { animation: none !important; transition: none !important; }
}
