/**
 * Login UI for Bye Bye Passwords.
 */

body.login {
	--byebyepw-ink: #1d2327;
	--byebyepw-muted: #50575e;
	--byebyepw-border: #c3c4c7;
	--byebyepw-blue: #2271b1;
	--byebyepw-blue-dark: #135e96;
	--byebyepw-blue-soft: #f0f6fc;
	--byebyepw-red: #b32d2e;
	--byebyepw-red-soft: #fcf0f1;
	--byebyepw-amber: #996800;
	--byebyepw-amber-soft: #fcf5df;
}

body.login #loginform {
	border-color: #dcdcde;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04);
}

#byebyepw-login-section {
	margin: 24px 0 26px;
}

.byebyepw-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 20px 0 16px;
	color: #646970;
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
}

.byebyepw-divider::before,
.byebyepw-divider::after {
	flex: 1 1 auto;
	height: 1px;
	background: #dcdcde;
	content: "";
}

.byebyepw-divider span {
	flex: 0 0 auto;
	padding: 0;
	background: transparent;
}

#byebyepw-authenticate-passkey,
#byebyepw-submit-recovery {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	min-height: 42px;
	font-weight: 600;
	line-height: 1.25;
}

#byebyepw-authenticate-passkey {
	background: var(--byebyepw-blue-soft);
	border-color: #72aee6;
	color: var(--byebyepw-blue-dark);
}

#byebyepw-authenticate-passkey:hover,
#byebyepw-authenticate-passkey:focus {
	background: #e5f3ff;
	border-color: var(--byebyepw-blue);
	color: #0a4b78;
}

.byebyepw-passkey-mark {
	display: inline-flex;
	flex: 0 0 22px;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	box-sizing: border-box;
}

.byebyepw-passkey-mark svg {
	display: block;
	width: 22px;
	height: 22px;
}

.byebyepw-login-hint,
.byebyepw-recovery-intro {
	margin: 8px 0 0;
	color: var(--byebyepw-muted);
	font-size: 12px;
	line-height: 1.5;
	text-align: left;
}

.byebyepw-option-text {
	margin: 18px 0 0;
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
}

.byebyepw-option-text a {
	text-underline-offset: 2px;
}

.byebyepw-message {
	margin: 16px 0 0;
	padding: 10px 12px;
	background: #fff;
	border-left: 4px solid;
	color: var(--byebyepw-ink);
	font-size: 13px;
	line-height: 1.5;
}

.byebyepw-message[hidden] {
	display: none;
}

.byebyepw-message.error {
	background: var(--byebyepw-red-soft);
	border-color: var(--byebyepw-red);
}

.byebyepw-message.warning {
	background: var(--byebyepw-amber-soft);
	border-color: #dba617;
}

.byebyepw-message.success {
	background: #edfaef;
	border-color: #008a20;
}

#byebyepw-recovery-form {
	display: none;
	margin-top: 20px;
}

#byebyepw-recovery-form h2 {
	margin: 0;
	color: var(--byebyepw-ink);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
}

#byebyepw-recovery-form .byebyepw-recovery-intro {
	margin-bottom: 18px;
}

#byebyepw-recovery-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
	font-size: 16px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

body.byebyepw-recovery-active #loginform .user-pass-wrap,
body.byebyepw-recovery-active #loginform .forgetmenot,
body.byebyepw-recovery-active #loginform > .submit {
	display: none !important;
}

body.byebyepw-recovery-active #loginform .user-login-wrap {
	margin-bottom: 18px;
}

body.byebyepw-recovery-active #byebyepw-login-message {
	margin-bottom: 16px;
}

.byebyepw-password-disabled #loginform #user_login,
.byebyepw-password-disabled #loginform label[for="user_login"],
.byebyepw-password-disabled #loginform .user-login-wrap,
.byebyepw-password-disabled #loginform #user_pass,
.byebyepw-password-disabled #loginform label[for="user_pass"],
.byebyepw-password-disabled #loginform .user-pass-wrap,
.byebyepw-password-disabled #loginform .forgetmenot,
.byebyepw-password-disabled #loginform #wp-submit,
.byebyepw-password-disabled #nav {
	display: none !important;
}

.byebyepw-password-disabled .byebyepw-divider {
	display: none !important;
}

body.login #loginform :focus-visible {
	outline: 2px solid var(--byebyepw-blue);
	outline-offset: 2px;
}

#byebyepw-authenticate-passkey[aria-busy="true"] .byebyepw-passkey-mark {
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: byebyepw-spin 0.8s linear infinite;
}

#byebyepw-authenticate-passkey[aria-busy="true"] .byebyepw-passkey-mark svg {
	display: none;
}

@keyframes byebyepw-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 480px) {
	body.login #loginform {
		padding: 24px;
	}

	#byebyepw-login-section {
		margin-bottom: 30px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#byebyepw-authenticate-passkey[aria-busy="true"] .byebyepw-passkey-mark {
		animation-duration: 1.6s;
	}
}
