/* ==========================================================================
   ConnectHear Hub theme: the login page (a web template, frappe/www/login.html).
   docs/custom-apps.md > Hub theme.

   Scoped under body.ch-theme, which hr_automations/theme.py adds through the
   update_website_context hook when site_config ch_theme_all is on (the login page
   has no session, so it cannot follow ch_theme_users). Frappe v16's own classes (www/login.html, includes/login/login.js; built login.bundle + website.bundle):
   .for-login .page-card (.login-content), .page-card-head, .page-card-body, .form-group, .email-field / .password-field with
   .toggle-password, .page-card-actions holding the .es-button rows (data-variant="solid" = Continue, .btn-login-option = the
   other ways in), .sign-up-message, and the two-factor step (.form-verify, #otp_div). v16 dropped four names this file used:
   .btn-login (the button is an .es-button now), .field-icon (no icon in the field), .forgot-password-message (a plain
   p.text-right link) and .login-divider (no "or" rule). Fonts come from ch_theme_fonts.css (web_include_css).

   Design system > Login: a centred 428px card on the warm ground, two faint brand
   circles, radius 16, 32px padding, the login shadow; 46px inputs on bg, radius 12;
   a 48px teal-strong button with the primary shadow.
   ========================================================================== */

body.ch-theme {
	--ch-bg: #f5f2ec;
	--ch-surface: #ffffff;
	--ch-text: #20292b;
	--ch-muted: #676e71;
	--ch-border: #ece7df;
	--ch-border-strong: #d9d5cf;
	--ch-teal: #159aa0;
	--ch-teal-strong: #0e7c81;
	--ch-teal-deep: #0c6f73;
	--ch-teal-tint: #e3f4f4;
	--ch-orange-tint: #fceedd;
	--ch-red: #c4392a;
	--ch-on-fill: #ffffff;
	--ch-font-display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
	--ch-font-body: "Plus Jakarta Sans", system-ui, sans-serif;
	--ch-radius-inner: 12px;
	--ch-radius-card: 16px;
	--ch-shadow-login: 0 24px 60px rgba(30, 26, 24, 0.10);
	--ch-shadow-primary: 0 8px 18px rgba(21, 154, 160, 0.28);

	position: relative;
	min-height: 100vh;
	margin: 0;
	font-family: var(--ch-font-body);
	font-size: 15px;
	line-height: 1.5;
	color: var(--ch-text);
	background-color: var(--ch-bg);
	overflow-x: hidden;
}
/* v16's tokens on this page: the login has no html[data-ch-theme] (it has no session), so the semantic greys its labels, links,
   placeholders and borders read are set here on the body, to the same brand values as the desk's section 0a (the greys that carry
   text keep 4.5:1 on white). The page's own component rules below do the rest. */
body.ch-theme {
	--ink-gray-4: #8b9295;                    /* placeholders: never text */
	--ink-gray-5: var(--ch-muted);
	--ink-gray-6: #4d5659;
	--ink-gray-8: var(--ch-text);
	--ink-gray-9: var(--ch-text);
	--outline-gray-1: var(--ch-border);
	--outline-gray-2: var(--ch-border-strong);
	--ink-blue-link: var(--ch-teal-deep);
}
body.ch-theme ::selection { background: var(--ch-teal-tint); }
/* the two faint brand circles (Login > circles): teal-tint top-left at 0.5, orange-tint bottom-right at 0.55 */
body.ch-theme::before,
body.ch-theme::after {
	content: "";
	position: fixed;
	border-radius: 50%;
	pointer-events: none;
	z-index: 0;
}
body.ch-theme::before { width: 520px; height: 520px; top: -180px; left: -160px; background: var(--ch-teal-tint); opacity: 0.5; }
body.ch-theme::after { width: 360px; height: 360px; right: -120px; bottom: -120px; background: var(--ch-orange-tint); opacity: 0.55; }
body.ch-theme .page-content-wrapper,
body.ch-theme .navbar { position: relative; z-index: 1; }
body.ch-theme .page-content-wrapper { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 16px; }
body.ch-theme .web-footer { display: none; }

/* card: 428 wide, white, bordered, radius 16, padding 32, the one card that floats */
body.ch-theme .for-login .page-card,
body.ch-theme .for-forgot .page-card,
body.ch-theme .for-email-login .page-card,
body.ch-theme .for-signup .page-card,
body.ch-theme .for-login-with-email-link .page-card,
body.ch-theme .for-reset-password .page-card {
	max-width: 428px;
	padding: 32px;
	background: var(--ch-surface);
	border: 1px solid var(--ch-border);
	border-radius: var(--ch-radius-card);
	box-shadow: var(--ch-shadow-login);
}
body.ch-theme .for-login .page-card form,
body.ch-theme .for-forgot .page-card form { max-width: none; }
/* head: wordmark 38px tall, title display 27/800 tight */
body.ch-theme .page-card-head { padding: 0 0 20px; }
body.ch-theme .page-card-head img { max-height: 38px; }
body.ch-theme .page-card-head h4 {
	margin-top: 16px;
	font-family: var(--ch-font-display);
	font-size: 27px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--ch-text);
}
/* inputs: 46px, bg fill, 1px border, radius 12, 14px; 16px between fields; focus is one crisp 2px teal-strong border */
body.ch-theme .for-login .page-card .page-card-body input[type="text"],
body.ch-theme .for-login .page-card .page-card-body input[type="email"],
body.ch-theme .for-login .page-card .page-card-body input[type="password"],
body.ch-theme .for-forgot .page-card .page-card-body input[type="email"],
body.ch-theme .for-email-login .page-card .page-card-body input[type="email"],
body.ch-theme .for-login-with-email-link .page-card .page-card-body input[type="email"],
body.ch-theme .for-login .page-card .form-verify input[type="text"] {
	height: 46px;
	margin-bottom: 0;
	padding: 0 16px;
	font-family: var(--ch-font-body);
	font-size: 14px;
	color: var(--ch-text);
	background-color: var(--ch-bg);
	border: 1px solid var(--ch-border);
	border-radius: var(--ch-radius-inner);
	box-shadow: none;
}
body.ch-theme .page-card .page-card-body input:focus,
body.ch-theme .for-login .page-card .form-verify input:focus {
	border-color: var(--ch-teal-strong);
	box-shadow: inset 0 0 0 1px var(--ch-teal-strong);
	background-color: var(--ch-surface);
	outline: 0;
}
body.ch-theme .page-card .page-card-body ::placeholder { color: var(--ch-muted); opacity: 1; }
/* v16 pads the password input to the right for the eye icon; the 16px above would put the dots under it */
body.ch-theme .for-login .page-card .page-card-body .password-field input[type="password"] { padding-right: 40px; }
body.ch-theme .page-card .page-card-body .form-group { margin-bottom: 16px; }
body.ch-theme .page-card .page-card-body.invalid input[type="text"],
body.ch-theme .page-card .page-card-body.invalid input[type="email"],
body.ch-theme .page-card .page-card-body.invalid input[type="password"] { border: 1px solid var(--ch-red); }
/* the "Forgot password?" link: a plain right-aligned p.text-right > a under the password field */
body.ch-theme .page-card .page-card-body p.text-right { margin: -4px 0 0; }
body.ch-theme .page-card .page-card-body p.text-right a { font-size: 13px; font-weight: 600; color: var(--ch-teal-deep); }
/* the Continue / Send Link / Create Account / Verify buttons: v16's .es-button[data-variant="solid"], full width, 48px, 15/700, radius 12,
   teal-strong with the primary shadow. The button declares its --bt-* tokens on itself, so they are set on it here (not on the body).
   Hover and press teal-deep; white text 4.98:1. The base .es-button rule is in the website bundle, which this page loads. */
body.ch-theme .page-card .page-card-actions { margin-top: 20px; }
body.ch-theme .page-card .es-button[data-variant="solid"] {
	--bt-solid-bg: var(--ch-teal-strong);
	--bt-solid-bg-hover: var(--ch-teal-deep);
	--bt-solid-bg-active: var(--ch-teal-deep);
	--bt-solid-fg: var(--ch-on-fill);
	height: 48px;
	padding: 0 20px;
	font-family: var(--ch-font-body);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
	border-radius: var(--ch-radius-inner);
	box-shadow: var(--ch-shadow-primary);
}
body.ch-theme .page-card .es-button:focus-visible { outline: 2px solid var(--ch-teal-strong); outline-offset: 2px; }
/* the two-factor code step (frappe's login.js request_otp replaces the card's body with form.form-verify:
   a "Verification" pill, the emailed-code line, one text input without a field icon, the Verify button) */
body.ch-theme .for-login .page-card .form-verify .page-card-head.p-0 { padding: 0 0 12px; text-align: left; }
body.ch-theme .for-login .page-card .form-verify #otp_div { margin-bottom: 16px; font-size: 14px; line-height: 1.5; color: var(--ch-muted); }
body.ch-theme .for-login .page-card .form-verify input[type="text"] { padding: 0 16px; }
body.ch-theme .page-card .form-verify .es-button { margin-top: 20px; }
/* the other ways in ("Login with Email Link", a social login): 46px white bordered buttons, 14/600; they are .es-button without a variant,
   in .page-card-actions (v16 has no "or" divider between them) */
body.ch-theme .page-card .page-card-actions .social-logins { margin-top: 0; }
body.ch-theme .page-card .page-card-actions .social-login-buttons { margin-top: 0; }
body.ch-theme .page-card .page-card-actions .social-login-buttons .login-button-wrapper { padding: 0; margin-bottom: 12px; }
body.ch-theme .page-card .page-card-actions .btn-login-option {
	height: 46px;
	gap: 12px;
	font-family: var(--ch-font-body);
	font-size: 14px;
	font-weight: 600;
	color: var(--ch-text);
	background: var(--ch-surface);
	border: 1px solid var(--ch-border);
	border-radius: var(--ch-radius-inner);
}
body.ch-theme .page-card .page-card-actions .btn-login-option:hover { background: var(--ch-bg); border-color: var(--ch-border-strong); color: var(--ch-text); }
body.ch-theme .page-card .page-card-actions .btn-login-option img { width: 18px; height: 18px; }
body.ch-theme .sign-up-message { margin-top: 16px; font-size: 13px; color: var(--ch-muted); }
body.ch-theme .sign-up-message a { color: var(--ch-teal-deep); font-weight: 600; }
body.ch-theme .for-login .indicator,
body.ch-theme .for-signup .indicator { font-size: 13px; }

@media (max-width: 480px) {
	body.ch-theme .for-login .page-card,
	body.ch-theme .for-forgot .page-card,
	body.ch-theme .for-email-login .page-card,
	body.ch-theme .for-signup .page-card,
	body.ch-theme .for-login-with-email-link .page-card,
	body.ch-theme .for-reset-password .page-card { padding: 24px 20px; }
	body.ch-theme::before { width: 360px; height: 360px; top: -160px; left: -140px; }
	body.ch-theme::after { width: 260px; height: 260px; }
}
