/*
 * Production ERP login — company-branded enterprise experience (Frappe v16).
 * Scoped to the public /login template; the native authentication, LDAP,
 * social providers and recovery/signup views retain their own controllers.
 * This is the last login-page visual layer, over the legacy split rules.
 */
body[data-path="login"] {
	--st-login-ink: #102f3d;
	--st-login-muted: #69808c;
	--st-login-teal: #006d72;
	--st-login-teal-deep: #003f4b;
	--st-login-border: #d7e4e9;
	--st-login-surface: #f7fafb;
	--st-login-accent: #e7a839;
	background: #eff7f9 !important;
}

body[data-path="login"] .page-content-wrapper {
	min-height: 100svh !important;
	overflow: visible !important;
}

.st-login-site,
.st-login-site *,
.st-login-site *::before,
.st-login-site *::after { box-sizing: border-box; }

.st-login-site {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 100svh;
	width: 100%;
	padding: clamp(20px, 5.1vh, 64px) clamp(16px, 3.9vw, 64px) 20px;
	background:
		radial-gradient(ellipse at 5% 10%, rgba(89, 182, 204, .19), transparent 36%),
		radial-gradient(ellipse at 98% 86%, rgba(126, 192, 206, .22), transparent 32%),
		linear-gradient(142deg, #f9fdff 0%, #e8f3f6 48%, #f8fcfd 100%);
	overflow: hidden;
}

.st-login-site::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: -1;
	opacity: .35;
	background-image: radial-gradient(#9dc3d0 1px, transparent 1px);
	background-size: 22px 22px;
	mask-image: linear-gradient(130deg, #000 0%, transparent 30%, transparent 72%, #000 100%);
	-webkit-mask-image: linear-gradient(130deg, #000 0%, transparent 30%, transparent 72%, #000 100%);
}

.st-login-site::after {
	content: "";
	position: absolute;
	z-index: -1;
	bottom: -17vw;
	left: -12%;
	width: 128%;
	height: min(40vw, 390px);
	border: 1px solid rgba(84, 168, 183, .18);
	border-radius: 50% 50% 0 0;
	background: linear-gradient(180deg, rgba(163, 213, 225, .18), transparent 72%);
	pointer-events: none;
	transform: rotate(-3deg);
}

body[data-path="login"] .st-login-wrapper {
	position: relative;
	display: grid !important;
	grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr) !important;
	flex-direction: initial !important;
	width: min(100%, 1220px) !important;
	max-width: 1220px !important;
	min-width: 0 !important;
	min-height: min(670px, calc(100svh - 130px)) !important;
	margin: 0 auto !important;
	padding: 0 !important;
	overflow: hidden !important;
	border: 1px solid rgba(255, 255, 255, .85);
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 28px 70px rgba(14, 62, 79, .14), 0 6px 18px rgba(21, 75, 91, .065);
}

/* Form column stays usable when SSO providers or signup content are long. */
body[data-path="login"] .st-login-form-col {
	display: flex !important;
	flex: initial !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 0 !important;
	width: 100% !important;
	min-height: 0 !important;
	padding: clamp(26px, 4.1vw, 66px) clamp(22px, 4vw, 72px) !important;
	overflow-y: auto !important;
	background: #fff !important;
}

.st-login-form-col > section {
	min-width: 0 !important;
	max-width: 470px !important;
	width: 100% !important;
	margin-inline: auto;
}

body[data-path="login"] .st-login-form-col .page-card-head {
	width: 100% !important;
	max-width: none !important;
	margin: 0 auto 22px !important;
	padding: 0 !important;
	text-align: center !important;
}

.st-login-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	gap: 9px;
	margin: 0 auto 24px;
}

.st-login-logo-frame {
	position: relative;
	display: grid;
	place-items: center;
	width: min(100%, 208px);
	height: 100px;
	margin: 0 auto;
}

.st-login-logo-frame .app-logo.st-login-company-logo {
	position: absolute;
	inset: 0;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 208px !important;
	max-height: 100px !important;
	margin: auto !important;
	padding: 3px !important;
	object-fit: contain !important;
	object-position: center !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	opacity: 0;
	transition: opacity .2s ease;
}

.st-login-logo-frame.has-logo .app-logo.st-login-company-logo { opacity: 1; }

.st-login-monogram {
	display: grid;
	place-items: center;
	width: 84px;
	height: 84px;
	border: 1px solid rgba(2, 110, 115, .14);
	border-radius: 24px;
	background: linear-gradient(150deg, #e2f6f6, #c1e8ec);
	box-shadow: 0 8px 24px rgba(0, 100, 111, .11);
	color: var(--st-login-teal-deep);
	font-size: 37px;
	font-weight: 800;
	line-height: 1;
}

.st-login-logo-frame.has-logo .st-login-monogram { display: none; }

.st-login-company-name {
	display: block;
	max-width: 100%;
	color: var(--st-login-ink);
	font-size: clamp(13px, 1vw, 16px);
	font-weight: 700;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.st-login-eyebrow {
	display: block;
	margin: 0 0 10px;
	color: var(--st-login-teal) !important;
	font-size: 11px;
	font-weight: 750;
	letter-spacing: .16em;
	text-transform: uppercase;
}

body[data-path="login"] .st-login-form-col .st-login-heading {
	margin: 0 0 9px !important;
	color: var(--st-login-ink) !important;
	font-size: clamp(25px, 2.3vw, 34px) !important;
	font-weight: 790 !important;
	letter-spacing: -.045em !important;
	line-height: 1.19 !important;
}

.st-login-subheading {
	margin: 0;
	color: var(--st-login-muted);
	font-size: 14px;
	line-height: 1.65;
}

body[data-path="login"] .st-login-form-col .login-content.page-card {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

.st-login-form-col .st-login-with-options,
.st-login-form-col .page-card-body,
.st-login-form-col .page-card-actions {
	width: 100%;
	max-width: 100% !important;
}

.st-login-form-col .page-card-body .form-group {
	margin: 0 0 14px !important;
}

body[data-path="login"] .st-login-form-col .email-field,
body[data-path="login"] .st-login-form-col .password-field {
	position: relative !important;
	width: 100% !important;
	margin: 0 !important;
}

body[data-path="login"] .st-login-form-col .page-card-body :is(input[type="text"],input[type="email"],input[type="password"]) {
	width: 100% !important;
	height: 54px !important;
	min-height: 54px !important;
	margin: 0 !important;
	padding: 0 70px 0 48px !important;
	border: 1px solid var(--st-login-border) !important;
	border-radius: 12px !important;
	background: var(--st-login-surface) !important;
	color: var(--st-login-ink) !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	box-shadow: 0 2px 5px rgba(14, 55, 68, .025) !important;
	transition: border-color .18s ease, box-shadow .18s ease, background .18s ease !important;
}

body[data-path="login"] .st-login-form-col .page-card-body input::placeholder {
	color: #90a3b3 !important;
	opacity: 1;
}

body[data-path="login"] .st-login-form-col .page-card-body input:focus {
	outline: 0 !important;
	border-color: #00818a !important;
	background: #fff !important;
	box-shadow: 0 0 0 4px rgba(0, 126, 136, .11), 0 3px 10px rgba(14, 55, 68, .04) !important;
}

body[data-path="login"] .st-login-form-col .field-icon {
	position: absolute !important;
	top: 50% !important;
	left: 17px !important;
	right: auto !important;
	width: 18px !important;
	height: 18px !important;
	color: #738e9b !important;
	fill: none !important;
	stroke: currentColor !important;
	transform: translateY(-50%) !important;
	pointer-events: none !important;
	z-index: 2 !important;
}

body[data-path="login"] .st-login-form-col .toggle-password {
	position: absolute !important;
	right: 16px !important;
	left: auto !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	color: var(--st-login-teal) !important;
	font-size: 12px !important;
	font-weight: 650 !important;
	cursor: pointer;
}

body[data-path="login"] .st-login-form-col .forgot-password-message {
	margin: 7px 0 16px !important;
	text-align: right;
}

body[data-path="login"] .st-login-form-col .forgot-password-message a,
body[data-path="login"] .st-login-form-col .sign-up-message a {
	color: var(--st-login-teal) !important;
	font-size: 12.5px !important;
	font-weight: 650 !important;
	text-decoration: none !important;
}

body[data-path="login"] .st-login-form-col .forgot-password-message a:hover,
body[data-path="login"] .st-login-form-col .sign-up-message a:hover {
	color: #004b55 !important;
	text-decoration: underline !important;
}

body[data-path="login"] .st-login-form-col .page-card-actions {
	margin-top: 6px;
}

body[data-path="login"] .st-login-form-col :is(.btn-primary,.btn-login,.btn-forgot,.btn-login-with-email-link) {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 12px !important;
	width: 100% !important;
	min-height: 53px !important;
	height: auto !important;
	padding: 12px 18px !important;
	border: 1px solid rgba(255,255,255,.14) !important;
	border-radius: 12px !important;
	background: linear-gradient(115deg, #007d83 0%, #005b64 51%, #003d4b 100%) !important;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	box-shadow: 0 9px 20px rgba(0, 90, 99, .19) !important;
	transition: filter .18s ease, transform .18s ease, box-shadow .18s ease !important;
}

body[data-path="login"] .st-login-form-col :is(.btn-primary,.btn-login,.btn-forgot,.btn-login-with-email-link):hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
	box-shadow: 0 12px 26px rgba(0, 90, 99, .23) !important;
}
body[data-path="login"] .st-login-form-col :is(.btn-primary,.btn-login,.btn-forgot,.btn-login-with-email-link):active { transform: translateY(0); }
body[data-path="login"] .st-login-form-col :is(button,a,input):focus-visible { outline: 2px solid #00868c !important; outline-offset: 3px !important; }
.st-login-form-col .btn-login svg { width: 19px; height: 19px; flex: 0 0 19px; }

body[data-path="login"] .st-login-form-col .login-divider { margin: 18px 0 !important; color: #81949d !important; }
body[data-path="login"] .st-login-form-col .btn-login-option {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px !important;
	padding: 10px 14px !important;
	border-color: #d4e2e7 !important;
	border-radius: 10px !important;
	background: #fff !important;
	color: #234553 !important;
}
body[data-path="login"] .st-login-form-col .social-logins { margin-top: 19px; }
body[data-path="login"] .st-login-form-col .social-login-buttons { display: grid; gap: 9px; }

/* Visual panel — neutral manufacturing rather than a company-specific plant. */
body[data-path="login"] .st-login-panel {
	position: relative !important;
	display: flex !important;
	flex: initial !important;
	flex-direction: column !important;
	align-items: stretch !important;
	justify-content: center !important;
	min-width: 0 !important;
	width: 100% !important;
	min-height: 0 !important;
	padding: clamp(34px, 4.3vw, 70px) clamp(28px, 3.5vw, 58px) !important;
	overflow: hidden !important;
	background:
		radial-gradient(ellipse at 90% 8%, rgba(6, 151, 152, .5), transparent 39%),
		radial-gradient(ellipse at 7% 72%, rgba(8, 109, 128, .5), transparent 46%),
		linear-gradient(144deg, #004b57 0%, #003743 42%, #012a38 100%) !important;
	color: #fff;
	text-align: left !important;
}

body[data-path="login"] .st-login-panel::before {
	content: "";
	position: absolute;
	z-index: 0;
	width: 740px;
	height: 490px;
	top: -310px;
	right: -220px;
	border: 1px solid rgba(228, 175, 79, .48);
	border-radius: 50%;
	background: none;
	transform: rotate(-17deg);
}

body[data-path="login"] .st-login-panel::after {
	content: "";
	position: absolute;
	left: -24%;
	right: auto;
	top: auto;
	bottom: -34%;
	width: 150%;
	height: 55%;
	border-radius: 50% 50% 0 0;
	background: linear-gradient(15deg, rgba(0, 187, 178, .22), rgba(89, 203, 208, .04));
	border-top: 1px solid rgba(229, 171, 67, .72);
	transform: rotate(-6deg);
}

.st-panel-orbit {
	position: absolute;
	z-index: 0;
	border: 1px solid rgba(83, 188, 193, .13);
	border-radius: 50%;
	pointer-events: none;
}
.st-panel-orbit-a { height: 420px; width: 420px; right: -220px; bottom: -210px; }
.st-panel-orbit-b { height: 250px; width: 250px; left: -168px; top: 24%; }

body[data-path="login"] .st-panel-content {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	position: relative;
	z-index: 2;
	width: 100% !important;
	max-width: 500px !important;
	margin: auto !important;
	text-align: left !important;
}

.st-insight-scene { position: relative; width: min(100%, 415px); height: 240px; margin-bottom: clamp(22px, 4vw, 48px); }
.st-insight-card {
	position: absolute;
	left: 0;
	top: 0;
	display: flex;
	flex-direction: column;
	width: calc(100% - 36px);
	height: 195px;
	padding: 17px 20px;
	border: 1px solid rgba(255,255,255,.6);
	border-radius: 17px;
	background: rgba(255,255,255,.97);
	color: #274958;
	box-shadow: 0 22px 38px rgba(0,21,29,.22);
}
.st-insight-card-top { display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:11px; font-weight:720; white-space:nowrap; }
.st-insight-card-title { display:flex; align-items:center; gap:7px; }
.st-insight-card-title svg { width:18px; height:18px; color:#006f78; }
.st-insight-pill { border-radius:999px; background:#e7f3f4; color:#00646b; padding:7px 10px; font-size:10px; }
.st-insight-chart { display:flex; align-items:end; gap:10px; flex:1; padding:16px 3px 0; border-bottom:1px solid #ddebf0; }
.st-insight-chart i { display:block; flex:1 1 0; min-width:0; height:var(--bar); max-height:88px; border-radius:5px 5px 0 0; background:linear-gradient(180deg,#35b8bd,#a0e3e4); }
.st-insight-chart i:nth-child(3n+1) { background:linear-gradient(180deg,#07818b,#75cbd0); }
.st-insight-chart-foot { display:flex; gap:16px; justify-content:space-around; margin:10px 3px 1px; }
.st-insight-chart-foot span { display:block; width:19%; height:5px; border-radius:999px; background:#e6eff2; }

.st-insight-mini {
	position:absolute;
	right:0;
	bottom:0;
	display:flex;
	flex-direction:column;
	align-items:center;
	justify-content:center;
	gap:12px;
	width:134px;
	height:137px;
	border-radius:18px;
	border:1px solid rgba(255,255,255,.75);
	background:#fff;
	box-shadow:0 17px 32px rgba(0,20,26,.22);
	color:#426371;
	font-size:11px;
	font-weight:700;
}
.st-insight-ring {
	display:grid;
	place-items:center;
	width:80px;
	height:80px;
	border-radius:50%;
	background:conic-gradient(#006d72 0 70%, #e2f1f2 70% 100%);
}
.st-insight-ring svg {
	width:51px;
	height:51px;
	padding:15px;
	border-radius:50%;
	background:#fff;
	color:#006d72;
	stroke-width:2.5;
}

.st-panel-copy { position:relative; z-index:2; max-width:450px; }
.st-panel-kicker { display:block; margin-bottom:13px; color:#8be0da; font-size:11px; font-weight:750; letter-spacing:.15em; }
body[data-path="login"] .st-panel-copy h2 { margin:0 0 15px; font-size:clamp(25px, 2.1vw, 34px); font-weight:770; line-height:1.18; letter-spacing:-.035em; color:#fff !important; }
.st-panel-accent { width:90px; height:4px; margin-bottom:20px; border-radius:99px; background:linear-gradient(90deg,#1cc9bc 0 60%,#ebad48 60% 100%); }
body[data-path="login"] .st-panel-copy p { margin:0; max-width:430px; font-size:14px; line-height:1.85; color:#b9d5de !important; }
.st-panel-benefits { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:21px; }
.st-panel-benefits span { border:1px solid rgba(183,233,231,.22); border-radius:999px; background:rgba(255,255,255,.065); padding:7px 12px; font-size:11px; color:#d4eff0; }

.st-industry-silhouette { position:absolute; z-index:1; bottom:-1px; left:0; width:100%; height:auto; max-height:220px; color:#3f9eaa; pointer-events:none; opacity:.44; }
.st-panel-bottom-brand { position:absolute; z-index:3; bottom:25px; left:clamp(28px,3.5vw,58px); right:25px; color:rgba(216,246,247,.65); font-size:11px; font-weight:650; overflow-wrap:anywhere; }

.st-login-footer {
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap:14px;
	width:min(100%,1220px);
	max-width:1220px;
	margin:20px auto 0;
	padding:0 10px;
	color:#68818e;
	font-size:12px;
	line-height:1.5;
}
.st-login-footer span { overflow-wrap:anywhere; }

/* Text flows naturally in Pashto/Dari without reversing email input or the
   illustration dashboard's chart. */
:where(html[dir="rtl"],html:dir(rtl),body[dir="rtl"]) .st-login-subheading,
:where(html[dir="rtl"],html:dir(rtl),body[dir="rtl"]) .st-login-form-col .forgot-password-message {
	text-align:right !important;
}
:where(html[dir="rtl"],html:dir(rtl),body[dir="rtl"]) .st-login-footer { flex-direction:row-reverse; }
:where(html[dir="rtl"],html:dir(rtl),body[dir="rtl"]) .st-panel-copy { text-align:right; }

/* Small desktop / tablet: keep layout two-column without cramped controls. */
@media (max-width:1060px) and (min-width:821px) {
	body[data-path="login"] .st-login-wrapper { min-height:610px !important; }
	body[data-path="login"] .st-login-form-col { padding:32px 28px !important; }
	body[data-path="login"] .st-login-panel { padding:32px 27px !important; }
	.st-insight-scene { height:200px; margin-bottom:22px; }
	.st-insight-card { height:172px; }
	.st-insight-mini { width:110px; height:112px; }
	.st-insight-ring { width:65px; height:65px; }
	.st-insight-ring svg { width:42px; height:42px; padding:12px; }
}

/* Mobile: one beautiful centered, keyboard-friendly sign-in column. */
@media (max-width:820px) {
	.st-login-site { justify-content:center; padding:22px 16px 18px; }
	body[data-path="login"] .st-login-wrapper {
		display:block !important;
		max-width:560px !important;
		min-height:0 !important;
		border-radius:22px;
	}
	body[data-path="login"] .st-login-form-col {
		min-height:0 !important;
		width:100% !important;
		padding:clamp(25px,5.5vw,50px) clamp(22px,6vw,48px) !important;
		overflow:visible !important;
		background:#fff !important;
	}
	body[data-path="login"] .st-login-panel { display:none !important; }
	.st-login-brand { margin-bottom:19px; }
	.st-login-logo-frame { height:84px; }
	.st-login-logo-frame .app-logo.st-login-company-logo { max-height:84px !important; }
	.st-login-footer { max-width:560px; margin-top:16px; padding:0 3px; }
}
@media (max-width:490px) {
	.st-login-site { padding:12px 10px 15px; }
	body[data-path="login"] .st-login-wrapper { border-radius:17px; }
	body[data-path="login"] .st-login-form-col { padding:25px 20px 28px !important; }
	.st-login-footer { flex-direction:column; text-align:center; gap:5px; }
	.st-login-logo-frame { height:74px; }
	.st-login-logo-frame .app-logo.st-login-company-logo { max-height:74px !important; }
	.st-login-monogram { width:70px; height:70px; font-size:30px; }
	body[data-path="login"] .st-login-form-col .st-login-heading { font-size:25px !important; }
}
@media (max-height:700px) and (min-width:821px) {
	.st-login-site { padding-top:18px; padding-bottom:12px; }
	body[data-path="login"] .st-login-wrapper { min-height:560px !important; }
	body[data-path="login"] .st-login-form-col { padding-top:25px !important; padding-bottom:25px !important; }
	.st-login-brand { margin-bottom:15px; }
	.st-login-logo-frame { height:70px; }
	.st-login-logo-frame .app-logo.st-login-company-logo { max-height:70px !important; }
	.st-insight-scene { height:185px; margin-bottom:20px; }
	.st-insight-card { height:160px; }
}
/* Keep Frappe's invalid credential feedback visible after the modern input
   surface overrides; never obscure authentication errors. */
body[data-path="login"] .st-login-form-col .page-card-body.invalid
:is(input[type="text"],input[type="email"],input[type="password"]) {
	border-color: #d85656 !important;
	box-shadow: 0 0 0 3px rgba(216, 86, 86, .12) !important;
}

/* A dark browser/theme keeps exactly the same structure and branded panel,
   with appropriate contrast for the actual sign-in surface. */
:is(html[data-theme="dark"] body[data-path="login"],
    body[data-path="login"][data-theme="dark"]) {
	--st-login-ink: #ecf7f8;
	--st-login-muted: #a8c2cd;
	--st-login-teal: #73d8d5;
	--st-login-border: #34525c;
	--st-login-surface: #182f38;
	background: #0c1b24 !important;
}

:is(html[data-theme="dark"] body[data-path="login"],
    body[data-path="login"][data-theme="dark"]) .st-login-site {
	background:
		radial-gradient(ellipse at 7% 9%, rgba(14, 109, 120, .19), transparent 40%),
		linear-gradient(150deg, #101e2a 0%, #112b33 53%, #0c1b25 100%);
}

:is(html[data-theme="dark"] body[data-path="login"],
    body[data-path="login"][data-theme="dark"]) .st-login-wrapper {
	border-color: #29434d;
	background: #122833;
	box-shadow: 0 30px 68px rgba(0, 7, 12, .40);
}

:is(html[data-theme="dark"] body[data-path="login"],
    body[data-path="login"][data-theme="dark"]) .st-login-form-col {
	background: #122833 !important;
}

:is(html[data-theme="dark"] body[data-path="login"],
    body[data-path="login"][data-theme="dark"]) .st-login-form-col
.page-card-body :is(input[type="text"],input[type="email"],input[type="password"]) {
	background: #1b3741 !important;
	color: #eaf6f8 !important;
	border-color: #375561 !important;
}
:is(html[data-theme="dark"] body[data-path="login"],
    body[data-path="login"][data-theme="dark"]) .st-login-form-col .page-card-body input:focus {
	background: #193741 !important;
	border-color: #52ccc7 !important;
	box-shadow: 0 0 0 4px rgba(45, 199, 194, .18) !important;
}
:is(html[data-theme="dark"] body[data-path="login"],
    body[data-path="login"][data-theme="dark"]) .st-login-form-col .field-icon { color: #a5c5cd !important; }

:is(html[data-theme="dark"] body[data-path="login"],
    body[data-path="login"][data-theme="dark"]) .st-login-monogram {
	background: linear-gradient(150deg, #14505a, #143841);
	color: #bff7f0;
	border-color: #356a70;
}

:is(html[data-theme="dark"] body[data-path="login"],
    body[data-path="login"][data-theme="dark"]) .st-login-footer { color: #aac3cb; }

@media (prefers-reduced-motion:reduce) {
	.st-login-site *, .st-login-site *::before, .st-login-site *::after { transition:none !important; animation:none !important; }
}
