/* HSE Pro login page. Layered on Frappe's login.bundle.css; colours follow frontend/src/style.css. */

:root {
	--hse-blue: #2563eb;
	--hse-blue-dark: #1d4ed8;
	--hse-blue-ring: rgba(37, 99, 235, 0.18);
	--hse-red: #dc2626;
	--hse-red-ring: rgba(220, 38, 38, 0.15);
}

/* Remove Frappe's centred page frame so the layout can run edge to edge. */
body {
	background: #fff;
}

body .page-content-wrapper {
	min-height: 0;
	padding: 0;
}

.page-breadcrumbs,
.page-header-wrapper,
.page-footer {
	display: none;
}

.page-content-wrapper main.container {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

/* Layout */
.hse-login {
	display: grid;
	grid-template-columns: minmax(420px, 44%) 1fr;
	min-height: 100vh;
	min-height: 100svh;
}

.hse-login__main {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 32px;
}

.hse-login__main > div {
	width: 100%;
	max-width: 380px;
}

/* Brand panel */
.hse-login__brand {
	display: flex;
	flex-direction: column;
	gap: 48px;
	padding: 40px clamp(32px, 5vw, 72px);
	background: #0f172a;
	color: #fff;
}

.hse-login__identity {
	display: flex;
	align-items: center;
	gap: 12px;
}

.hse-login__logo {
	width: 36px;
	height: 36px;
	object-fit: contain;
}

.hse-login__name {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
}

.hse-login__tagline {
	font-size: 12px;
	color: #94a3b8;
}

.hse-login__pitch {
	margin: auto 0;
	max-width: 480px;
}

.hse-login__pitch h1 {
	margin: 0 0 14px;
	font-size: clamp(30px, 3vw, 40px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	text-wrap: balance;
	color: #fff;
}

.hse-login__pitch p {
	margin: 0 0 36px;
	font-size: 16px;
	line-height: 1.55;
	color: #cbd5e1;
}

/* Decorative training matrix */
.hse-matrix {
	display: grid;
	grid-template-columns: 1.6fr repeat(8, 1fr);
	gap: 5px;
}

.hse-matrix__label {
	align-self: center;
	width: 78%;
	height: 7px;
	border-radius: 4px;
	background: #334155;
}

.hse-matrix__cell {
	aspect-ratio: 5 / 4;
	border-radius: 4px;
}

.hse-matrix__cell--v { background: #166534; }
.hse-matrix__cell--e { background: #ca8a04; }
.hse-matrix__cell--x { background: #dc2626; }
.hse-matrix__cell--b { background: #2563eb; }
.hse-matrix__cell--m { background: #1e293b; }

.hse-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
	font-size: 12px;
	color: #94a3b8;
}

.hse-legend li {
	display: flex;
	align-items: center;
	gap: 7px;
}

.hse-legend span {
	width: 10px;
	height: 10px;
	border-radius: 3px;
}

/* Form card */
.hse-login .page-card {
	max-width: none;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

/* The brand panel already shows the logo. */
.hse-login .page-card-head img.app-logo {
	display: none;
}

.hse-login .page-card-head h4 {
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.015em;
	color: #0f172a;
}

.hse-login .page-card-subtitle {
	font-size: 15px;
	color: #64748b;
}

.hse-login .login-content {
	gap: 28px;
}

.hse-login .form-group label {
	font-size: 14px;
	font-weight: 500;
	color: #334155;
}

/* Inputs, including the 2FA code field, which sits outside .page-card-body. */
.hse-login .page-card .page-card-body input[type="text"],
.hse-login .page-card .page-card-body input[type="email"],
.hse-login .page-card .page-card-body input[type="password"],
.hse-login #login_token {
	height: 44px;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	font-size: 15px;
	color: #0f172a;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.hse-login .page-card .page-card-body .password-field input {
	padding-right: 44px;
}

.hse-login .page-card .page-card-body input::placeholder,
.hse-login #login_token::placeholder {
	color: #64748b;
}

.hse-login .page-card .page-card-body input:focus,
.hse-login #login_token:focus {
	border-color: var(--hse-blue);
	outline: 0;
	box-shadow: 0 0 0 3px var(--hse-blue-ring);
}

.hse-login .page-card .page-card-body.invalid input[type],
.hse-login .page-card .page-card-body .form-group.invalid input[type] {
	border-color: var(--hse-red);
}

.hse-login .page-card .page-card-body.invalid input:focus,
.hse-login .page-card .page-card-body .form-group.invalid input:focus {
	box-shadow: 0 0 0 3px var(--hse-red-ring);
}

.hse-login .page-card .page-card-body .field-error {
	font-size: 13px;
	color: var(--hse-red);
}

.hse-login .page-card .page-card-body .password-field .toggle-password {
	right: 13px;
}

/* Buttons */
.hse-login .es-button {
	height: 44px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	transition: background-color 0.15s, border-color 0.15s;
}

.hse-login .es-button[data-variant="solid"] {
	background: var(--hse-blue);
	color: #fff;
}

.hse-login .es-button[data-variant="solid"]:hover:not(:disabled) {
	background: var(--hse-blue-dark);
}

.hse-login .es-button[data-variant="solid"]:disabled {
	background: #93c5fd;
	color: #fff;
	opacity: 1;
}

.hse-login .es-button.btn-login-option {
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #334155;
}

.hse-login .es-button.btn-login-option:hover {
	background: #f8fafc;
	text-decoration: none;
}

/* Links */
.hse-login .page-card a:not(.es-button) {
	font-size: 14px;
	font-weight: 500;
	color: var(--hse-blue);
}

.hse-login .page-card a:not(.es-button):hover {
	color: var(--hse-blue-dark);
}

.hse-login a:focus-visible,
.hse-login button:focus-visible {
	outline: 2px solid var(--hse-blue);
	outline-offset: 2px;
}

/* Tablet and mobile: the brand panel shrinks to a header bar. */
@media (max-width: 959px) {
	.hse-login {
		display: flex;
		flex-direction: column;
	}

	.hse-login__brand {
		padding: 14px 24px;
	}

	.hse-login__pitch {
		display: none;
	}

	.hse-login__main {
		flex: 1;
		align-items: flex-start;
		padding: 40px 24px;
	}
}

/* Short laptop screens: drop the matrix rather than force a scroll. */
@media (max-height: 640px) {
	.hse-matrix,
	.hse-legend {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hse-login * {
		animation: none !important;
		transition: none !important;
	}
}
