/*
 * The login screen - wp-login.php.
 *
 * WHY THE COLOURS ARE LITERAL HERE
 * --------------------------------
 * The child theme's tokens are aliases into Astra's palette
 * (--pulsr-accent: var(--ast-global-color-0)), and Astra's stylesheet is NOT
 * loaded on wp-login.php - so borrowing them would resolve to nothing at all.
 * These are the same brand values, written out. If the palette is ever changed
 * in Appearance > Customize, this file has to be changed with it; the comment on
 * each line says which token it mirrors so the pair can be found.
 *
 * Typography comes from the theme's generated assets/css/fonts.css, enqueued by
 * LoginScreen when the active theme provides it. Without it these families are
 * simply unavailable and the stack falls through to system-ui - a different
 * typeface, not a broken page.
 *
 * The design deliberately echoes the front end rather than inventing a second
 * language: a 2px accent line on the top edge of a panel (as on the desktop
 * dropdowns), a 3px accent bar on the left of a notice (as on the paywall
 * notice and access badges), 4px corners, and a 2px accent focus ring.
 */

.pulsr-login {
	--accent: #ff6210;        /* --pulsr-accent        */
	--accent-hover: #f15808;  /* --pulsr-accent-hover  */
	--heading: #1c0d0a;       /* --pulsr-heading       */
	--text: #353535;          /* --pulsr-text          */
	--surface: #ffffff;       /* --pulsr-surface       */
	--muted: #f4f4f4;         /* --pulsr-surface-muted */
	--border: #e5d7d1;        /* --pulsr-border        */

	/* Page ground: a warm tint taken from the border hue rather than a neutral
	   grey, so the white card reads as paper on a warm surface. */
	--ground: #f7f3f1;

	/* Errors are not in the brand palette. Kept deep and slightly warm so it
	   sits beside the orange instead of fighting it. */
	--error: #a8271c;
	--error-bg: #fdf4f3;
	--error-border: #e7c7c2;

	--radius: 4px;
	--font-display: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Centre the whole thing. Column, because login_footer renders the "no account"
   note as a SIBLING of #login - a row would put it alongside the card. */
body.pulsr-login {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	min-height: 100vh;
	margin: 0;
	padding: 2rem 1rem;
	box-sizing: border-box;
	background: var(--ground);
	font-family: var(--font-body);
	color: var(--text);
}

.pulsr-login #login {
	width: 100%;
	max-width: 23rem;
	padding: 0;
	margin: 0;
}

/* ---------------------------------------------------------------------------
 * Logo and eyebrow
 *
 * WordPress's own logo is a background image on the h1's link, so replacing it
 * means replacing that background - the URL and height come from the uploaded
 * file and are printed inline by LoginScreen.
 * ------------------------------------------------------------------------ */
.pulsr-login #login h1 {
	margin: 0 0 0.85rem;
}

.pulsr-login #login h1 a {
	display: block;
	margin: 0 auto;
	background-repeat: no-repeat;
	background-position: center;
	/* Core sets a text-indent to hide its own label; keep the anchor's text
	   out of sight without relying on that specific technique. */
	overflow: hidden;
	white-space: nowrap;
	text-indent: -9999px;
	outline-offset: 4px;
}

.pulsr-login #login h1 a:focus-visible {
	outline: 2px solid var(--accent);
}

.pulsr-login__eyebrow {
	margin: 0 0 1.1rem;
	font-family: var(--font-display);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	text-align: center;
	color: var(--accent);
}

/* ---------------------------------------------------------------------------
 * The card
 * ------------------------------------------------------------------------ */
.pulsr-login #loginform,
.pulsr-login #lostpasswordform,
.pulsr-login #resetpassform,
.pulsr-login #registerform {
	box-sizing: border-box;
	margin: 0;
	padding: 1.6rem 1.5rem 1.5rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-top: 2px solid var(--accent);
	border-radius: var(--radius);
	/* Flat by decision (2 Sep 2026). Explicitly none rather than merely absent:
	   core styles `.login form` with a shadow of its own, which ours was hiding,
	   so dropping ours only revealed it. The card is separated from the ground by
	   its border and the accent top rule. */
	box-shadow: none;
	overflow: visible;
}

.pulsr-login #login form label {
	display: block;
	margin-bottom: 0.3rem;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--heading);
}

/* Field groups.
 *
 * These are the selectors WordPress 7.1 actually emits - the username sits in a
 * BARE <p> and the password in `.user-pass-wrap`. The older `.login-username` /
 * `.login-password` classes matched nothing, which left the "Lozinka" label
 * almost touching the field above it. Kept in the list anyway for the reset
 * screens and for older cores. */
.pulsr-login #login form > p,
.pulsr-login #login form .user-pass-wrap,
.pulsr-login #login form .login-username,
.pulsr-login #login form .login-password,
.pulsr-login #login form .user-pass1-wrap,
.pulsr-login #login form .user-pass2-wrap {
	margin: 0 0 1.15rem;
}

.pulsr-login #login form input[type='text'],
.pulsr-login #login form input[type='email'],
.pulsr-login #login form input[type='password'] {
	box-sizing: border-box;
	width: 100%;
	min-height: 2.75rem;
	margin: 0;
	padding: 0.55rem 0.7rem;
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.4;
	color: var(--heading);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: none;
	transition: border-color 120ms ease;
}

.pulsr-login #login form input[type='text']:hover,
.pulsr-login #login form input[type='email']:hover,
.pulsr-login #login form input[type='password']:hover {
	border-color: #d4c0b8;
}

/* Focus on a text input is a flat ring set OUTSIDE the field.
   WordPress runs wp_attempt_focus() on load - `d.focus(); d.select();` - so the
   username field is focused before the visitor does anything, and per spec a
   focused text input always matches :focus-visible, so there is no way to tell
   that focus apart from a deliberate one. The first version of this rule drew
   the ring INSIDE the field, which filled an empty box with orange the moment
   the page opened and read as an error. A halo replaced it; the halo was a
   box-shadow, and shadows are now gone by decision - so it is an outline with a
   1px offset, which sits clear of the field rather than filling it. Flat, no
   blur, and unmistakably focus. Do not remove it: this is the only focus
   indicator these fields have. */
.pulsr-login #login form input[type='text']:focus,
.pulsr-login #login form input[type='email']:focus,
.pulsr-login #login form input[type='password']:focus {
	border-color: var(--accent);
	outline: 2px solid var(--accent);
	outline-offset: 1px;
}

/* ---------------------------------------------------------------------------
 * The "Remember Me" toggletip
 *
 * WordPress 7.1 puts a help toggletip beside the checkbox. Left alone it is a
 * stray grey "?" in the middle of an otherwise quiet form; it is real help, so
 * it is made to look deliberate rather than hidden.
 * ------------------------------------------------------------------------ */
.pulsr-login #login .wp-tooltip {
	margin-left: 0.15rem;
	vertical-align: middle;
}

.pulsr-login #login .wp-tooltip__toggle {
	width: 1.05rem;
	height: 1.05rem;
	padding: 0;
	color: #8a7a72;
	background: transparent;
	border: 0;
	border-radius: 50%;
	opacity: 0.75;
	transition: color 120ms ease, opacity 120ms ease;
}

.pulsr-login #login .wp-tooltip__toggle:hover {
	color: var(--accent);
	opacity: 1;
}

.pulsr-login #login .wp-tooltip__toggle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	color: var(--accent);
	opacity: 1;
}

.pulsr-login #login .wp-tooltip__bubble {
	max-width: 17rem;
	padding: 0.6rem 0.75rem;
	font-family: var(--font-body);
	font-size: 0.82rem;
	line-height: 1.5;
	color: var(--text);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	/* Core gives the popover a shadow; flat here too. It still reads as
	   floating because it sits on a solid ground inside a border. */
	box-shadow: none;
}

/* The password field is wrapped with a show/hide button. Keep them joined so
   the pair reads as one control rather than a field with a stray button. */
.pulsr-login #login .wp-pwd {
	position: relative;
}

.pulsr-login #login .wp-pwd input[type='text'],
.pulsr-login #login .wp-pwd input[type='password'] {
	padding-right: 3rem;
}

.pulsr-login #login .wp-pwd .button.wp-hide-pw {
	position: absolute;
	top: 0;
	right: 0;
	width: 2.9rem;
	height: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	color: #7a6a63;
	background: transparent;
	border: 0;
	box-shadow: none;
	border-radius: 0 var(--radius) var(--radius) 0;
}

.pulsr-login #login .wp-pwd .button.wp-hide-pw:hover {
	color: var(--accent);
	background: transparent;
}

.pulsr-login #login .wp-pwd .button.wp-hide-pw:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
	color: var(--accent);
}

/* "Remember me" - quiet, and on its own line above the button. */
.pulsr-login #login form .forgetmenot {
	float: none;
	margin: 0 0 1.1rem;
	font-size: 0.85rem;
	line-height: 1.4;
}

.pulsr-login #login form .forgetmenot label {
	display: inline;
	font-size: 0.85rem;
	font-weight: 400;
	color: var(--text);
}

.pulsr-login #login form input[type='checkbox'] {
	margin: 0 0.4rem 0 0;
	border-color: var(--border);
	border-radius: 2px;
}

.pulsr-login #login form input[type='checkbox']:checked::before {
	color: var(--accent);
}

.pulsr-login #login form input[type='checkbox']:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
	box-shadow: none;
}

/* ---------------------------------------------------------------------------
 * Submit - the same treatment as the site's own call to action
 * ------------------------------------------------------------------------ */
.pulsr-login #login form .submit {
	margin: 0;
}

.pulsr-login #login .button-primary {
	box-sizing: border-box;
	float: none;
	display: block;
	width: 100%;
	min-height: 2.9rem;
	margin: 0;
	padding: 0.6rem 1rem;
	font-family: var(--font-display);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: center;
	text-shadow: none;
	color: #fff;
	background: var(--accent);
	border: 1px solid var(--accent);
	border-radius: var(--radius);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease;
}

.pulsr-login #login .button-primary:hover,
.pulsr-login #login .button-primary:focus {
	color: #fff;
	background: var(--accent-hover);
	border-color: var(--accent-hover);
}

.pulsr-login #login .button-primary:focus-visible {
	outline: 2px solid var(--heading);
	outline-offset: 2px;
}

.pulsr-login #login .button-primary:active {
	transform: translateY(1px);
}

/* ---------------------------------------------------------------------------
 * Links under the card
 * ------------------------------------------------------------------------ */
.pulsr-login #login #nav,
.pulsr-login #login #backtoblog {
	margin: 0;
	padding: 0;
	text-align: center;
	font-size: 0.85rem;
	line-height: 1.5;
}

.pulsr-login #login #nav {
	margin-top: 1.1rem;
}

.pulsr-login #login #backtoblog {
	margin-top: 0.35rem;
}

.pulsr-login #login #nav a,
.pulsr-login #login #backtoblog a {
	color: var(--text);
	text-decoration: underline;
	text-decoration-color: var(--border);
	text-underline-offset: 3px;
	transition: color 120ms ease, text-decoration-color 120ms ease;
}

.pulsr-login #login #nav a:hover,
.pulsr-login #login #backtoblog a:hover {
	color: var(--accent);
	text-decoration-color: var(--accent);
}

.pulsr-login #login #nav a:focus-visible,
.pulsr-login #login #backtoblog a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	color: var(--heading);
}

/* ---------------------------------------------------------------------------
 * Errors and notices - the site's left-bar notice pattern
 * ------------------------------------------------------------------------ */
.pulsr-login #login .notice,
.pulsr-login #login #login_error,
.pulsr-login #login .message,
.pulsr-login #login .success {
	box-sizing: border-box;
	margin: 0 0 1rem;
	padding: 0.8rem 0.9rem;
	font-size: 0.88rem;
	line-height: 1.5;
	background: var(--muted);
	border: 1px solid var(--border);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius);
	box-shadow: none;
	color: var(--text);
}

.pulsr-login #login #login_error,
.pulsr-login #login .notice-error {
	background: var(--error-bg);
	border-color: var(--error-border);
	border-left-color: var(--error);
	color: var(--error);
}

.pulsr-login #login .notice-error a,
.pulsr-login #login #login_error a,
.pulsr-login #login .message a {
	color: inherit;
	font-weight: 600;
	text-underline-offset: 3px;
}

/* ---------------------------------------------------------------------------
 * "No account?" - the only route for someone who has never been given one,
 * since self-registration is off by decision. Rendered at login_footer, so it
 * is a sibling of #login and needs the card's width to line up with it.
 * ------------------------------------------------------------------------ */
.pulsr-login-note {
	box-sizing: border-box;
	width: 100%;
	max-width: 23rem;
	margin: 0;
	padding: 0.95rem 1.1rem;
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid var(--border);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius);
	font-size: 0.85rem;
	line-height: 1.55;
	color: var(--text);
}

.pulsr-login-note p {
	margin: 0;
	font-size: inherit;
	line-height: inherit;
}

.pulsr-login-note__title {
	margin-bottom: 0.15rem !important;
	font-family: var(--font-display);
	font-weight: 600;
	color: var(--heading);
}

.pulsr-login-note__more {
	margin-top: 0.5rem !important;
}

.pulsr-login-note__more a {
	font-weight: 600;
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pulsr-login-note__more a:hover {
	color: var(--accent-hover);
}

.pulsr-login-note__more a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	color: var(--heading);
}

/* Core prints a language switcher below the form on some installs. */
.pulsr-login .language-switcher {
	margin-top: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
	.pulsr-login #login form input,
	.pulsr-login #login .button-primary,
	.pulsr-login #login #nav a,
	.pulsr-login #login #backtoblog a {
		transition: none;
	}
	.pulsr-login #login .button-primary:active {
		transform: none;
	}
}

/* Short viewports: stop the card being pinned to a centre it cannot fit in. */
@media (max-height: 620px) {
	body.pulsr-login {
		justify-content: flex-start;
	}
}
