/* BMS website pages (the customer portal and the login page): page-change motion between pages, the three-tower skyline, and raised portal cards.
   Loaded by hooks.py web_include_css after bms_theme.css and bms_ui.css. Every colour comes from the palette tokens. */

/* Page changes between website pages are View Transitions (the browser animates the move from one page to the next, same origin). The keyframes are in
   bms_ui.css. Not for people who ask for reduced motion: the rule sits inside the media query, so for them there is no transition at all. */
@media (prefers-reduced-motion: no-preference) {
	@view-transition { navigation: auto; }
}
/* The navbar is the same on both pages: it stays put. A view-transition-name makes it its own stacking layer, so everything inside it (its open account dropdown, z-index 1000)
   is ordered only within that layer, and the page below it (the portal is positioned and isolated) would be painted over the whole layer: the dropdown stays visible but the
   page's transparent boxes take its clicks ("Switch To Desk" did nothing). The navbar's layer therefore sits at Bootstrap's sticky-navbar level, above the page and below the modals. */
.navbar { view-transition-name: bms-navbar; position: relative; z-index: 1020; }


/* ===== The skyline =================================================================================================
   Three towers in line-art, in two layers (teal, and navy; in dark the second layer takes the muted text colour, as navy would vanish), each a mask
   filled with a palette colour, at 10% (12% in dark). Decorative: it never sits behind text (it is placed beside the portal's title, above the
   dashboard cards, and along the bottom of the login page), it takes no pointer events, and it is hidden on a phone, where the title spans the width. */

:root {
	--bms-skyline-teal: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20600%20200'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M0%20198h600M30%20198V92h16V76h60v16h16v106M46%20110h6M66%20110h6M86%20110h6M106%20110h6M46%20134h6M66%20134h6M86%20134h6M106%20134h6M46%20158h6M66%20158h6M86%20158h6M106%20158h6M445%20198V118h14v-12h46v12h14v80M459%20134h5M477%20134h5M495%20134h5M459%20158h5M477%20158h5M495%20158h5M565%20198v-30h20v30'/%3E%3C/svg%3E");
	--bms-skyline-navy: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20600%20200'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M195%20198V60h22V44h90v16h22v138M262%2044V28h-6%20M262%2028V8M217%2080h8M241%2080h8M265%2080h8M289%2080h8M313%2080h8M217%20104h8M241%20104h8M265%20104h8M289%20104h8M313%20104h8M217%20128h8M241%20128h8M265%20128h8M289%20128h8M313%20128h8M217%20152h8M241%20152h8M265%20152h8M289%20152h8M313%20152h8M217%20176h8M241%20176h8M265%20176h8M289%20176h8M313%20176h8M206%20198v-16h12v16%20M297%20198v-16h12v16'/%3E%3C/svg%3E");
	--bms-skyline-opacity: 0.1;
	--bms-skyline-b: var(--bms-navy);
}
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) { --bms-skyline-opacity: 0.12; --bms-skyline-b: var(--bms-muted); } }
html[data-theme="dark"] { --bms-skyline-opacity: 0.12; --bms-skyline-b: var(--bms-muted); }

.bms-portal { position: relative; isolation: isolate; }
.bms-portal::before,
.bms-portal::after {
	content: "";
	position: absolute;
	z-index: -1;
	inset-block-start: 0;
	inset-inline-end: 0;
	width: min(540px, 60%);
	height: 220px;
	pointer-events: none;
	opacity: var(--bms-skyline-opacity);
	-webkit-mask: var(--bms-skyline-teal) right bottom / contain no-repeat;
	mask: var(--bms-skyline-teal) right bottom / contain no-repeat;
	background-color: var(--bms-primary);
}
.bms-portal::after {
	-webkit-mask-image: var(--bms-skyline-navy);
	mask-image: var(--bms-skyline-navy);
	background-color: var(--bms-skyline-b);
}
.bms-portal[dir="rtl"]::before, .bms-portal[dir="rtl"]::after { -webkit-mask-position: left bottom; mask-position: left bottom; }

body[data-path="login"] { isolation: isolate; }
body[data-path="login"]::before,
body[data-path="login"]::after {
	content: "";
	position: fixed;
	z-index: -1;
	inset-inline: 0;
	bottom: 0;
	height: min(44vh, 400px);
	pointer-events: none;
	opacity: var(--bms-skyline-opacity);
	-webkit-mask: var(--bms-skyline-teal) center bottom / min(1100px, 100%) auto no-repeat;
	mask: var(--bms-skyline-teal) center bottom / min(1100px, 100%) auto no-repeat;
	background-color: var(--bms-primary);
}
body[data-path="login"]::after {
	-webkit-mask-image: var(--bms-skyline-navy);
	mask-image: var(--bms-skyline-navy);
	background-color: var(--bms-skyline-b);
}
@media (max-width: 575.98px) { .bms-portal::before, .bms-portal::after { display: none; } }


/* ===== Raised portal cards ========================================================================================== */

.bms-portal .card,
.bms-portal .table-responsive,
.bms-portal .list-group {
	border-radius: var(--bms-radius);
	box-shadow: var(--bms-shadow-raised);
}
.bms-portal .table-responsive { border: 1px solid var(--bms-border); background-color: var(--bms-surface); }
.bms-portal .table-responsive .table { margin-bottom: 0; }
.bms-portal .table-responsive .table-bordered { border: 0; }
@media (prefers-reduced-motion: no-preference) { .bms-portal .card { transition: box-shadow 150ms ease; } .bms-portal .card:hover { box-shadow: var(--bms-shadow-raised-hover); } }
