/**
 * Hadi Admin — login screen.
 *
 * One card holds the whole conversation: mark, heading, fields, action.
 * Everything WordPress scatters down the page (lost password, back link,
 * language) is either folded into the card or demoted to a quiet footer
 * row. Logical properties throughout, so RTL needs no separate sheet.
 */

body.login {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	/* Without border-box the padding stacks on top of the 100vh minimum
	   and the page scrolls with nothing below the fold. */
	box-sizing: border-box;
	min-block-size: 100vh;
	margin: 0;
	padding: 56px 20px 32px;
	background: var(--hadi-bg);
	font-family: var(--hadi-font);
	color: var(--hadi-ink);
}

/* A single hairline of warmth behind the card, no gradient. */
body.login::before {
	content: "";
	position: fixed;
	inset: 0;
	background:
		radial-gradient(60rem 30rem at 50% -10%, rgba(0, 0, 0, 0.025), transparent 70%);
	pointer-events: none;
}

/* Core sizes and spaces the login column through #login selectors, so
   every rule that has to beat it carries an id too. */
body.login #login {
	inline-size: 100%;
	max-inline-size: 400px;
	padding: 0;
	margin: 0;
	position: relative;
	z-index: 1;
}

/* ---------------------------------------------------------------- Mark
   An eyebrow, not a second headline — the heading below is the hero. */

.login h1 {
	margin: 0 0 26px;
	text-align: center;
}
.login h1 a {
	display: inline-block;
	background-image: none;
	text-indent: 0;
	inline-size: auto;
	block-size: auto;
	margin: 0;
	padding: 0;
	line-height: 1.3;
	font-family: var(--hadi-font);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--hadi-ink-2);
	text-decoration: none;
	overflow: hidden;
}
.login h1 a:hover,
.login h1 a:focus {
	color: var(--hadi-ink);
	box-shadow: none;
	outline: none;
}

/* -------------------------------------------------------------- Intro */

.hadi-login-intro {
	margin: 0 0 24px;
	text-align: center;
}
.hadi-login-intro h2 {
	margin: 0;
	font-family: var(--hadi-font);
	font-size: 23px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.015em;
	color: var(--hadi-ink);
}
.hadi-login-intro p {
	margin: 8px 0 0;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--hadi-ink-2);
}

/* --------------------------------------------------------------- Card */

.login form {
	margin: 0;
	padding: 36px 32px;
	border: 1px solid var(--hadi-border);
	border-radius: 16px;
	background: var(--hadi-surface);
	box-shadow: 0 1px 2px rgba(31, 29, 26, 0.04), 0 8px 24px -12px rgba(31, 29, 26, 0.12);
	overflow: visible;
}
body.login #login form p,
body.login #login form .user-pass-wrap {
	margin-block-end: 24px;
}

.login label {
	display: block;
	margin-block-end: 8px;
	font-family: var(--hadi-font);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--hadi-ink);
}

/* Password label and the recovery link share one line. */
.hadi-label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-block-end: 8px;
}
.hadi-label-row label {
	margin-block-end: 0;
}
.login a.hadi-lost-inline {
	font-size: 12px;
	font-weight: 400;
	color: var(--hadi-ink-2);
	text-decoration: none;
	white-space: nowrap;
}
.login a.hadi-lost-inline:hover,
.login a.hadi-lost-inline:focus {
	color: var(--hadi-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.login form .input,
.login input[type="text"],
.login input[type="email"],
.login input[type="password"] {
	box-sizing: border-box;
	inline-size: 100%;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--hadi-border-strong);
	border-radius: 10px;
	background: var(--hadi-surface);
	font-family: var(--hadi-font);
	font-size: 14px;
	line-height: 1.5;
	color: var(--hadi-ink);
	box-shadow: none;
	transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.login form .input::placeholder,
.login input::placeholder {
	color: var(--hadi-ink-3);
}
.login form .input:hover,
.login input[type="text"]:hover,
.login input[type="email"]:hover,
.login input[type="password"]:hover {
	border-color: var(--hadi-ink-3);
}
.login form .input:focus,
.login input[type="text"]:focus,
.login input[type="email"]:focus,
.login input[type="password"]:focus {
	border-color: var(--hadi-accent);
	box-shadow: 0 0 0 3px var(--hadi-accent-soft);
	outline: none;
}

/* Chrome paints autofilled fields its own pale blue, which reads as
   someone else's design. An inset shadow is the only way to repaint it. */
body.login #login input:-webkit-autofill,
body.login #login input:-webkit-autofill:hover,
body.login #login input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--hadi-ink);
	-webkit-box-shadow: 0 0 0 100px var(--hadi-surface) inset;
	box-shadow: 0 0 0 100px var(--hadi-surface) inset;
	caret-color: var(--hadi-ink);
}
body.login #login input:-webkit-autofill:focus {
	-webkit-box-shadow: 0 0 0 100px var(--hadi-surface) inset, 0 0 0 3px var(--hadi-accent-soft);
	box-shadow: 0 0 0 100px var(--hadi-surface) inset, 0 0 0 3px var(--hadi-accent-soft);
}

/* Password field: the reveal button sits inside the field, not beside it. */
.login .wp-pwd {
	position: relative;
	display: block;
}
.login .wp-pwd input[type="password"],
.login .wp-pwd input[type="text"] {
	padding-inline-end: 42px;
}
.login .button.wp-hide-pw {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-end: 4px;
	transform: translateY(-50%);
	inline-size: 32px;
	block-size: 32px;
	min-inline-size: 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: var(--hadi-ink-3);
	border-radius: 7px;
}
.login .button.wp-hide-pw:hover {
	color: var(--hadi-ink);
	background: var(--hadi-bg);
}
.login .button.wp-hide-pw:focus {
	border: 0;
	box-shadow: 0 0 0 3px var(--hadi-accent-soft);
	outline: none;
}
/* Swap the dashicon glyph for a stroke icon without touching core's JS,
   which toggles these classes to flip the state. */
.login .wp-hide-pw .dashicons {
	inline-size: 18px;
	block-size: 18px;
	font-size: 0;
	background-color: currentColor;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: 18px 18px;
	mask-size: 18px 18px;
}
.login .wp-hide-pw .dashicons-visibility {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.1 12.3a1 1 0 0 1 0-.7 10.8 10.8 0 0 1 19.8 0 1 1 0 0 1 0 .7 10.8 10.8 0 0 1-19.8 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.1 12.3a1 1 0 0 1 0-.7 10.8 10.8 0 0 1 19.8 0 1 1 0 0 1 0 .7 10.8 10.8 0 0 1-19.8 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.login .wp-hide-pw .dashicons-hidden {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.7 5.1a10.7 10.7 0 0 1 11.2 6.5 1 1 0 0 1 0 .7 10.7 10.7 0 0 1-1.4 2.5'/%3E%3Cpath d='M14.1 14.2a3 3 0 0 1-4.3-4.3'/%3E%3Cpath d='M17.5 17.5a10.8 10.8 0 0 1-15.4-5.2 1 1 0 0 1 0-.7 10.8 10.8 0 0 1 4.4-5.1'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.7 5.1a10.7 10.7 0 0 1 11.2 6.5 1 1 0 0 1 0 .7 10.7 10.7 0 0 1-1.4 2.5'/%3E%3Cpath d='M14.1 14.2a3 3 0 0 1-4.3-4.3'/%3E%3Cpath d='M17.5 17.5a10.8 10.8 0 0 1-15.4-5.2 1 1 0 0 1 0-.7 10.8 10.8 0 0 1 4.4-5.1'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
}

/* Remember me. Core styles this as `.login form .forgetmenot` and loads
   after us, so every rule here has to clear that same bar. */
body.login #login form .forgetmenot {
	display: flex;
	align-items: center;
	gap: 8px;
	float: none;
	inline-size: 100%;
	margin: 4px 0 24px;
	line-height: 1;
}
body.login #login form .forgetmenot label {
	display: inline-flex;
	align-items: center;
	inline-size: auto;
	margin: 0;
	font-size: 13px;
	font-weight: 400;
	color: var(--hadi-ink-2);
	cursor: pointer;
}
body.login #login form .forgetmenot input[type="checkbox"] {
	inline-size: 16px;
	block-size: 16px;
	margin: 0;
	border: 1px solid var(--hadi-border-strong);
	border-radius: 5px;
	background: var(--hadi-surface);
	box-shadow: none;
}
body.login #login form .forgetmenot input[type="checkbox"]:checked {
	background: var(--hadi-accent);
	border-color: var(--hadi-accent);
}
body.login #login form .forgetmenot input[type="checkbox"]:checked::before {
	content: "";
	display: block;
	inline-size: 100%;
	block-size: 100%;
	margin: 0;
	background-color: #fff;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
}
body.login #login form .forgetmenot input[type="checkbox"]:focus {
	border-color: var(--hadi-accent);
	box-shadow: 0 0 0 3px var(--hadi-accent-soft);
	outline: none;
}
/* Primary action: full width, the only filled element on the page.
   The top margin lives here rather than under "remember me" — core sets
   that row's margin-bottom to 0 from a selector we'd have to fight. */
body.login #login form p.submit {
	text-align: initial;
	float: none;
	clear: both;
	margin: 26px 0 0;
	padding: 0;
	border: 0;
}
.login .button-primary,
.login input[type="submit"].button-primary {
	display: block;
	inline-size: 100%;
	block-size: auto;
	float: none;
	margin: 0;
	padding: 11px 16px;
	border: 1px solid var(--hadi-accent);
	border-radius: 9px;
	background: var(--hadi-accent);
	color: #fff;
	font-family: var(--hadi-font);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.12s ease;
}
.login .button-primary:hover,
.login .button-primary:focus {
	background: var(--hadi-accent-hover);
	border-color: var(--hadi-accent-hover);
	color: #fff;
}
.login .button-primary:focus {
	box-shadow: 0 0 0 3px var(--hadi-accent-soft);
	outline: none;
}

/* ------------------------------------------------------------- Notices */

.login .message,
.login .success,
.login #login_error,
.login .notice {
	margin: 0 0 16px;
	padding: 11px 14px;
	border: 1px solid var(--hadi-border);
	border-inline-start: 3px solid var(--hadi-accent);
	border-radius: 10px;
	background: var(--hadi-surface);
	box-shadow: none;
	font-size: 13px;
	line-height: 1.6;
	color: var(--hadi-ink);
}
.login #login_error {
	border-inline-start-color: var(--hadi-danger);
}
.login .success {
	border-inline-start-color: var(--hadi-success);
}
/* The intro is not a notice, even though it rides the same hook. */
.login .hadi-login-intro {
	border: 0;
	padding: 0;
	background: none;
}

/* ---------------------------------------------------------- Top rail
   Page-level utilities pinned to the edges: the standing credit on the
   start side, the site link and language picker on the end side. */

.hadi-login-top {
	position: fixed;
	inset-block-start: 0;
	inset-inline: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 22px;
	font-family: var(--hadi-font);
	font-size: 12.5px;
	pointer-events: none;
}
.hadi-login-top > * {
	pointer-events: auto;
}
.login a.hadi-credit {
	color: var(--hadi-ink-3);
	text-decoration: none;
	letter-spacing: 0.01em;
	white-space: nowrap;
}
.login a.hadi-credit:hover,
.login a.hadi-credit:focus {
	color: var(--hadi-ink-2);
	box-shadow: none;
	outline: none;
}
.hadi-login-tools {
	display: flex;
	align-items: center;
	gap: 4px;
}

.login #backtoblog,
.login #nav {
	margin: 0;
	padding: 0;
	font-family: var(--hadi-font);
	font-size: 12.5px;
	text-align: initial;
}
.login #backtoblog a,
.login #nav a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 11px;
	border: 1px solid transparent;
	border-radius: 9px;
	color: var(--hadi-ink-2);
	text-decoration: none;
	transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.login #backtoblog a:hover,
.login #nav a:hover,
.login #backtoblog a:focus,
.login #nav a:focus {
	border-color: var(--hadi-border);
	background: var(--hadi-surface);
	color: var(--hadi-ink);
	box-shadow: none;
	outline: none;
}
/* A logical arrow, so it points the right way in both directions. */
.login #backtoblog a::before {
	content: "";
	inline-size: 14px;
	block-size: 14px;
	flex: 0 0 auto;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 19-7-7 7-7'/%3E%3Cpath d='M19 12H5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 19-7-7 7-7'/%3E%3Cpath d='M19 12H5'/%3E%3C/svg%3E") center / contain no-repeat;
}
[dir="rtl"] .login #backtoblog a::before {
	transform: scaleX(-1);
}

/* --------------------------------------------------- Language switcher */

/* A globe you can click. The real <select> stays — it is simply laid
   over the icon at zero opacity, so the native picker (and its keyboard
   and screen-reader behaviour) is untouched. */
.login .language-switcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 34px;
	block-size: 34px;
	border: 1px solid transparent;
	border-radius: 9px;
	color: var(--hadi-ink-3);
	transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.login .language-switcher:hover,
.login .language-switcher:focus-within {
	border-color: var(--hadi-border);
	background: var(--hadi-surface);
	color: var(--hadi-ink);
}
.login .language-switcher:focus-within {
	box-shadow: 0 0 0 3px var(--hadi-accent-soft);
}
.login .language-switcher form {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	display: block;
	position: static;
}
.login .language-switcher label {
	margin: 0;
}
/* The globe itself, drawn where the dashicon used to sit. */
.login .language-switcher .dashicons-translation {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-start: 50%;
	transform: translate(-50%, -50%);
	inline-size: 17px;
	block-size: 17px;
	font-size: 0;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E") center / contain no-repeat;
}
[dir="rtl"] .login .language-switcher .dashicons-translation {
	transform: translate(50%, -50%);
}
body.login .language-switcher select {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	min-block-size: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	opacity: 0;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}
/* The select is invisible, but its picker is not — style it to match the
   admin's dropdowns so the language list is ours too. */
@supports (appearance: base-select) {
	body.login .language-switcher select,
	body.login .language-switcher select::picker(select) {
		appearance: base-select;
	}
	body.login .language-switcher select::picker(select) {
		min-inline-size: 190px;
		margin-block-start: 8px;
		padding: 5px;
		border: 1px solid var(--hadi-border);
		border-radius: var(--hadi-radius-lg);
		background: var(--hadi-surface);
		box-shadow: 0 2px 4px rgba(31, 29, 26, 0.04), 0 12px 32px -12px rgba(31, 29, 26, 0.28);
		opacity: 1;
	}
	body.login .language-switcher option {
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 8px 10px;
		border-radius: 7px;
		font-family: var(--hadi-font);
		font-size: 13px;
		color: var(--hadi-ink);
	}
	body.login .language-switcher option:hover {
		background: var(--hadi-bg);
	}
	body.login .language-switcher option:checked {
		background: var(--hadi-accent-soft);
		color: var(--hadi-accent);
		font-weight: 500;
	}
	body.login .language-switcher option::checkmark {
		order: 1;
		margin-inline-start: auto;
		color: var(--hadi-accent);
	}
}

/* With JS the select applies itself; the button is dead weight. */
body.hadi-login-js .language-switcher .button {
	display: none;
}
.login .language-switcher .button {
	position: absolute;
	inset-block-start: calc(100% + 6px);
	inset-inline-end: 0;
	padding: 4px 10px;
	border-radius: 7px;
	border: 1px solid var(--hadi-border-strong);
	background: var(--hadi-surface);
	color: var(--hadi-ink);
	font-family: var(--hadi-font);
	font-size: 12.5px;
	box-shadow: none;
	block-size: auto;
	line-height: 1.5;
}

.login .privacy-policy-page-link {
	margin-block-start: 14px;
	text-align: center;
}
.login .privacy-policy-page-link a {
	font-size: 12px;
	color: var(--hadi-ink-3);
	text-decoration: none;
}
.login .privacy-policy-page-link a:hover {
	color: var(--hadi-ink-2);
}

/* Narrow screens: the card gets the room, the rail gets out of the way. */
@media (max-width: 480px) {
	.hadi-login-top {
		padding: 12px 14px;
	}
	.login a.hadi-credit {
		font-size: 11.5px;
	}
	.login form {
		padding: 28px 22px;
	}
}
