/**
 * Login screen.
 *
 * Two columns: the navy product panel and the form. Everything is scoped to
 * body.ess-login so a second login-styling plugin, or wp-login used for
 * anything else, is left alone.
 */

@import url('ess-fonts.css');

body.ess-login {
	--ess-navy: #1e2835;
	--ess-ink: #16191D;
	--ess-ink-muted: #5B636B;
	--ess-border: #DCE1E6;
	--ess-green: #2F9E44;
	--ess-green-hover: #28913D;
	--ess-green-shadow: #218038;

	margin: 0;
	padding: 0;
	min-height: 100vh;
	background: #fff;
	font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;

	display: grid;
	grid-template-columns: 1fr min(480px, 44%);
	align-items: stretch;
}

/* The panel is emitted last in the source but belongs on the left. */
body.ess-login .ess-login__aside {
	grid-column: 1;
	grid-row: 1;
	background: var(--ess-navy);
	color: #fff;
	padding: clamp(28px, 4vw, 48px);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 32px;
}

/* wp-login.php does not set border-box, unlike the rest of wp-admin, so
   padding and borders would otherwise be added on top of every width and push
   the form past its column. */
body.ess-login #login,
body.ess-login #login *,
body.ess-login .ess-login__aside,
body.ess-login .ess-login__aside * {
	box-sizing: border-box;
}

body.ess-login #login {
	grid-column: 2;
	grid-row: 1;
	width: 100%;
	max-width: 380px;
	margin: 0;
	padding: 32px 20px;
	justify-self: center;
	align-self: center;
}

/* Core centres the login heading; the brief sets the column left-aligned. */
body.ess-login #login h1,
body.ess-login #login h1 a,
body.ess-login #login form p,
body.ess-login #login .submit {
	text-align: left;
}

/* Anything else wp-login prints — privacy link, language switcher — sits
   under the form rather than escaping into the navy panel. */
body.ess-login > *:not(.ess-login__aside):not(#login) {
	grid-column: 2;
	grid-row: 1;
	align-self: end;
	justify-self: center;
	padding-bottom: 20px;
}

/* ---------- navy panel ---------- */

.ess-login__logo {
	height: 54px;
	width: auto;
	filter: brightness(0) invert(1);
}

.ess-login__badge {
	display: inline-block;
	background: rgba(47, 158, 68, .18);
	border: 1px solid rgba(47, 158, 68, .4);
	color: #7BE29A;
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 20px;
}

.ess-login__title {
	font-family: 'Archivo', sans-serif;
	font-weight: 800;
	font-size: clamp(34px, 4.6vw, 48px);
	line-height: 1.04;
	letter-spacing: -.02em;
	color: #fff;
	margin: 0 0 18px;
}

.ess-login__body {
	font-size: 17px;
	line-height: 1.6;
	color: #AEB6BF;
	margin: 0;
	max-width: 46ch;
}

.ess-login__footer {
	font-size: 13px;
	color: #7E8893;
	margin: 0;
}

/* ---------- form column ---------- */

body.ess-login #login h1 {
	margin: 0 0 6px;
	padding: 0;
}

/* Core renders the heading as a logo sprite; this turns it back into text. */
body.ess-login #login h1 a {
	background: none;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	text-indent: 0;
	font-family: 'Archivo', sans-serif;
	font-weight: 700;
	font-size: 26px;
	line-height: 1.2;
	color: var(--ess-ink);
	text-decoration: none;
	overflow: visible;
}

body.ess-login .ess-login__sub {
	font-size: 15px;
	color: var(--ess-ink-muted);
	margin: 0 0 22px;
}

body.ess-login #loginform,
body.ess-login #lostpasswordform,
body.ess-login #resetpassform,
body.ess-login #registerform {
	background: none;
	border: none;
	box-shadow: none;
	padding: 0;
	margin: 0;
}

body.ess-login #login form p {
	margin-bottom: 14px;
}

body.ess-login #login label {
	font-size: 13px;
	font-weight: 600;
	color: var(--ess-ink-muted);
}

body.ess-login #login input[type="text"],
body.ess-login #login input[type="password"],
body.ess-login #login input[type="email"] {
	display: block;
	width: 100%;
	background: #fff;
	border: 1.5px solid var(--ess-border);
	border-radius: 10px;
	padding: 12px 13px;
	font-size: 15px;
	line-height: 1.4;
	color: var(--ess-ink);
	min-height: 46px;
	box-shadow: none;
	margin: 6px 0 0;
}

body.ess-login #login input[type="text"]:focus,
body.ess-login #login input[type="password"]:focus,
body.ess-login #login input[type="email"]:focus {
	border-color: var(--ess-green);
	box-shadow: none;
	outline: 2px solid transparent;
	outline-offset: 2px;
}

body.ess-login .wp-pwd .button.wp-hide-pw {
	top: 6px;
	right: 4px;
	color: var(--ess-ink-muted);
}

body.ess-login .wp-pwd .button.wp-hide-pw:hover {
	color: var(--ess-ink);
}

body.ess-login #login .forgetmenot {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	color: var(--ess-ink-muted);
	float: none;
	margin-bottom: 16px;
}

body.ess-login #login .submit {
	margin: 0;
}

body.ess-login #login .button-primary {
	display: block;
	width: 100%;
	height: auto;
	float: none;
	background: var(--ess-green);
	border: none;
	border-radius: 12px;
	box-shadow: 0 2px 0 var(--ess-green-shadow);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	min-height: 48px;
	padding: 14px 20px;
	text-shadow: none;
	transition: background .15s ease;
}

body.ess-login #login .button-primary:hover,
body.ess-login #login .button-primary:focus {
	background: var(--ess-green-hover);
	border: none;
	box-shadow: 0 2px 0 var(--ess-green-shadow);
	color: #fff;
}

body.ess-login #nav,
body.ess-login #backtoblog {
	padding: 0;
	margin: 16px 0 0;
	text-align: left;
}

body.ess-login #nav a,
body.ess-login #backtoblog a {
	font-size: 13.5px;
	color: var(--ess-ink-muted);
	text-decoration: underline;
	text-underline-offset: 2px;
}

body.ess-login #nav a:hover,
body.ess-login #backtoblog a:hover,
body.ess-login #login a:focus {
	color: var(--ess-green);
	box-shadow: none;
}

body.ess-login #login .notice,
body.ess-login #login .message,
body.ess-login #login #login_error {
	background: #FFF6E5;
	border: 1px solid #F7E0AE;
	border-left-width: 1px;
	border-radius: 10px;
	color: #C77700;
	font-size: 13.5px;
	padding: 12px 14px;
	margin: 0 0 18px;
	box-shadow: none;
}

body.ess-login #login #login_error {
	background: #FDF2F2;
	border-color: #F3C9C9;
	color: #C0341C;
}

body.ess-login .language-switcher {
	margin-top: 18px;
}

/* ---------- responsive ---------- */

@media (max-width: 782px) {
	body.ess-login {
		grid-template-columns: 1fr;
		min-height: 100%;
	}

	body.ess-login .ess-login__aside {
		grid-row: 1;
		gap: 20px;
		padding: 26px 22px 30px;
	}

	body.ess-login .ess-login__logo {
		height: 40px;
	}

	body.ess-login .ess-login__title {
		font-size: clamp(26px, 7vw, 34px);
	}

	body.ess-login .ess-login__body {
		font-size: 15px;
	}

	body.ess-login .ess-login__footer {
		display: none;
	}

	body.ess-login #login,
	body.ess-login > *:not(.ess-login__aside):not(#login) {
		grid-column: 1;
		grid-row: 2;
		align-self: start;
	}

	body.ess-login > *:not(.ess-login__aside):not(#login) {
		grid-row: 3;
		padding-bottom: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.ess-login * {
		transition-duration: .01ms !important;
	}
}
