/* Engineering Consultancy login page (www/eng-login.html).
   Uses Frappe's Espresso tokens so the form side follows the site theme;
   logical properties (inline-start/end) keep the layout correct in RTL. */

body.ec-login {
	--ec-ink: #0e1a2b;
	--ec-ink-2: #15253b;
	--ec-line: rgba(148, 197, 255, 0.09);
	--ec-line-strong: rgba(148, 197, 255, 0.18);
	--ec-paper: #e8eef7;
	--ec-muted: #9fb0c7;
	--ec-teal: #2dd4bf;
	background: var(--surface-white, #fff);
}

body.ec-login .page-content-wrapper {
	padding-top: 0;
	min-height: 100vh;
	min-height: 100svh;
}

body.ec-login main,
body.ec-login .page_content {
	padding: 0;
	margin: 0;
}

.ec-auth {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	min-height: 100vh;
	min-height: 100svh;
}

/* ---------- Brand panel: a drawing sheet ---------- */

.ec-brand {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 48px;
	padding: 40px 48px;
	color: var(--ec-paper);
	background-color: var(--ec-ink);
	background-image:
		linear-gradient(var(--ec-line-strong) 1px, transparent 1px),
		linear-gradient(90deg, var(--ec-line-strong) 1px, transparent 1px),
		linear-gradient(var(--ec-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--ec-line) 1px, transparent 1px),
		radial-gradient(120% 80% at 0% 0%, var(--ec-ink-2) 0%, var(--ec-ink) 60%);
	background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px, 100% 100%;
	overflow: hidden;
}

/* Sheet border, inset like a drawing frame */
.ec-brand::before {
	content: "";
	position: absolute;
	inset: 16px;
	border: 1px solid var(--ec-line-strong);
	pointer-events: none;
}

.ec-brand > * {
	position: relative;
}

.ec-brand-top {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ec-mark {
	display: inline-grid;
	place-items: center;
	inline-size: 36px;
	block-size: 36px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #fff;
	background: linear-gradient(135deg, #2563eb, #7c3aed 55%, #db2777);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	flex-shrink: 0;
}

.ec-mark--sm {
	inline-size: 32px;
	block-size: 32px;
	border-radius: 8px;
	font-size: 12px;
}

.ec-brand-name {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.ec-brand-body {
	max-width: 520px;
}

.ec-eyebrow {
	margin: 0 0 16px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ec-teal);
}

html[dir="rtl"] .ec-eyebrow {
	letter-spacing: 0;
}

.ec-brand-title {
	margin: 0 0 16px;
	font-size: clamp(28px, 3vw, 40px);
	line-height: 1.15;
	font-weight: 650;
	letter-spacing: -0.02em;
	color: #fff;
}

.ec-brand-copy {
	margin: 0 0 32px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--ec-muted);
}

/* Lifecycle as a dimension line: ticks on a rule, labels below */
.ec-stages {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--ec-line-strong);
}

.ec-stages li {
	position: relative;
	padding-top: 12px;
	padding-inline-end: 6px;
	font-size: 12px;
	color: var(--ec-muted);
	overflow-wrap: anywhere;
}

.ec-stages li::before {
	content: "";
	position: absolute;
	top: -5px;
	inset-inline-start: 0;
	inline-size: 1px;
	block-size: 9px;
	background: var(--ec-muted);
}

.ec-stages li:nth-child(-n + 3) {
	color: var(--ec-paper);
}

.ec-stages li:nth-child(3)::before {
	inline-size: 9px;
	block-size: 9px;
	top: -5px;
	inset-inline-start: -4px;
	border-radius: 50%;
	background: var(--ec-teal);
	box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.18);
}

/* Title block, bottom inline-end corner */
.ec-title-block {
	align-self: flex-end;
	display: grid;
	grid-template-columns: repeat(4, auto);
	margin: 0;
	min-width: 340px;
	border: 1px solid var(--ec-line-strong);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: rgba(14, 26, 43, 0.6);
}

.ec-tb-cell {
	padding: 6px 10px;
	border-inline-end: 1px solid var(--ec-line-strong);
	border-bottom: 1px solid var(--ec-line-strong);
}

.ec-tb-wide {
	grid-column: span 2;
}

.ec-tb-cell:nth-child(3n) {
	border-inline-end: 0;
}

.ec-tb-cell:nth-last-child(-n + 3) {
	border-bottom: 0;
}

.ec-tb-cell dt {
	font-size: 9px;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ec-muted);
}

.ec-tb-cell dd {
	margin: 2px 0 0;
	font-size: 12px;
	color: var(--ec-paper);
	white-space: nowrap;
}

/* ---------- Form panel ---------- */

.ec-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 24px;
	padding: 48px 24px;
	background: var(--surface-white, #fff);
}

.ec-panel > section {
	width: 100%;
}

body.ec-login .for-login .page-card,
body.ec-login .for-forgot .page-card,
body.ec-login .for-signup .page-card,
body.ec-login .for-email-login .page-card,
body.ec-login .for-login-with-email-link .page-card {
	max-width: 380px;
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.ec-card-head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	text-align: start;
}

.ec-card-head .ec-mark {
	margin-bottom: 8px;
}

.ec-card-title {
	margin: 0;
	font-size: 24px;
	font-weight: 650;
	letter-spacing: -0.01em;
	color: var(--ink-gray-9, #171717);
}

.ec-card-subtitle {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ink-gray-6, #525252);
}

.ec-label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
}

.ec-link-muted,
.ec-card-foot a {
	font-size: 13px;
	font-weight: 500;
	color: var(--ink-gray-6, #525252);
	text-decoration: none;
}

.ec-link-muted:hover,
.ec-card-foot a:hover {
	color: var(--ink-gray-9, #171717);
	text-decoration: underline;
}

.ec-card-foot {
	margin: 0;
	text-align: center;
	font-size: 13px;
	color: var(--ink-gray-5, #737373);
}

.ec-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 12px;
	color: var(--ink-gray-5, #737373);
}

.ec-divider::before,
.ec-divider::after {
	content: "";
	flex: 1;
	border-top: 1px solid var(--outline-gray-2, #e5e5e5);
}

.ec-help {
	margin: 0;
	max-width: 380px;
	width: 100%;
	font-size: 12px;
	text-align: center;
	color: var(--ink-gray-5, #737373);
}

.ec-noscript {
	max-width: 380px;
	text-align: center;
	color: var(--ink-gray-7, #404040);
}

/* Two-factor form (login.js replaces .login-content with it) */
body.ec-login #twofactor_div .form-control {
	margin-top: 12px;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
	.ec-auth {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
	}

	.ec-brand {
		gap: 0;
		padding: 20px 24px;
	}

	.ec-brand::before {
		inset: 8px;
	}

	.ec-brand-body,
	.ec-title-block {
		display: none;
	}

	.ec-panel {
		justify-content: flex-start;
		padding: 40px 16px 32px;
	}

	/* Frappe makes the card full-height on phones; not needed under a header */
	body.ec-login .page-card {
		min-height: 0 !important;
		padding: 0 !important;
	}
}
