/* AlfaGate web and login presentation. App-owned and Frappe upgrade-safe. */

:root {
	--ag-login-canvas: #f8f7f4;
	--ag-login-surface: #ffffff;
	--ag-login-ink: #29252f;
	--ag-login-muted: #706a77;
	--ag-login-line: #e6e1e8;
	--ag-login-accent: #7557d8;
	--ag-login-accent-strong: #6043c2;
	--ag-login-accent-soft: #f0ebff;
	--ag-login-danger: #a52c43;
	--ag-login-danger-soft: #fff1f3;
	--ag-login-brand-surface: #302b3a;
	--ag-login-brand-muted: #c8c1cf;
	--ag-login-focus: #9278ea;
}

.ag-login-page {
	min-width: 320px;
	background: var(--ag-login-canvas);
	color: var(--ag-login-ink);
	font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system,
		BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ag-login-page .navbar,
.ag-login-page .web-footer,
.ag-login-page footer.web-footer {
	display: none !important;
}

.ag-login-page .main-section,
.ag-login-page .page_content,
.ag-login-page main {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

.ag-login-page .for-login {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 24px;
}

.ag-login-shell {
	display: grid;
	grid-template-columns: minmax(360px, 0.92fr) minmax(460px, 1.08fr);
	width: min(1180px, 100%);
	min-height: min(760px, calc(100vh - 48px));
	margin: 0 auto;
	overflow: hidden;
	border: 1px solid rgb(41 37 47 / 8%);
	border-radius: 28px;
	background: var(--ag-login-surface);
	box-shadow: 0 28px 80px rgb(48 43 58 / 12%);
}

.ag-login-brand {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-width: 0;
	padding: clamp(32px, 5vw, 64px);
	background:
		radial-gradient(circle at 12% 8%, rgb(137 105 235 / 28%), transparent 36%),
		linear-gradient(145deg, #383144 0%, var(--ag-login-brand-surface) 68%);
	color: #fff;
}

.ag-login-brand__top {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ag-login-mark {
	display: grid;
	width: 38px;
	height: 38px;
	place-items: center;
	border: 1px solid rgb(255 255 255 / 22%);
	border-radius: 12px;
	background: var(--ag-login-accent);
	color: #fff;
	font-size: 18px;
	font-weight: 800;
}

.ag-login-wordmark {
	font-size: 19px;
	font-weight: 750;
	letter-spacing: -0.03em;
}

.ag-login-brand__story {
	max-width: 480px;
	margin-block: 48px;
}

.ag-login-eyebrow {
	margin: 0 0 12px;
	color: var(--ag-login-accent);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.13em;
}

.ag-login-brand .ag-login-eyebrow {
	color: #b8a7f6;
}

.ag-login-brand h1 {
	margin: 0;
	color: #fff;
	font-size: clamp(2.2rem, 4.8vw, 4.6rem);
	font-weight: 700;
	line-height: 1.02;
	letter-spacing: -0.055em;
}

.ag-login-brand__story > p:last-child {
	max-width: 40ch;
	margin: 22px 0 0;
	color: var(--ag-login-brand-muted);
	font-size: 1rem;
	line-height: 1.65;
}

.ag-login-capabilities {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ag-login-capabilities li {
	display: flex;
	align-items: center;
	min-height: 48px;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid rgb(255 255 255 / 12%);
	border-radius: 12px;
	background: rgb(255 255 255 / 6%);
	color: #f6f3fa;
	font-size: 13px;
	font-weight: 650;
}

.ag-login-capabilities svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	fill: none;
	stroke: #b9a8f5;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.ag-login-auth {
	display: flex;
	width: min(100%, 560px);
	flex-direction: column;
	justify-content: center;
	margin: auto;
	padding: clamp(32px, 6vw, 76px);
}

.ag-login-intro h2 {
	margin: 0;
	color: var(--ag-login-ink);
	font-size: clamp(1.9rem, 3vw, 2.55rem);
	font-weight: 720;
	line-height: 1.16;
	letter-spacing: -0.045em;
}

.ag-login-intro > p:last-child {
	margin: 12px 0 0;
	color: var(--ag-login-muted);
	font-size: 0.95rem;
	line-height: 1.55;
}

.ag-login-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	margin: 28px 0 24px;
	padding: 4px;
	border-radius: 12px;
	background: #f1eef3;
}

.ag-login-tabs button {
	min-height: 44px;
	padding: 8px 12px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--ag-login-muted);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
}

.ag-login-tabs button[aria-selected="true"] {
	background: #fff;
	color: var(--ag-login-ink);
	box-shadow: 0 3px 10px rgb(49 39 62 / 8%);
}

.ag-otp-panel {
	min-width: 0;
}

.ag-login-page :where(button, input, a):focus-visible {
	outline: 3px solid var(--ag-login-focus) !important;
	outline-offset: 2px;
	box-shadow: none !important;
}

.ag-login-email-panel > .page-card-head {
	display: none;
}

.ag-login-page .login-content.page-card {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.ag-login-page .page-card .page-card-body,
.ag-login-page .page-card .page-card-actions {
	padding: 0;
}

.ag-login-page .form-group {
	margin-bottom: 18px;
}

.ag-login-page .form-label,
.ag-otp-form label,
.ag-role-choice legend {
	display: block;
	margin: 0 0 7px;
	color: var(--ag-login-ink);
	font-size: 13px;
	font-weight: 700;
}

.ag-login-page .form-label.sr-only {
	position: static !important;
	width: auto !important;
	height: auto !important;
	overflow: visible !important;
	clip: auto !important;
	white-space: normal !important;
}

.ag-login-page .form-control,
.ag-otp-form input:not([type="radio"]) {
	width: 100%;
	min-height: 48px;
	padding: 11px 14px 11px 42px;
	border: 1px solid #cfc8d3;
	border-radius: 11px;
	background: #fff;
	color: var(--ag-login-ink);
	font: inherit;
	font-size: 1rem;
	line-height: 1.4;
}

.ag-login-page .form-control:hover,
.ag-otp-form input:not([type="radio"]):hover {
	border-color: #a69dad;
}

.ag-login-page .form-control:focus,
.ag-otp-form input:not([type="radio"]):focus {
	border-color: var(--ag-login-accent);
	outline: 0;
	box-shadow: 0 0 0 3px rgb(117 87 216 / 15%);
}

.ag-login-page .field-icon {
	left: 14px;
	color: var(--ag-login-muted);
}

.ag-login-page .toggle-password {
	right: 12px;
	min-height: 44px;
	padding: 13px 4px;
	color: var(--ag-login-accent-strong) !important;
	font-size: 12px;
	font-weight: 700;
}

.ag-login-page .forgot-password-message {
	margin: -4px 0 18px;
	text-align: right;
}

.ag-login-page a,
.ag-text-button {
	color: var(--ag-login-accent-strong);
	font-weight: 650;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.ag-login-page .btn-primary,
.ag-login-primary {
	width: 100%;
	min-height: 48px;
	padding: 11px 16px;
	border: 1px solid var(--ag-login-accent) !important;
	border-radius: 11px;
	background: var(--ag-login-accent) !important;
	color: #fff !important;
	font: inherit;
	font-size: 14px;
	font-weight: 750;
	box-shadow: 0 8px 22px rgb(117 87 216 / 20%);
	cursor: pointer;
}

.ag-login-page .btn-primary:hover,
.ag-login-primary:hover {
	border-color: var(--ag-login-accent-strong) !important;
	background: var(--ag-login-accent-strong) !important;
}

.ag-login-page button:disabled {
	cursor: wait;
	opacity: 0.68;
}

.ag-login-page .login-divider {
	margin: 22px 0 12px;
}

.ag-login-page .btn-default,
.ag-login-page .btn-login-option {
	min-height: 44px;
	border: 1px solid var(--ag-login-line);
	border-radius: 10px;
	background: #fff;
	color: var(--ag-login-ink);
	font-weight: 650;
}

.ag-role-choice {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 9px;
	margin: 0 0 20px;
	padding: 0;
	border: 0;
}

.ag-role-choice legend {
	grid-column: 1 / -1;
}

.ag-role-choice label {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.ag-role-choice input {
	position: absolute;
	opacity: 0;
}

.ag-role-choice span {
	display: grid;
	min-height: 44px;
	place-items: center;
	border: 1px solid var(--ag-login-line);
	border-radius: 10px;
	background: #fff;
	color: var(--ag-login-muted);
	font-size: 13px;
	font-weight: 700;
}

.ag-role-choice input:checked + span {
	border-color: var(--ag-login-accent);
	background: var(--ag-login-accent-soft);
	color: var(--ag-login-accent-strong);
}

.ag-role-choice input:focus-visible + span {
	outline: 3px solid var(--ag-login-focus);
	outline-offset: 2px;
}

.ag-mobile-input {
	position: relative;
}

.ag-mobile-input > span {
	position: absolute;
	z-index: 1;
	top: 50%;
	left: 14px;
	color: var(--ag-login-muted);
	font-size: 14px;
	font-weight: 700;
	transform: translateY(-50%);
}

.ag-mobile-input input {
	padding-left: 52px !important;
}

.ag-field-help,
.ag-otp-sent {
	margin: 8px 0 18px;
	color: var(--ag-login-muted);
	font-size: 12px;
	line-height: 1.55;
}

.ag-otp-code-step > input {
	padding-left: 14px !important;
	letter-spacing: 0.28em;
	text-align: center;
}

.ag-otp-code-step .ag-login-primary {
	margin-top: 18px;
}

.ag-otp-secondary {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 10px;
}

.ag-text-button {
	min-height: 44px;
	padding: 8px 2px;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 12px;
	cursor: pointer;
}

.ag-login-status:not(:empty),
.ag-login-error:not(:empty) {
	margin-top: 14px;
	padding: 11px 13px;
	border-radius: 9px;
	font-size: 12px;
	line-height: 1.5;
}

.ag-login-status:not(:empty) {
	border: 1px solid #d7cfee;
	background: var(--ag-login-accent-soft);
	color: #553d9d;
}

.ag-login-error:not(:empty) {
	border: 1px solid #efc3cb;
	background: var(--ag-login-danger-soft);
	color: var(--ag-login-danger);
}

.ag-login-page :where(.for-forgot, .for-login-with-email-link, .for-signup) {
	width: min(480px, calc(100% - 32px));
	margin: clamp(40px, 10vh, 100px) auto;
	padding: clamp(24px, 5vw, 42px);
	border: 1px solid var(--ag-login-line);
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 24px 70px rgb(48 43 58 / 10%);
}

.ag-login-page :where(.for-forgot, .for-login-with-email-link, .for-signup) .page-card-head h4 {
	color: var(--ag-login-ink);
	font-size: 1.8rem;
	letter-spacing: -0.04em;
}

.ag-login-page :where(.for-forgot, .for-login-with-email-link, .for-signup) .app-logo {
	width: 54px;
	height: 54px;
	margin-bottom: 16px;
	object-fit: contain;
	border-radius: 12px;
}

@media (max-width: 940px) {
	.ag-login-page .for-login {
		padding: 16px;
	}

	.ag-login-shell {
		grid-template-columns: minmax(300px, 0.78fr) minmax(420px, 1.22fr);
		min-height: calc(100vh - 32px);
		border-radius: 22px;
	}

	.ag-login-brand {
		padding: 32px;
	}

	.ag-login-brand h1 {
		font-size: clamp(2.1rem, 5vw, 3.4rem);
	}

	.ag-login-auth {
		padding: 38px;
	}
}

/* Keep the complete desktop sign-in journey visible on short laptop windows. */
@media (min-width: 761px) and (max-height: 820px) {
	.ag-login-page .for-login {
		padding: 16px;
	}

	.ag-login-shell {
		min-height: calc(100vh - 64px);
		min-height: calc(100dvh - 64px);
		border-radius: 22px;
	}

	.ag-login-brand {
		padding: 28px 32px;
	}

	.ag-login-brand__story {
		margin-block: 20px;
	}

	.ag-login-brand h1 {
		font-size: clamp(2.2rem, 4.2vw, 3.7rem);
	}

	.ag-login-brand__story > p:last-child {
		margin-top: 14px;
		line-height: 1.5;
	}

	.ag-login-auth {
		padding: 28px 38px;
	}

	.ag-login-tabs {
		margin: 16px 0 14px;
	}

	.ag-login-page .form-group {
		margin-bottom: 12px;
	}

	.ag-login-page .forgot-password-message {
		margin: -2px 0 12px;
	}

	.ag-login-page .login-divider {
		margin: 14px 0 8px;
	}

	.ag-login-status:not(:empty),
	.ag-login-error:not(:empty) {
		margin-top: 10px;
		padding-block: 8px;
	}
}

@media (max-width: 760px) {
	.ag-login-page .for-login {
		padding: 0;
	}

	.ag-login-shell {
		display: flex;
		min-height: 100vh;
		flex-direction: column;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.ag-login-brand {
		display: flex;
		min-height: auto;
		flex-direction: row;
		align-items: center;
		padding: 18px 20px;
	}

	.ag-login-brand__story,
	.ag-login-capabilities {
		display: none;
	}

	.ag-login-auth {
		width: 100%;
		max-width: 560px;
		justify-content: flex-start;
		padding: clamp(30px, 8vw, 48px) 20px 44px;
	}

	.ag-login-tabs {
		margin-top: 24px;
	}
}

@media (max-width: 380px) {
	.ag-login-tabs {
		grid-template-columns: 1fr;
	}

	.ag-role-choice {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ag-login-page *,
	.ag-login-page *::before,
	.ag-login-page *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

@media (forced-colors: active) {
	.ag-login-tabs button[aria-selected="true"],
	.ag-role-choice input:checked + span {
		border: 2px solid CanvasText;
	}
}

/* Hide framework brand links without removing page-owned support content. */
a[href*="frappeframework.com"],
a[href*="erpnext.com"],
a[href*="frappe.io"],
.frappe-footer,
.frappe-brand,
.powered-by-frappe,
.footer-powered-by {
	display: none !important;
}

.web-footer,
footer.web-footer {
	border-top: 1px solid var(--border-color, #e8e8e8);
	padding: 20px 0;
	color: var(--text-muted, #888);
	font-size: 12px;
	text-align: center;
}
