/* Copyright (c) 2026, Cynktrontech and contributors
   For license information, please see license.txt */

/* Same design tokens as chat.css, duplicated rather than shared — two
   small static files, no bundler, and independent styling is fine at
   this scale. Keep these two files' :root blocks in sync by hand if the
   product's palette ever changes. */
:root {
	--chat-bg: #ffffff;
	--chat-sidebar-bg: #f7f7f8;
	--chat-surface: #f4f4f5;
	--chat-border: #e5e5e8;
	--chat-text: #1f1f1f;
	--chat-text-muted: #6b6b74;
	--chat-accent: #10a37f;
	--chat-accent-text: #ffffff;
	--chat-error: #d1453d;
	--chat-error-bg: #fdecea;
	--chat-success: #10a37f;
	--chat-success-bg: #e6f6f1;
}

@media (prefers-color-scheme: dark) {
	:root {
		--chat-bg: #212121;
		--chat-sidebar-bg: #171717;
		--chat-surface: #2f2f2f;
		--chat-border: #3a3a3a;
		--chat-text: #ececec;
		--chat-text-muted: #a0a0a8;
		--chat-accent: #10a37f;
		--chat-accent-text: #ffffff;
		--chat-error: #ff6b64;
		--chat-error-bg: #3a1f1e;
		--chat-success: #2fd1a5;
		--chat-success-bg: #163a30;
	}
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	margin: 0;
}

body {
	background: var(--chat-bg);
}

#login-app {
	display: flex;
	min-height: 100vh;
	min-height: 100dvh;
	color: var(--chat-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Brand panel ---------- */

#login-brand {
	flex: 1 1 42%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--chat-sidebar-bg);
	border-right: 1px solid var(--chat-border);
	padding: 40px;
}

#login-wordmark {
	font-size: 40px;
	font-weight: 600;
	letter-spacing: -0.02em;
	color: var(--chat-accent);
}

#login-logo {
	max-width: 220px;
	max-height: 96px;
}

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

#login-panel {
	flex: 1 1 58%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 24px;
}

#login-panel-inner {
	width: 100%;
	max-width: 360px;
}

.login-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.login-form__title {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
	color: var(--chat-text);
}

.login-form__subtitle {
	margin: -8px 0 4px;
	font-size: 13.5px;
	color: var(--chat-text-muted);
}

.login-form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.login-form-field label {
	font-size: 12.5px;
	color: var(--chat-text-muted);
}

.login-form-field input {
	padding: 10px 12px;
	border-radius: 8px;
	border: 1px solid var(--chat-border);
	background: var(--chat-surface);
	color: var(--chat-text);
	font-size: 14.5px;
	font-family: inherit;
}

.login-form-field input:focus {
	outline: 2px solid var(--chat-accent);
	outline-offset: -1px;
}

.login-form-error {
	color: var(--chat-error);
	background: var(--chat-error-bg);
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 13px;
}

.login-form-success {
	color: var(--chat-success);
	background: var(--chat-success-bg);
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 13px;
}

.login-form__actions {
	display: flex;
	margin-top: 4px;
}

.login-btn {
	border: none;
	border-radius: 8px;
	padding: 10px 16px;
	font-size: 14.5px;
	font-weight: 500;
	cursor: pointer;
}

.login-btn--primary {
	background: var(--chat-accent);
	color: var(--chat-accent-text);
}

.login-btn--primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.login-btn--block {
	width: 100%;
	text-align: center;
}

.login-form__links {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 2px;
}

.login-form__links .login-form__link {
	margin-top: 0;
	align-self: auto;
}

.login-form__link {
	align-self: center;
	margin-top: 2px;
	font-size: 13px;
	color: var(--chat-text-muted);
	text-decoration: none;
}

.login-form__link:hover {
	color: var(--chat-accent);
	text-decoration: underline;
}

/* ---------- Small screens: brand becomes a compact header ---------- */

@media (max-width: 860px) {
	#login-app {
		flex-direction: column;
	}

	#login-brand {
		flex: 0 0 auto;
		border-right: none;
		border-bottom: 1px solid var(--chat-border);
		padding: 24px;
	}

	#login-wordmark {
		font-size: 26px;
	}

	#login-logo {
		max-width: 160px;
		max-height: 64px;
	}

	#login-panel {
		padding: 32px 24px 40px;
	}
}
