/* Forms popup. Uses palette variables from brand.css. */

html.by-pop-open { overflow: hidden; }
.by-pop { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.by-pop[hidden] { display: none; }
.by-pop *, .by-pop *:before, .by-pop *:after { box-sizing: border-box; }
.by-pop__backdrop { position: absolute; inset: 0; background: rgba(35, 12, 10, .72); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s; }
.by-pop.is-open .by-pop__backdrop { opacity: 1; }

.by-pop__dialog {
	position: relative; width: 100%; max-width: 820px; max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 22px; background: #fff;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .4); transform: translateY(24px) scale(.97); opacity: 0; transition: transform .35s cubic-bezier(.2, .8, .25, 1), opacity .3s;
}
.by-pop.is-open .by-pop__dialog { transform: none; opacity: 1; }

.by-pop__close {
	position: absolute; top: 14px; right: 14px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
	background: rgba(255, 255, 255, .18); color: #fff; font-size: 17px; line-height: 1; transition: background .2s, transform .2s;
}
.by-pop__close:hover, .by-pop__close:focus-visible { background: var(--by-saffron); transform: rotate(90deg); outline: none; }

.by-pop__head {
	position: relative; overflow: hidden; text-align: center; color: #fff; padding: 30px 30px 74px;
	background: linear-gradient(120deg, var(--by-saffron) 0%, var(--by-maroon) 55%, var(--by-maroon-night) 100%);
}
.by-pop__head:before { content: ""; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: rgba(251, 207, 5, .14); }
.by-pop__head:after { content: ""; position: absolute; left: -40px; bottom: -80px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.by-pop__emblem { position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%; display: block; margin: 0 auto 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.by-pop__kicker { position: relative; z-index: 1; display: block; color: var(--by-sun); font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.by-pop .by-pop__head h2 { position: relative; z-index: 1; color: #fff; font-size: 30px; font-weight: 800; margin: 0 0 4px; font-family: inherit; text-transform: none; letter-spacing: 0; }
.by-pop__head p { position: relative; z-index: 1; color: #fbe6d8; font-size: 15px; margin: 0; }

.by-pop__cards { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 0 26px; margin-top: -50px; }
.by-pop-card {
	display: flex; flex-direction: column; background: #fff; border-radius: 16px; overflow: hidden; text-decoration: none !important;
	border: 1px solid #f1e3d3; box-shadow: 0 12px 30px rgba(74, 27, 25, .14); transition: transform .3s, box-shadow .3s;
}
.by-pop-card:hover, .by-pop-card:focus-visible { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(74, 27, 25, .22); outline: none; }
.by-pop-card:focus-visible { box-shadow: 0 0 0 4px rgba(232, 82, 34, .35), 0 20px 40px rgba(74, 27, 25, .22); }
.by-pop-card__img { position: relative; display: block; height: 130px; background-size: cover; background-position: center; }
.by-pop-card__img:after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(52, 18, 16, .05) 0%, rgba(52, 18, 16, .55) 100%); }
.by-pop-card__icon {
	position: absolute; z-index: 1; left: 18px; bottom: -24px; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
	background: radial-gradient(circle at 35% 30%, var(--by-sun), var(--by-gold)); color: var(--by-maroon); font-size: 22px; border: 3px solid #fff;
	box-shadow: 0 6px 16px rgba(52, 18, 16, .3);
}
.by-pop-card__body { display: flex; flex-direction: column; gap: 6px; padding: 32px 20px 20px; flex: 1; }
.by-pop-card__tag { align-self: flex-start; background: var(--by-cream); color: var(--by-saffron); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.by-pop-card__title { color: var(--by-maroon); font-size: 19px; font-weight: 800; line-height: 1.4; }
.by-pop-card__text { color: #6b544d; font-size: 14px; line-height: 1.65; }
.by-pop-card__btn {
	margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 30px;
	background: var(--by-saffron); color: #fff; font-weight: 800; font-size: 14.5px; transition: background .25s, gap .25s;
}
.by-pop-card:hover .by-pop-card__btn { background: var(--by-maroon); gap: 12px; }

.by-pop__later {
	display: block; margin: 18px auto 22px; border: 0; background: none; cursor: pointer; color: #9a7d72; font-size: 14px; font-weight: 600; text-decoration: underline;
}
.by-pop__later:hover { color: var(--by-maroon); }

@media (max-width: 640px) {
	.by-pop { padding: 12px; align-items: flex-end; }
	.by-pop__dialog { border-radius: 20px; max-height: calc(100vh - 24px); }
	.by-pop__head { padding: 24px 20px 62px; }
	.by-pop .by-pop__head h2 { font-size: 24px; }
	.by-pop__emblem { width: 52px; height: 52px; }
	.by-pop__cards { grid-template-columns: 1fr; gap: 14px; padding: 0 14px; margin-top: -40px; }
	.by-pop-card { flex-direction: row; }
	.by-pop-card__img { width: 96px; height: auto; flex: 0 0 96px; }
	.by-pop-card__icon { left: auto; right: -20px; bottom: auto; top: 14px; width: 40px; height: 40px; font-size: 17px; }
	.by-pop-card__body { padding: 14px 14px 14px 30px; gap: 4px; }
	.by-pop-card__title { font-size: 16px; }
	.by-pop-card__text { display: none; }
	.by-pop-card__btn { padding: 7px 14px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
	.by-pop__dialog, .by-pop__backdrop, .by-pop-card { transition: none; }
}
.by-pop__close { padding: 0 !important; display: grid; place-items: center; min-width: 0; }
.by-pop__dialog:focus { outline: none; }

/* Single form: narrower dialog, one wide card (image left, text right) */
.by-pop__dialog--single { max-width: 560px; }
.by-pop__dialog--single .by-pop__cards { grid-template-columns: 1fr; }
@media (min-width: 641px) {
	.by-pop__dialog--single .by-pop-card { flex-direction: row; }
	.by-pop__dialog--single .by-pop-card__img { width: 200px; flex: 0 0 200px; height: auto; min-height: 200px; }
	.by-pop__dialog--single .by-pop-card__icon { left: auto; right: -24px; bottom: auto; top: 20px; }
	.by-pop__dialog--single .by-pop-card__body { padding: 22px 22px 22px 40px; }
}
