/*
 * WPLock login screen.
 *
 * Rebuilt from the ECG Tools look: one white panel framed by the accent colour (logo, messages,
 * form and the lost-password link stacked inside it), underlined inputs, outlined square buttons.
 * Layout follows the normal flow; nothing is absolutely positioned.
 *
 * Every rule is scoped under body.wplock #login so it outranks the core login and button styles
 * without !important. --wplock-accent and --wplock-logo are set inline from the configuration.
 */

.wplock #login {
	width: 340px;
	max-width: calc(100% - 32px);
	padding-top: 6vh;
}

/* Logo: top of the panel. */
.wplock #login h1 {
	margin: 0;
	padding: 16px 10px 10px;
	background: #fff;
	border: 1px solid var(--wplock-accent);
	border-bottom: 0;
}

.wplock #login h1 a {
	width: 300px;
	max-width: 100%;
	height: 84px;
	margin: 0 auto;
	background-image: var(--wplock-logo);
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
	cursor: default;
}

.wplock #login h1 a:focus,
.wplock #login h1 a:hover {
	box-shadow: none;
	outline: 0;
}

/* Messages: middle of the panel. */
.wplock #login .notice,
.wplock #login .message,
.wplock #login #login_error {
	margin: 0;
	padding: 12px 24px;
	background: #fff;
	border: 1px solid var(--wplock-accent);
	border-top: 0;
	border-bottom: 0;
	border-radius: 0;
	box-shadow: none;
}

.wplock #login #login_error {
	color: #b32d2e;
}

/* Form: middle of the panel. */
.wplock #login form {
	margin: 0;
	padding: 20px 24px 16px;
	background: #fff;
	border: 1px solid var(--wplock-accent);
	border-top: 0;
	border-bottom: 0;
	border-radius: 0;
	box-shadow: none;
}

/* Stack the login form so the register button sits under the sign-in button. */
.wplock #login #loginform {
	display: flex;
	flex-direction: column;
}

.wplock #loginform .wplock-consent { order: 1; }
.wplock #loginform .forgetmenot { order: 2; }
.wplock #loginform .submit { order: 3; }
.wplock #loginform .wplock-register { order: 4; }

.wplock #login label {
	font-size: 14px;
}

.wplock #login input[type="text"],
.wplock #login input[type="email"],
.wplock #login input[type="password"] {
	padding: 4px 2px;
	font-size: 16px;
	color: #333;
	background: #fff;
	border: 0;
	border-bottom: 1px solid var(--wplock-accent);
	border-radius: 0;
	box-shadow: none;
}

.wplock #login input[type="text"]:focus,
.wplock #login input[type="email"]:focus,
.wplock #login input[type="password"]:focus {
	border-bottom-width: 2px;
	box-shadow: none;
	outline: 0;
}

.wplock #login .button.wp-hide-pw {
	color: #333;
	background: transparent;
	border: 0;
	box-shadow: none;
}

/* Consent. */
.wplock #login .wplock-consent {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 4px 0 16px;
	font-size: 12px;
	line-height: 1.4;
	text-align: justify;
}

.wplock #login .wplock-consent input[type="checkbox"] {
	flex: 0 0 auto;
	width: 1rem;
	height: 1rem;
	margin: 2px 0 0;
}

.wplock #login .wplock-consent label {
	font-size: 12px;
}

.wplock #login .wplock-consent a {
	color: var(--wplock-accent);
}

.wplock #login .forgetmenot {
	float: none;
	margin: 0 0 16px;
}

/* Buttons: outlined, square, full width. */
.wplock #login .submit {
	margin: 0;
}

.wplock #login .button-primary,
.wplock #login .wplock-register-button {
	float: none;
	display: block;
	width: 100%;
	min-height: 42px;
	padding: 4px 12px;
	font-size: 14px;
	line-height: 32px;
	text-align: center;
	text-shadow: none;
	color: #000;
	background: #fff;
	border: 2px solid var(--wplock-accent);
	border-radius: 0;
	box-shadow: none;
}

.wplock #login .button-primary:hover,
.wplock #login .button-primary:focus,
.wplock #login .wplock-register-button:hover,
.wplock #login .wplock-register-button:focus {
	color: #fff;
	background: var(--wplock-accent);
	border-color: var(--wplock-accent);
	box-shadow: none;
}

.wplock #login .wplock-register {
	margin: 12px 0 0;
}

/* Gated until the consent box is ticked (see login.js). */
.wplock #login .button-primary:disabled,
.wplock #login .wplock-register-button[aria-disabled="true"] {
	color: #a0a5aa;
	background: #f7f7f7;
	border-color: #ddd;
	cursor: default;
}

/* Lost-password link: bottom of the panel. */
.wplock #login #nav {
	margin: 0;
	padding: 12px 24px 20px;
	background: #fff;
	border: 1px solid var(--wplock-accent);
	border-top: 0;
}

.wplock #login #nav a {
	color: #333;
}

.wplock #login #nav a:hover,
.wplock #login #nav a:focus {
	color: var(--wplock-accent);
}

/* The "Log in" link on other screens leads to an empty login screen; the panel closes without it. */
.wplock:not(.login-action-login) #login #nav {
	display: none;
}

.wplock:not(.login-action-login) #login form {
	border-bottom: 1px solid var(--wplock-accent);
}

/* Whatever comes last in the panel closes it. */
.wplock.login-action-checkemail #login .notice:last-of-type,
.wplock.login-action-resetpass #login .notice:last-of-type {
	border-bottom: 1px solid var(--wplock-accent);
}

.wplock #backtoblog {
	display: none;
}

/* Opened with nothing to sign in for: only the message stays. */
.wplock-no-context #login #loginform,
.wplock-no-context #login #nav {
	display: none;
}

.wplock-no-context #login .notice:last-of-type {
	border-bottom: 1px solid var(--wplock-accent);
}

.wplock #login .wplock-back {
	font-weight: 600;
	color: var(--wplock-accent);
}
