/* xp_clinic — per-site sign-in page (login.css + login.js). Design: Login.dc.html (+ dark).
   Only acts when the site has clinic branding (Clinic Settings → clinic_name): login.js then
   builds the brand panel and sets html.xpc-lg-on. Without branding it sets html.xpc-lg-off
   and the stock Xpeedium login (xpeedium_desk xp_login.css + Solvronix) shows unchanged.

   No flash of the old panel: until login.js decides, #page-login is invisible. If the script
   or the API fails, the page shows itself again after 1.5 s (stock look).

   Layering: loaded after Solvronix login.css, and every rule is anchored on
   html.xpc-lg-on body #page-login — one class more than xp_login.css / the Head-HTML
   salaam-login.css — so it wins without touching those files. Theme: html[data-xpc-lg-theme]
   is set by login.js from Solvronix's data-theme (site setting), else the device. */

/* ── wait for the decision (max 1.5 s) ─────────────────────────────────────── */
html:not(.xpc-lg-on):not(.xpc-lg-off) body #page-login {
	opacity: 0;
	animation: xpc-lg-reveal 0s linear 1.5s forwards !important;
}
@keyframes xpc-lg-reveal {
	to {
		opacity: 1;
	}
}

/* ── tokens ──────────────────────────────────────────────────────────────── */
html.xpc-lg-on {
	--xpc-brand: #09449e; /* login.js sets the site's colour inline */
	--xpc-lg-panel: clamp(380px, 44.4444vw, 860px);
	--xpc-lg-band: 88px;
	--lg-bg: #ffffff;
	--lg-text: #0f1a2e;
	--lg-muted: #5a6678;
	--lg-line: #d4dbe5;
	--lg-in: #ffffff;
	--lg-ph: #8a93a3;
	--lg-btn: var(--xpc-brand);
	--lg-btn-hover: color-mix(in srgb, var(--xpc-brand) 86%, #000000);
	--lg-link: var(--xpc-brand);
	--lg-ring: color-mix(in srgb, var(--xpc-brand) 18%, transparent);
	--lg-seg: #eef2f7;
	--lg-seg-on: #ffffff;
	--lg-err: #b42318;
}
html.xpc-lg-on[data-xpc-lg-theme="dark"] {
	--lg-bg: #0e1522;
	--lg-text: #e6ecf5;
	--lg-muted: #9aa7bf;
	--lg-line: #2b3547;
	--lg-in: #141d2d;
	--lg-ph: #66748c;
	--lg-btn: color-mix(in srgb, var(--xpc-brand) 45%, #4f8cf2);
	--lg-btn-hover: color-mix(in srgb, var(--xpc-brand) 30%, #4f8cf2);
	--lg-link: color-mix(in srgb, var(--xpc-brand) 15%, #a3c4fd);
	--lg-ring: rgba(96, 150, 250, 0.3);
	--lg-seg: #1a2436;
	--lg-seg-on: #2b3547;
	--lg-err: #fda29b;
}

/* ── page frame: right side = form, left = fixed brand panel ───────────────── */
html.xpc-lg-on body:has(#page-login),
html.xpc-lg-on body #page-login,
html.xpc-lg-on body #page-login .page-content-wrapper,
html.xpc-lg-on body #page-login main.container,
html.xpc-lg-on body #page-login .page_content {
	background: var(--lg-bg) !important;
	animation: none !important;
	color: var(--lg-text);
}
html.xpc-lg-on body:has(#page-login)::before,
html.xpc-lg-on body:has(#page-login)::after {
	display: none !important;
}
html.xpc-lg-on body #page-login {
	position: relative;
	flex: 1 1 auto;
	min-height: 100vh;
	margin-left: var(--xpc-lg-panel) !important;
	font-family: Inter, "Segoe UI", system-ui, sans-serif;
}
html.xpc-lg-on body #page-login main.container {
	max-width: none !important;
	width: 100% !important;
	padding: 0 !important;
	margin: 0 !important;
}
html.xpc-lg-on body > nav.navbar,
html.xpc-lg-on body #page-login .page-breadcrumbs,
html.xpc-lg-on body #page-login .page-header-wrapper,
html.xpc-lg-on body #page-login .page-footer,
html.xpc-lg-on body:has(#page-login) footer.web-footer,
html.xpc-lg-on body:has(#page-login) .st-login-custom-footer {
	display: none !important;
}

/* each visible sign-in screen: the form centred in the right side */
html.xpc-lg-on body #page-login section.for-login:not([style*="none"]),
html.xpc-lg-on body #page-login section.for-email-login:is([style*="block"], [style*="flex"]),
html.xpc-lg-on body #page-login section.for-forgot:is([style*="block"], [style*="flex"]),
html.xpc-lg-on body #page-login section.for-signup:is([style*="block"], [style*="flex"]),
html.xpc-lg-on body #page-login section.for-login-with-email-link:is([style*="block"], [style*="flex"]) {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	min-height: 100vh !important;
	padding: 76px 20px 84px !important;
	margin: 0 !important;
	background: transparent !important;
	grid-template-columns: none !important;
	animation: none !important;
}
html.xpc-lg-on body #page-login section[class*="for-"][style*="display: none"] {
	display: none !important;
}
/* everything the old look drew around the form goes */
html.xpc-lg-on body #page-login section[class*="for-"]::before,
html.xpc-lg-on body #page-login section[class*="for-"]::after,
html.xpc-lg-on body #page-login section[class*="for-"] > .page-card::before,
html.xpc-lg-on body #page-login section[class*="for-"] > .page-card > form::before,
html.xpc-lg-on body #page-login section[class*="for-"] .page-card-actions::after {
	content: none !important;
	display: none !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] > .page-card-head {
	display: none !important;
}

/* ── the form column (design: 380px wide) ─────────────────────────────────── */
html.xpc-lg-on body #page-login section[class*="for-"] > .login-content.page-card,
html.xpc-lg-on body #page-login section[class*="for-"] > .page-card {
	padding: 0 20px !important;
	margin: 0 auto !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	animation: none !important;
	color: var(--lg-text) !important;
	font-family: Inter, "Segoe UI", system-ui, sans-serif !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] > .page-card > form,
html.xpc-lg-on body #page-login section[class*="for-"] .page-card-body,
html.xpc-lg-on body #page-login section[class*="for-"] .page-card-actions {
	max-width: none !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
}
html.xpc-lg-on body #page-login .xpc-lg-head {
	margin: 0 0 24px;
	text-align: left;
}
html.xpc-lg-on body #page-login .xpc-lg-head h1 {
	margin: 0 0 6px;
	font: 700 28px/1.2 Inter, "Segoe UI", system-ui, sans-serif;
	letter-spacing: -0.01em;
	color: var(--lg-text);
}
html.xpc-lg-on body #page-login .xpc-lg-head p {
	margin: 0;
	font: 400 15px/1.5 Inter, "Segoe UI", system-ui, sans-serif;
	color: var(--lg-muted);
}

/* fields */
html.xpc-lg-on body #page-login section[class*="for-"] .form-group {
	margin: 0 0 18px !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] .form-label {
	position: static !important;
	width: auto !important;
	height: auto !important;
	margin: 0 0 6px !important;
	padding: 0 !important;
	overflow: visible !important;
	clip: auto !important;
	white-space: normal !important;
	display: block !important;
	font: 600 13.5px/1.3 Inter, "Segoe UI", system-ui, sans-serif !important;
	color: var(--lg-text) !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] .email-field,
html.xpc-lg-on body #page-login section[class*="for-"] .password-field {
	position: relative !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] .form-control {
	height: 46px !important;
	width: 100% !important;
	box-sizing: border-box !important;
	padding: 0 14px 0 41px !important;
	border-radius: 10px !important;
	background: var(--lg-in) !important;
	border: 1px solid var(--lg-line) !important;
	color: var(--lg-text) !important;
	font: 400 15px/1 Inter, "Segoe UI", system-ui, sans-serif !important;
	box-shadow: none !important;
	transition: border-color 0.15s, box-shadow 0.15s;
}
html.xpc-lg-on body #page-login section[class*="for-"] #login_password {
	padding-right: 64px !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] .form-control::placeholder {
	color: var(--lg-ph) !important;
	opacity: 1;
}
html.xpc-lg-on body #page-login section[class*="for-"] .form-control:focus {
	border-color: var(--lg-btn) !important;
	box-shadow: 0 0 0 3px var(--lg-ring) !important;
	outline: none !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] .form-control:-webkit-autofill {
	-webkit-box-shadow: 0 0 0 60px var(--lg-in) inset !important;
	-webkit-text-fill-color: var(--lg-text) !important;
	caret-color: var(--lg-text);
}
html.xpc-lg-on body #page-login section[class*="for-"] .field-icon {
	position: absolute !important;
	left: 14px !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	width: 17px !important;
	height: 17px !important;
	margin: 0 !important;
	color: var(--lg-muted) !important;
	pointer-events: none;
}
html.xpc-lg-on body #page-login section[class*="for-"] .field-icon,
html.xpc-lg-on body #page-login section[class*="for-"] .field-icon * {
	fill: none !important;
	stroke: currentColor !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] .toggle-password {
	display: none !important;
}
html.xpc-lg-on body #page-login .xpc-lg-show {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	height: 30px;
	padding: 0 8px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--lg-link);
	font: 600 12.5px/1 Inter, "Segoe UI", system-ui, sans-serif;
	cursor: pointer;
}
html.xpc-lg-on body #page-login .xpc-lg-show:hover {
	text-decoration: underline;
}

/* "Keep me signed in" + "Forgot password?" on one line */
html.xpc-lg-on body #page-login section[class*="for-"] .forgot-password-message {
	display: none !important;
}
html.xpc-lg-on body #page-login .xpc-lg-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 18px;
	font: 400 14px/1.3 Inter, "Segoe UI", system-ui, sans-serif;
	color: var(--lg-text);
}
html.xpc-lg-on body #page-login .xpc-lg-keep {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
}
html.xpc-lg-on body #page-login .xpc-lg-keep input {
	appearance: auto !important;
	-webkit-appearance: checkbox !important;
	width: 16px !important;
	height: 16px !important;
	margin: 0 !important;
	accent-color: var(--lg-btn) !important;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] a:not(.btn),
html.xpc-lg-on body #page-login .xpc-lg-row a {
	color: var(--lg-link) !important;
	font: 500 14px/1.3 Inter, "Segoe UI", system-ui, sans-serif !important;
	text-decoration: none !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] a:not(.btn):hover {
	text-decoration: underline !important;
}

/* one brand-blue button */
html.xpc-lg-on body #page-login section[class*="for-"] .btn {
	height: 48px !important;
	width: 100% !important;
	border-radius: 10px !important;
	font: 600 15.5px/1 Inter, "Segoe UI", system-ui, sans-serif !important;
	box-shadow: none !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	transform: none !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] .btn-primary {
	background: var(--lg-btn) !important;
	border: 1px solid var(--lg-btn) !important;
	color: #ffffff !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] .btn-primary:hover {
	background: var(--lg-btn-hover) !important;
	border-color: var(--lg-btn-hover) !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] .btn:focus-visible {
	outline: 3px solid var(--lg-ring) !important;
	outline-offset: 2px;
}
html.xpc-lg-on body #page-login section[class*="for-"] .page-card-body.invalid .form-control {
	border-color: var(--lg-err) !important;
}
/* "Login with Email Link" (and the "or" above it) — staff don't use it */
html.xpc-lg-on body #page-login .login-with-email-link,
html.xpc-lg-on body #page-login .social-logins.xpc-lg-nosocial {
	display: none !important;
}
html.xpc-lg-on body #page-login section[class*="for-"] .sign-up-message {
	margin: 16px 0 0 !important;
	text-align: center;
}
html.xpc-lg-on body #page-login section.for-forgot .page-card-actions {
	margin-top: 18px !important;
}

/* ── brand panel (same in light and dark) ─────────────────────────────────── */
html.xpc-lg-on body #page-login .xpc-lg-brand {
	position: fixed;
	left: 0;
	top: 0;
	bottom: 0;
	width: var(--xpc-lg-panel);
	z-index: 2;
	box-sizing: border-box;
	padding: 56px 32px 88px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	color: #ffffff;
	background: linear-gradient(
		160deg,
		color-mix(in srgb, var(--xpc-brand) 78%, #1f74ea) 0%,
		var(--xpc-brand) 48%,
		color-mix(in srgb, var(--xpc-brand) 62%, #000000) 100%
	);
	font-family: Inter, "Segoe UI", system-ui, sans-serif;
	text-align: center;
}
html.xpc-lg-on body #page-login .xpc-lg-mid {
	position: relative;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
}
html.xpc-lg-on body #page-login .xpc-lg-ecg {
	position: absolute;
	left: -32px;
	right: -32px;
	top: calc(100% + 20px);
	width: calc(100% + 64px);
	height: 120px;
	overflow: visible;
	opacity: 0.18;
	pointer-events: none;
}
html.xpc-lg-on body #page-login .xpc-lg-plate {
	width: clamp(132px, 12.2vw, 176px);
	height: clamp(132px, 12.2vw, 176px);
	flex-shrink: 0;
	border-radius: 50%;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 18px 40px rgba(2, 18, 48, 0.35);
}
html.xpc-lg-on body #page-login .xpc-lg-plate img {
	width: 90%;
	height: 90%;
	object-fit: contain;
	display: block;
}
html.xpc-lg-on body #page-login .xpc-lg-plate span {
	font: 700 44px/1 Inter, system-ui, sans-serif;
	color: var(--xpc-brand);
}
html.xpc-lg-on body #page-login .xpc-lg-names {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
html.xpc-lg-on body #page-login .xpc-lg-name {
	font-size: clamp(26px, 2.36vw, 34px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-wrap: balance;
}
html.xpc-lg-on body #page-login .xpc-lg-so {
	font-size: clamp(17px, 1.39vw, 20px);
	font-weight: 500;
	line-height: 1.3;
	color: #cfe0ff;
}
html.xpc-lg-on body #page-login .xpc-lg-tag {
	font-size: 16px;
	line-height: 1.45;
	color: #cfe0ff;
}
html.xpc-lg-on body #page-login .xpc-lg-contact {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 40px;
	font-size: 13.5px;
	line-height: 1.4;
	color: #b8cdf5;
	font-variant-numeric: tabular-nums;
}

/* ── language switch (top right) and "Powered by" (bottom) ─────────────────── */
html.xpc-lg-on body #page-login .xpc-lg-lang {
	position: absolute;
	top: 28px;
	right: 32px;
	z-index: 3;
	display: flex;
	padding: 3px;
	border-radius: 9px;
	background: var(--lg-seg);
}
html.xpc-lg-on body #page-login .xpc-lg-lang button {
	height: 28px;
	padding: 0 12px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--lg-muted);
	font: 500 12.5px/1 Inter, "Segoe UI", system-ui, sans-serif;
	cursor: pointer;
}
html.xpc-lg-on body #page-login .xpc-lg-lang button[aria-pressed="true"] {
	background: var(--lg-seg-on);
	color: var(--lg-text);
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
html.xpc-lg-on body #page-login .xpc-lg-powered {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 28px;
	text-align: center;
	font: 400 12.5px/1.4 Inter, "Segoe UI", system-ui, sans-serif;
	color: var(--lg-muted);
}

/* short screens: smaller plate, no heartbeat line */
@media (min-width: 960px) and (max-height: 760px) {
	html.xpc-lg-on body #page-login .xpc-lg-ecg {
		display: none;
	}
	html.xpc-lg-on body #page-login .xpc-lg-plate {
		width: 124px;
		height: 124px;
	}
	html.xpc-lg-on body #page-login .xpc-lg-mid {
		gap: 16px;
	}
}

/* ── phones and small tablets: the panel becomes a slim band on top ─────────── */
@media (max-width: 959.98px) {
	html.xpc-lg-on body #page-login {
		margin-left: 0 !important;
	}
	html.xpc-lg-on body #page-login .xpc-lg-brand {
		position: relative;
		width: auto;
		height: var(--xpc-lg-band);
		padding: 0 20px;
		align-items: stretch;
		text-align: left;
	}
	html.xpc-lg-on body #page-login .xpc-lg-mid {
		position: static;
		height: 100%;
		flex-direction: row;
		align-items: center;
		gap: 14px;
	}
	html.xpc-lg-on body #page-login .xpc-lg-ecg {
		top: 50%;
		left: 0;
		right: 0;
		width: 100%;
		height: 70px;
		transform: translateY(-50%);
		opacity: 0.12;
	}
	html.xpc-lg-on body #page-login .xpc-lg-plate {
		position: relative;
		width: 56px;
		height: 56px;
		box-shadow: 0 6px 16px rgba(2, 18, 48, 0.35);
	}
	html.xpc-lg-on body #page-login .xpc-lg-plate span {
		font-size: 18px;
	}
	html.xpc-lg-on body #page-login .xpc-lg-names {
		position: relative;
		gap: 2px;
		min-width: 0;
	}
	html.xpc-lg-on body #page-login .xpc-lg-name {
		font-size: 17px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	html.xpc-lg-on body #page-login .xpc-lg-so {
		font-size: 13px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	html.xpc-lg-on body #page-login .xpc-lg-tag,
	html.xpc-lg-on body #page-login .xpc-lg-contact {
		display: none;
	}
	html.xpc-lg-on body #page-login .xpc-lg-lang {
		top: calc(var(--xpc-lg-band) + 14px);
		right: 16px;
	}
	html.xpc-lg-on body #page-login section.for-login:not([style*="none"]),
	html.xpc-lg-on body #page-login section.for-email-login:is([style*="block"], [style*="flex"]),
	html.xpc-lg-on body #page-login section.for-forgot:is([style*="block"], [style*="flex"]),
	html.xpc-lg-on body #page-login section.for-signup:is([style*="block"], [style*="flex"]),
	html.xpc-lg-on body #page-login section.for-login-with-email-link:is([style*="block"], [style*="flex"]) {
		min-height: calc(100vh - var(--xpc-lg-band)) !important;
		justify-content: flex-start !important;
		padding: 76px 4px 72px !important;
	}
	html.xpc-lg-on body #page-login .xpc-lg-head h1 {
		font-size: 24px;
	}
	html.xpc-lg-on body #page-login .xpc-lg-powered {
		bottom: 20px;
	}
}
