/*BB9 page layout: the top bar, account menu, customer bar, unpaid bill pill and page width.
Used on every page through routing/views/Default/header.html and base.html.
Loaded after style.css, so these rules win over older ones. Values come from design.css.
The rules for using them are in docs/design-system.md.*/


/*Font for every page: Inter, set in design.css*/
body{
	font-family:var(--bb9-font);
}

/*Header picture, the same one as bb9.ai: behind the logo, and on the Login page behind the card and on its
left half. The dark colour shows while it loads*/
.logobar,
.login_layout,
.login_picture{
	background-color:var(--bb9-header-dark);
	background-image:url('../images/header-background.webp');
}

/*Top bar under the logo, on every page: routing/views/Default/header.html.
Values come from design.css*/
.topnav{
	display:flex;
	align-items:center;
	gap:var(--bb9-space-2);
	padding:0 var(--bb9-space-3) 0 var(--bb9-space-2);
	background:var(--bb9-surface);
	border-bottom:1px solid var(--bb9-line);
	font-family:var(--bb9-font);
	font-size:var(--bb9-text-base);
	line-height:1.4;
}
/*when the window is too narrow for all the links, they wrap onto another row, so every link stays in view*/
.topnav_links{
	display:flex;
	flex-wrap:wrap;
	align-items:center;
	flex:1;
	min-width:0;
}
.topnav_links a{
	position:relative;
	display:flex;
	align-items:center;
	gap:7px;
	padding:16px 14px;
	color:var(--bb9-muted);
	font-weight:var(--bb9-weight-medium);
	white-space:nowrap;
	transition:color .15s;
}
.topnav_links a:hover{
	color:var(--bb9-ink);
}
.topnav_links a.on{
	color:var(--bb9-ink);
	font-weight:var(--bb9-weight-bold);
}
.topnav_links a.on svg{
	color:var(--bb9-orange);
}
/*line under the open page*/
.topnav_links a.on::after{
	content:"";
	position:absolute;
	left:10px;
	right:10px;
	bottom:0;
	height:3px;
	border-radius:3px 3px 0 0;
	background:var(--bb9-gradient);
}
.topnav svg{
	width:18px;
	height:18px;
	flex:none;
	fill:none;
	stroke:currentColor;
	stroke-width:2;
	stroke-linecap:round;
	stroke-linejoin:round;
}
/*Takes up the width of the label in bold, so the links do not move
sideways when one of them becomes the open page and turns bold*/
.topnav_label{
	display:inline-flex;
	flex-direction:column;
	align-items:center;
}
.topnav_label::after{
	content:attr(data-label);
	font-weight:var(--bb9-weight-bold);
	height:0;
	overflow:hidden;
	visibility:hidden;
}
/*red count on Billing overview, filled in by assets/js/billing_attention.js*/
.topnav_badge{
	min-width:18px;
	padding:1px 6px;
	border-radius:var(--bb9-radius-pill);
	background:var(--bb9-red);
	color:var(--bb9-surface);
	font-size:11px;
	font-weight:var(--bb9-weight-bold);
	line-height:16px;
	text-align:center;
}
.topnav_login{
	padding:8px 14px;
	border-radius:var(--bb9-radius-md);
	color:var(--bb9-ink);
	font-weight:var(--bb9-weight-semibold);
}
.topnav_login:hover{
	background:var(--bb9-tile);
}

/*Account menu at the right of the top bar, opened by assets/js/account_menu.js*/
.account_menu{
	position:relative;
	flex:none;
}
.account_button{
	width:34px;
	height:34px;
	border:0;
	border-radius:50%;
	background:var(--bb9-amber);
	color:var(--bb9-ink);
	font-family:var(--bb9-font);
	font-size:var(--bb9-text-sm);
	font-weight:var(--bb9-weight-bold);
	cursor:pointer;
}
.account_button:hover,
.account_menu.open .account_button{
	box-shadow:0 0 0 3px var(--bb9-purple-light);
}
.account_dropdown{
	display:none;
	position:absolute;
	right:0;
	top:calc(100% + 8px);
	z-index:100;
	min-width:220px;
	padding:6px;
	background:var(--bb9-surface);
	border:1px solid var(--bb9-line);
	border-radius:var(--bb9-radius-lg);
	box-shadow:var(--bb9-shadow-lg);
}
.account_menu.open .account_dropdown{
	display:block;
}
.account_who{
	padding:10px;
	margin-bottom:4px;
	border-bottom:1px solid var(--bb9-line);
}
.account_who b{
	display:block;
	color:var(--bb9-ink);
}
.account_who small{
	color:var(--bb9-muted);
	font-size:var(--bb9-text-sm);
}
.account_dropdown a{
	display:block;
	padding:9px 10px;
	border-radius:var(--bb9-radius-md);
	color:var(--bb9-text);
}
.account_dropdown a:hover{
	background:var(--bb9-tile);
}
.account_dropdown a.account_logout{
	color:var(--bb9-red);
}

/*Second bar, for an admin looking at one customer's pages: a purple strip
with the customer's name, their pages and a link back to all accounts*/
/*Two set layouts, so it never wraps part-way: 900px and wider, one row (a long name is cut
short with "…"); narrower, two rows - the name and Back to all accounts, then the page links*/
.customerbar{
	display:flex;
	align-items:center;
	gap:var(--bb9-space-2) var(--bb9-space-4);
	padding:var(--bb9-space-2) var(--bb9-space-4);
	background:var(--bb9-purple-light);
	border-bottom:1px solid var(--bb9-purple-line);
	color:var(--bb9-purple-dark);
	font-family:var(--bb9-font);
	font-size:var(--bb9-text-sm);
	line-height:1.4;
}
.customerbar_who{
	display:flex;
	align-items:center;
	gap:var(--bb9-space-2);
	min-width:0;
	font-weight:var(--bb9-weight-semibold);
	white-space:nowrap;
}
.customerbar_name{
	overflow:hidden;
	text-overflow:ellipsis;
}
.customerbar_initials{
	flex:none;
	display:flex;
	align-items:center;
	justify-content:center;
	width:24px;
	height:24px;
	border-radius:50%;
	background:var(--bb9-purple);
	color:var(--bb9-surface);
	font-size:11px;
	font-weight:var(--bb9-weight-bold);
}
.customerbar_links{
	display:flex;
	flex:none;
	flex-wrap:wrap;
	gap:var(--bb9-space-1);
}
.customerbar_links a{
	display:block;
	padding:6px 12px;
	border-radius:var(--bb9-radius-pill);
	color:var(--bb9-purple-dark);
	font-weight:var(--bb9-weight-medium);
	white-space:nowrap;
}
.customerbar_links a:hover{
	background:var(--bb9-purple-wash);
}
.customerbar_links a.on{
	background:var(--bb9-purple);
	color:var(--bb9-surface);
	font-weight:var(--bb9-weight-semibold);
}
.customerbar_back{
	flex:none;
	margin-left:auto;
	color:var(--bb9-purple);
	font-weight:var(--bb9-weight-semibold);
	white-space:nowrap;
}
@media (max-width:899px){
	.customerbar{
		flex-wrap:wrap;
	}
	/*the page links on a row of their own, under the name and Back to all accounts*/
	.customerbar_links{
		flex:1 1 100%;
		order:1;
	}
	.customerbar_who{
		flex:1;
	}
}

/*Phones (and anything under 760px wide): the top bar as on the live site, every link in view.
No icons, smaller and closer links that wrap onto more rows, and no account circle:
its Referrals and Logout show as plain links at the end instead (.topnav_phone)*/
.topnav_phone{
	display:none;
}
@media (max-width:760px){
	.topnav{
		gap:var(--bb9-space-1);
		padding:var(--bb9-space-1) var(--bb9-space-2);
	}
	.topnav_links svg{
		display:none;
	}
	.topnav_links a{
		padding:9px 9px;
		font-size:var(--bb9-text-sm);
	}
	.topnav_links a.on::after{
		left:6px;
		right:6px;
		bottom:2px;
	}
	.topnav_phone{
		display:block;
	}
	.account_menu{
		display:none;
	}
	.customerbar{
		gap:var(--bb9-space-1) var(--bb9-space-3);
		padding:var(--bb9-space-2) var(--bb9-space-3);
	}
	.customerbar_links a{
		padding:5px 10px;
	}
}

/*Unpaid bill: red pill in the top bar, beside the account circle*/
.billing_pill{
	display:flex;
	align-items:center;
	gap:var(--bb9-space-2);
	flex:none;
	padding:4px 4px 4px 12px;
	border:1px solid var(--bb9-red-line);
	border-radius:var(--bb9-radius-pill);
	background:var(--bb9-red-light);
	color:var(--bb9-red-text);
	font-size:var(--bb9-text-sm);
	font-weight:var(--bb9-weight-semibold);
	white-space:nowrap;
	cursor:default;
}
.billing_pill input[type=submit]{
	padding:5px 12px;
	border:0;
	border-radius:var(--bb9-radius-pill);
	background:var(--bb9-red);
	color:var(--bb9-surface);
	font-family:var(--bb9-font);
	font-size:var(--bb9-text-sm);
	font-weight:var(--bb9-weight-semibold);
	cursor:pointer;
}

/*Every page's content: at most --bb9-page-width wide, in the middle of the window,
with --bb9-page-gutter of space on each side. Both are set in design.css.
flow-root keeps floated boxes inside it*/
.page_content{
	display:flow-root;
	box-sizing:border-box;
	max-width:calc(var(--bb9-page-width) + 2 * var(--bb9-page-gutter));
	margin:0 auto;
	padding:var(--bb9-space-6) var(--bb9-page-gutter) var(--bb9-space-10);
}
@media (max-width:600px){
	.page_content{
		padding:var(--bb9-space-4) var(--bb9-space-4) var(--bb9-space-8);
	}
}


/*Login page when logged out (routing/views/login.html): no top bar. A large white card sits on the
header picture. Its left half shows the header picture again, with the logos at the top; its right
half holds the login form. Phones show the logos above the card, and only the form half*/
.page_content:has(> .login_layout){
	max-width:none;
	padding:0;
}
/*the header picture (set at the top of this file) fills both boxes*/
.login_layout,
.login_picture{
	background-position:center;
	background-size:cover;
}
.login_layout{
	box-sizing:border-box;
	display:flex;
	flex-direction:column;
	justify-content:center;
	min-height:100vh;
	padding:var(--bb9-space-6);
}
.login_frame{
	box-sizing:border-box;
	display:grid;
	grid-template-columns:1fr 1fr;
	width:100%;
	max-width:var(--bb9-page-width);
	min-height:calc(100vh - 2 * var(--bb9-space-6));
	margin:0 auto;
	padding:10px;
	border-radius:var(--bb9-radius-xl);
	background:var(--bb9-surface);
	box-shadow:var(--bb9-shadow-lg);
}
/*the logos from the top bar*/
.login_logos{
	display:flex;
	align-items:center;
	gap:var(--bb9-space-4);
}
.login_logos img{
	display:block;
	height:30px;
}
.login_phone_logos{
	display:none;
}
/*left half: the header picture, logos at the top*/
.login_picture{
	display:flex;
	flex-direction:column;
	justify-content:space-between;
	gap:var(--bb9-space-10);
	padding:var(--bb9-space-8);
	border-radius:var(--bb9-radius-lg);
	color:var(--bb9-surface);
}
/*right half: the login form in the middle, without its own card edge*/
.login_side{
	display:flex;
	align-items:center;
	justify-content:center;
	padding:var(--bb9-space-10) var(--bb9-space-6);
}
.login_side .bb9_narrow{
	width:100%;
	margin:0;
}
.login_side .bb9_narrow > .bb9_card{
	padding:0;
	border:0;
	box-shadow:none;
}
.login_side .bb9_page_title{
	text-align:center;
}
@media (max-width:900px){
	/*logos at the top, the card in the middle of the space under them*/
	.login_layout{
		justify-content:flex-start;
		padding:var(--bb9-space-6) var(--bb9-space-4);
	}
	.login_phone_logos{
		display:block;
		margin-bottom:var(--bb9-space-6);
	}
	.login_frame{
		grid-template-columns:1fr;
		min-height:0;
		margin:auto 0;
	}
	.login_picture{
		display:none;
	}
	.login_side{
		padding:var(--bb9-space-8) var(--bb9-space-5);
	}
}


/*style.css hides .noprint when printing. That rule comes before this file, so it is repeated here*/
@media print {
	.noprint{
		display:none;
	}
}
