/*
 * SICP supplier portal (the logged-in pages in login/): a cleaner, wider look.
 *
 * Loaded only by login/header.htm, after the site-wide standardstyle.css and style.css, so it
 * overrides them for these pages only. CSS only: the markup (fixed 800px tables, background
 * images, bgcolor attributes) is unchanged; CSS takes precedence over those HTML attributes.
 */

:root {
	--brand: #1f5c99;
	--brand-dark: #174a7c;
	--brand-light: #eaf2fb;
	--text: #1f2933;
	--muted: #5f6b7a;
	--border: #dde3ea;
	--page-bg: #f2f5f8;
	--page-width: 1180px;
}

/* ------------------------------ Page ------------------------------ */

html {
	background: var(--page-bg);
}

body {
	margin: 0;
	padding: 24px 16px 40px;
	background: var(--page-bg);
	color: var(--text);
	font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

/* standardstyle.css sets Arial and 12px on each of these separately */
td, p, li, a, input, select, textarea, button, h1, h2, h3, h4 {
	font-family: inherit;
}

/* Every page is a stack of 800px blocks: the header, content tables (all drawn on the
   pagebglogin.jpg strip, sometimes inside a <form>), loose notices, the footer. Widen them into one
   white column and drop the old background strip image. */
body > table,
body > div,
table[background*="pagebglogin"] {
	width: 100%;
	max-width: var(--page-width);
	margin: 0 auto;
	background: #fff;
	border-left: 1px solid var(--border);
	border-right: 1px solid var(--border);
	box-sizing: border-box;
}

/* A content table inside another one is just part of it */
table[background*="pagebglogin"] table[background*="pagebglogin"] {
	max-width: none;
	border: 0;
}

/* Loose notices (e.g. the Agreement message above the quote form) */
body > div {
	padding: 8px 28px 4px;
}

body > div hr {
	display: none;
}

/* Breathing room on the left and right of the content */
body > table:not(.headerImage) > tbody > tr > td:first-child,
table[background*="pagebglogin"] > tbody > tr > td:first-child {
	padding-left: 28px;
}
body > table:not(.headerImage) > tbody > tr > td:last-child,
table[background*="pagebglogin"] > tbody > tr > td:last-child {
	padding-right: 28px;
}

/* ------------------------------ Text ------------------------------ */

h1 {
	color: var(--brand-dark);
	font-size: 24px;
	font-weight: 600;
	margin: 16px 0 12px;
}

h2, h3 {
	color: var(--brand-dark);
	font-weight: 600;
}

h4 {
	color: var(--text);
	font-size: 17px;
	font-weight: 600;
}

p {
	font-size: 14px;
	line-height: 1.6;
	text-align: left;
	color: var(--text);
}

td {
	font-size: 13px;
	color: var(--text);
}

li {
	font-size: 14px;
}

a {
	color: var(--brand);
}

a:hover {
	color: var(--brand-dark);
	text-decoration: underline;
}

hr {
	border: 0;
	border-top: 1px solid var(--border);
	margin: 16px 0;
}

/* ------------------------------ Header ------------------------------ */

table.headerImage {
	border: 0;
	border-radius: 10px 10px 0 0;
	overflow: hidden;
	background: var(--brand);
}

/* Banner: the 800px Glasscare image on the left, the rest filled with the same vertical gradient
   the image has near its right edge. Layers, top to bottom:
   1. the image's 2px top border (light, then blue) carried across the full width
   2. the gradient painted over the image's last pixel column, a darker border line, so no seam
   3. the image  4. the fill */
table.headerImage > tbody > tr:first-child > td {
	--banner-fill: linear-gradient(#9ccfff, #a8d3fd 30%, #b0d7fe 50%, #b9ddff 70%, #cce8fe 90%, #d2ebff);
	background:
		linear-gradient(#f3ffff 50%, #6eb0fa 50%) 0 0 / 100% 2px no-repeat,
		var(--banner-fill) 797px 0 / 4px 100% no-repeat,
		url(../images/top.jpg) no-repeat left top,
		var(--banner-fill);
}

table.headerImage > tbody > tr:first-child table {
	width: 100%;
	background: none;
}

/* Navigation bar */
table.headerImage > tbody > tr:nth-child(2) > td {
	background: var(--brand);
	padding: 0 12px;
}

table.headerImage > tbody > tr:nth-child(2) td {
	font-size: 14px;
}

table.headerImage > tbody > tr:nth-child(2) a {
	display: block;
	padding: 11px 14px;
	color: #fff;
	font-weight: 500;
	white-space: nowrap;
	text-decoration: none;
}

table.headerImage > tbody > tr:nth-child(2) a:hover {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	text-decoration: none;
}

/* Old separator images between the links, and the thin strip under the bar */
table.headerImage img[src*="navspace"] {
	display: none;
}

table.headerImage td[width="10"] {
	width: 2px;
}

table.headerImage > tbody > tr:nth-child(3) {
	display: none;
}

/* ------------------------------ Footer ------------------------------ */

/* The footer table (login/footer.htm). Targeted by class, not :has(): a :has() rule checked against
   every table made long pages (e.g. a 12,000-row statement) hang the browser while loading. */
table.site-footer {
	width: 100%;
	max-width: var(--page-width);
	margin: 0 auto;
	border-left: 1px solid var(--border);
	border-right: 1px solid var(--border);
	box-sizing: border-box;
	border-bottom: 1px solid var(--border);
	border-radius: 0 0 10px 10px;
	background: #f8fafc;
}

table.site-footer td {
	background: none;
	color: var(--muted);
	font-size: 12px;
	padding-top: 14px;
	padding-bottom: 14px;
}

table.site-footer td[width="165"] {
	display: none;
}

table.site-footer font[size="1"] {
	font-size: 12px;
}

/* ------------------------------ Forms ------------------------------ */

input:not([type]),
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
	border: 1px solid #c9d2dc;
	border-radius: 6px;
	padding: 7px 10px;
	font-size: 14px;
	color: var(--text);
	background-color: #fff;
	box-sizing: border-box;
}

input:not([type]):focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(31, 92, 153, 0.15);
	outline: none;
}

input[type="submit"],
input[type="button"],
input.button,
form input.button,
button {
	background: var(--brand);
	background-image: none;
	border: 0;
	border-radius: 6px;
	padding: 8px 18px;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

input[type="submit"]:hover,
input[type="button"]:hover,
input.button:hover,
form input.button:hover,
button:hover {
	background: var(--brand-dark);
}

/* A link that looks like a button ("Go back") */
a.button-link {
	display: inline-block;
	padding: 8px 18px;
	border: 1px solid var(--brand);
	border-radius: 6px;
	color: var(--brand);
	font-weight: 600;
	text-decoration: none;
}

a.button-link:hover {
	background: var(--brand-light);
	color: var(--brand-dark);
	text-decoration: none;
}

/* Home page menu (login/index.php, login/main.php) */
.menu-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
	margin: 8px 0 20px;
}

a.menu-tile {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 64px;
	padding: 12px 16px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
	color: var(--brand-dark);
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

a.menu-tile:hover {
	border-color: var(--brand);
	background: var(--brand-light);
	box-shadow: 0 2px 6px rgba(31, 92, 153, 0.15);
	color: var(--brand-dark);
	text-decoration: none;
}

/* login/index.php keeps the old button positions: a table, one tile per cell */
table.menu-grid {
	border-spacing: 0;
	table-layout: fixed;
	padding: 0 14px;
}

/* Four equal columns: the same padding in every cell (the page-wide first/last cell padding would
   otherwise make the edge columns narrower) */
table.menu-grid[background] > tbody > tr > td:nth-child(n) {
	padding: 8px 14px;
	width: 25%;
}

table.menu-grid a.menu-tile {
	min-height: 56px;
}

.menu-logout {
	text-align: center;
}

.menu-logout button {
	min-height: 44px;
	padding: 8px 28px;
}

.menu-logout button {
	background: #fff;
	border: 1px solid #c9473f;
	color: #c9473f;
}

.menu-logout button:hover {
	background: #fdecec;
	color: #a8352e;
}

/* Small "Login & security" link above the menu tiles (login/index.php) */
table.menu-account > tbody > tr > td {
	padding-top: 0;
	padding-bottom: 0;
}

a.account-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: #fff;
	color: var(--brand-dark);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

a.account-link:hover {
	border-color: var(--brand);
	background: var(--brand-light);
	color: var(--brand-dark);
	text-decoration: none;
}

.account-link-warning {
	margin-left: 10px;
	color: #c0392b;
	font-size: 13px;
	font-weight: 600;
}

/* "Sign in with Microsoft" under the supplier login form (login/login.php) */
.sso-login {
	max-width: 440px;
}

.sso-or {
	margin: 4px 0 10px;
	color: var(--muted);
}

a.sso-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 9px 18px;
	border: 1px solid #8c8c8c;
	border-radius: 4px;
	background: #fff;
	color: #5e5e5e;
	font-weight: 600;
	text-decoration: none;
}

a.sso-button:hover {
	background: #f3f3f3;
	color: #3b3b3b;
	text-decoration: none;
}

.sso-linked {
	margin: 0 0 8px;
}

/* Login & security page (login/account.php) */
.account-page {
	max-width: 640px;
}

/* "← Back to the menu": a plain link above the title */
.account-back {
	margin: 0 0 4px;
}

.account-back a {
	color: var(--brand);
	font-weight: 600;
	text-decoration: none;
}

.account-back a:hover {
	text-decoration: underline;
}

/* Each section is its own card, clearly apart from the next */
.account-section {
	margin: 0 0 24px;
	padding: 18px 22px;
	border: 1px solid var(--border);
	border-left: 4px solid var(--brand);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.account-section h3 {
	margin: 0 0 8px;
	color: var(--brand-dark);
	font-size: 16px;
}

.account-value {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
}

/* Verified / Not verified, to the right of the login email */
.email-status {
	margin-left: 10px;
	font-size: 14px;
	font-weight: 700;
}

.email-verified {
	color: #1e7b34;
}

.email-unverified {
	color: #c0392b;
}

.account-help {
	margin: 0 0 8px;
	color: var(--muted);
	font-size: 13px;
}

/* A small note under a value */
.account-note {
	margin: 0 0 10px;
	color: var(--text);
	font-size: 12px;
	opacity: 0.7;
}

.account-message {
	padding: 10px 14px;
	border-radius: 6px;
	background: #eaf5ea;
	color: #24622a;
}

.account-error {
	padding: 10px 14px;
	border-radius: 6px;
	background: #fdecec;
	color: #a8352e;
}

.account-pending {
	margin: 8px 0;
	padding: 10px 14px;
	border-radius: 6px;
	background: #fff7e0;
}

.account-inline {
	display: inline-block;
	margin: 6px 0 0;
}

.account-inline button {
	padding: 5px 12px;
	font-size: 13px;
}

button.button-secondary {
	background: #fff;
	border: 1px solid var(--brand);
	color: var(--brand);
}

button.button-secondary:hover {
	background: var(--brand-light);
	color: var(--brand-dark);
}

/* "Change login email" / "Change password": a shaded box that opens to show the form. The page
   background colour, so it sits apart from the white card without adding a new colour. */
.account-form {
	margin: 5px 0;
	padding: 5px 20px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--page-bg);
}

.account-form summary {
	padding: 6px 0;
	color: var(--brand-dark);
	font-weight: 600;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.account-form summary::-webkit-details-marker {
	display: none;
}

.account-form summary::before {
	content: "\25B8";
	display: inline-block;
	width: 1.1em;
	color: var(--brand);
}

.account-form[open] summary::before {
	content: "\25BE";
}

.account-form summary:hover {
	color: var(--brand);
}

.account-form form {
	margin: 4px 0 0;
	padding: 12px 0 4px;
	border-top: 1px solid var(--border);
}

.account-form label {
	display: block;
	margin: 0 0 4px;
	font-weight: 600;
}

.account-form input[type="email"],
.account-form input[type="password"] {
	width: 100%;
	max-width: 360px;
}

/* "Forgot your password?" next to the Change password button */
.account-forgot {
	margin-left: 14px;
	color: var(--brand);
	font-size: 13px;
}

/* Two-step verification (login/two-factor-setup.php, login/two-factor.php, account.php) */
.two-factor-qr {
	display: inline-block;
	margin: 6px 0 12px;
	padding: 8px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: #fff;
	line-height: 0;
}

.two-factor-key {
	font-family: Consolas, "Courier New", monospace;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 1px;
	word-break: break-all;
}

input.two-factor-code {
	width: 100%;
	max-width: 180px;
	padding: 8px 10px;
	font-family: Consolas, "Courier New", monospace;
	font-size: 20px;
	letter-spacing: 3px;
}

form.login input.two-factor-code {
	max-width: 220px;
}

form.login label.two-factor-remember {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: normal;
	cursor: pointer;
}

ul.recovery-codes {
	display: grid;
	grid-template-columns: repeat(2, max-content);
	gap: 6px 40px;
	margin: 12px 0;
	padding: 12px 18px;
	border: 1px dashed var(--border);
	border-radius: 6px;
	background: var(--page-bg);
	list-style: none;
	font-family: Consolas, "Courier New", monospace;
	font-size: 16px;
}

@media print {
	.recovery-codes ~ *,
	.account-inline,
	.account-section > .account-error {
		display: none !important;
	}
}

/* Image buttons ("Go"): keep the image, lose the box drawn round it */
input[type="image"] {
	border: 0;
	padding: 0;
	vertical-align: middle;
}

/* Login forms (supplier and telesales): stacked labels, full-width fields */
form.login {
	padding-left: 0 !important;
	max-width: 440px;
}

form.login p {
	margin: 0 0 14px;
}

form.login label {
	float: none;
	display: block;
	width: auto;
	margin: 0 0 5px;
	font-weight: 600;
}

form.login input[type="text"],
form.login input[type="password"] {
	width: 100%;
	margin-left: 0;
	padding: 9px 12px;
}

form.login span {
	display: block;
	margin: 0 0 12px !important;
}

form.login p:last-child label {
	display: none;
}

form.login input[type="submit"] {
	margin-left: 0;
	padding: 10px 28px;
}

/* ------------------------------ Statement ------------------------------ */

/* Column headings */
body > table.statement-list > tbody > tr:first-child > td {
	background: #f6f8fb;
	border-bottom: 2px solid var(--border);
	color: var(--muted);
	font-size: 12px;
	padding-top: 10px;
	padding-bottom: 10px;
}

/* Rows: a light divider instead of the page's 1pt black line */
body tr.border_bottom td {
	border-bottom: 1px solid var(--border);
	padding-top: 9px;
	padding-bottom: 9px;
}

body tr.border_bottom:hover td {
	background-color: #f6f9fc;
}

/* New (not yet viewed) entries keep their colours, softened: green = new, red = new rejection */
tr[bgcolor="#77DD77"] > td {
	background-color: #e8f6ec;
}

tr[bgcolor="#FF6961"] > td {
	background-color: #fdecec;
}

tr[bgcolor="#77DD77"] > td:first-child {
	box-shadow: inset 4px 0 0 #3fa45b;
}

tr[bgcolor="#FF6961"] > td:first-child {
	box-shadow: inset 4px 0 0 #d9534f;
}

/* ------------------------------ Profile ------------------------------ */

.profilequestion h3 {
	background-color: var(--brand);
	border-radius: 6px;
	color: #fff;
}
