/**
 * Storypath login screen (wp-login.php).
 *
 * Loaded after core's "login" stylesheet only when the Setup switch
 * "Branded login screen" is on. Every colour and font comes from the
 * --storypath-login-* custom properties that inc/Front/LoginScreen.php
 * prints from the brand palette. LoginScreen checks each colour against the
 * background it sits on, so text meets 4.5:1 and controls meet 3:1.
 *
 * Only the look changes. Core markup, including the error and message
 * boxes, is not touched. login-rtl.css is built from this file by rtlcss.
 *
 * Core IDs such as #login_error keep their underscore.
 */
/* stylelint-disable selector-id-pattern */

body.login.storypath-login {
	background: var(--storypath-login-page);
	color: var(--storypath-login-page-text);
	font-family: var(--storypath-login-font-body);
	font-size: 16px;
	line-height: 1.5;
}

/* The page links below the form sit on the page colour. */
body.storypath-login a {
	color: var(--storypath-login-page-link);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

body.storypath-login a:hover,
body.storypath-login a:active {
	color: var(--storypath-login-page-hover);
	text-decoration-thickness: 2px;
}

/*
 * One visible focus ring for every control. Links on the page use the ring
 * checked against the page colour; everything inside the card uses the
 * ring checked against the card.
 */
body.storypath-login a:focus,
body.storypath-login button:focus,
body.storypath-login input:focus,
body.storypath-login select:focus,
body.storypath-login .button:focus {
	box-shadow: none;
	outline: var(--storypath-login-focus-width) solid var(--storypath-login-page-focus);
	outline-offset: 2px;
}

body.storypath-login :is(form, .message, .notice, .success, #login_error) :is(a, button, input, select, .button):focus {
	outline-color: var(--storypath-login-focus);
}

body.storypath-login a:focus:not(:focus-visible) {
	outline: none;
}

body.storypath-login #login {
	width: min(360px, 100% - 32px);
	padding-top: clamp(24px, 8vh, 96px);
}

/* Logo. Image logos come from the inline style; the box is sized there. */
body.storypath-login h1 a {
	background-position: center;
	background-size: contain;
	margin-bottom: 24px;
	max-width: 100%;
}

/* No logo image: show the site name as text instead of the WordPress mark. */
body.storypath-login--text-logo h1 a {
	background-image: none;
	color: var(--storypath-login-page-text);
	font-family: var(--storypath-login-font-heading);
	font-size: 28px;
	font-weight: 700;
	height: auto;
	line-height: 1.2;
	overflow: visible;
	text-decoration: none;
	text-indent: 0;
	width: auto;
	overflow-wrap: anywhere;
}

/* The card that holds each form. */
body.storypath-login form,
body.storypath-login .admin-email-confirm-form {
	background: var(--storypath-login-card);
	border: 1px solid var(--storypath-login-border);
	border-radius: var(--storypath-login-radius);
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.08);
	color: var(--storypath-login-text);
	margin-top: 16px;
	padding: 24px;
}

body.storypath-login form a {
	color: var(--storypath-login-link);
}

body.storypath-login form a:hover {
	color: var(--storypath-login-link-hover);
}

body.storypath-login label,
body.storypath-login .description,
body.storypath-login .indicator-hint,
body.storypath-login p {
	color: inherit;
	font-size: 16px;
}

body.storypath-login form .description,
body.storypath-login form .indicator-hint {
	color: var(--storypath-login-muted);
	font-size: 14px;
}

body.storypath-login input[type="text"],
body.storypath-login input[type="password"],
body.storypath-login input[type="email"],
body.storypath-login input[type="number"],
body.storypath-login select {
	background: var(--storypath-login-card);
	border: 1px solid var(--storypath-login-border);
	border-radius: var(--storypath-login-radius);
	color: var(--storypath-login-text);
	font-family: var(--storypath-login-font-body);
	font-size: 18px;
	min-height: 44px;
}

body.storypath-login input[type="checkbox"] {
	border-color: var(--storypath-login-border);
	height: 20px;
	width: 20px;
}

body.storypath-login input[type="checkbox"]:checked::before {
	filter: none;
}

/* Buttons. The primary button uses the brand primary and its on- colour. */
body.storypath-login .button-primary {
	background: var(--storypath-login-button);
	border: 2px solid var(--storypath-login-button);
	border-radius: var(--storypath-login-button-radius);
	color: var(--storypath-login-on-button);
	font-family: var(--storypath-login-font-body);
	font-size: 16px;
	font-weight: 600;
	min-height: 44px;
	padding: 0 20px;
	text-shadow: none;
}

body.storypath-login .button-primary:hover,
body.storypath-login .button-primary:active {
	background: var(--storypath-login-hover);
	border-color: var(--storypath-login-hover);
	color: var(--storypath-login-on-hover);
}

body.storypath-login .button-primary:focus {
	background: var(--storypath-login-button);
	border-color: var(--storypath-login-button);
	color: var(--storypath-login-on-button);
}

body.storypath-login .button-primary[disabled],
body.storypath-login .button-primary:disabled {
	background: var(--storypath-login-card) !important;
	border-color: var(--storypath-login-border) !important;
	color: var(--storypath-login-muted) !important;
}

body.storypath-login .button:not(.button-primary),
body.storypath-login .button-secondary {
	background: var(--storypath-login-card);
	border-color: var(--storypath-login-border);
	border-radius: var(--storypath-login-button-radius);
	color: var(--storypath-login-text);
	min-height: 44px;
}

body.storypath-login .button.wp-hide-pw {
	background: transparent;
	border-color: transparent;
	color: var(--storypath-login-text);
	right: 2px;
	top: 2px;
	min-height: 40px;
}

body.storypath-login .button.wp-hide-pw:focus {
	border-color: transparent;
}

/* Error and message boxes: core markup, brand colours. */
body.storypath-login .message,
body.storypath-login .notice,
body.storypath-login .success,
body.storypath-login #login_error {
	background: var(--storypath-login-card);
	border: 1px solid var(--storypath-login-border);
	border-left-width: 4px;
	border-radius: var(--storypath-login-radius);
	box-shadow: none;
	color: var(--storypath-login-text);
	font-size: 16px;
}

body.storypath-login :is(.message, .notice, .success, #login_error) :is(p, li) {
	font-size: 16px;
	line-height: 1.5;
}

body.storypath-login .message,
body.storypath-login .notice-info {
	border-left-color: var(--storypath-login-accent);
}

body.storypath-login .success,
body.storypath-login .notice-success {
	border-left-color: var(--storypath-login-success);
}

body.storypath-login .notice-warning {
	border-left-color: var(--storypath-login-warning);
}

body.storypath-login #login_error,
body.storypath-login .notice-error {
	border-left-color: var(--storypath-login-error);
}

body.storypath-login #login_error a,
body.storypath-login .message a,
body.storypath-login .notice a {
	color: var(--storypath-login-link);
}

/* Password strength meter keeps core colours but follows the radius. */
body.storypath-login #pass-strength-result {
	border-radius: var(--storypath-login-radius);
	color: #1e1e1e;
}

/* Links under the card. */
body.storypath-login #nav,
body.storypath-login #backtoblog {
	font-size: 16px;
	margin-top: 16px;
	padding: 0 8px;
}

body.storypath-login #nav a,
body.storypath-login #backtoblog a {
	color: var(--storypath-login-page-link);
	display: inline-block;
	padding-block: 4px;
}

body.storypath-login #nav a:hover,
body.storypath-login #backtoblog a:hover {
	color: var(--storypath-login-page-hover);
}

body.storypath-login .privacy-policy-page-link {
	font-size: 16px;
}

/* Language switcher. */
body.storypath-login .language-switcher {
	color: var(--storypath-login-page-text);
}

body.storypath-login .language-switcher label .dashicons {
	color: var(--storypath-login-page-text);
}

/* The interim login modal (expired session) has less room. */
body.storypath-login.interim-login #login {
	padding-top: 16px;
}

body.storypath-login.interim-login h1 a {
	margin-bottom: 8px;
}

@media screen and (max-width: 400px) {

	body.storypath-login form {
		padding: 20px 16px;
	}

	body.storypath-login--text-logo h1 a {
		font-size: 24px;
	}
}

/* Windows high contrast: keep borders and the focus ring. */
@media (forced-colors: active) {

	body.storypath-login form,
	body.storypath-login .button-primary {
		border-color: CanvasText;
	}

	body.storypath-login a:focus,
	body.storypath-login button:focus,
	body.storypath-login input:focus,
	body.storypath-login .button:focus {
		outline-color: Highlight;
	}
}

/* No shake, fades or transitions for visitors who ask for less motion. */
@media (prefers-reduced-motion: reduce) {

	body.storypath-login form.shake {
		animation: none;
		transform: none;
	}

	body.storypath-login *,
	body.storypath-login *::before,
	body.storypath-login *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
