<span id="authorizationButton"></span>
<div id="authorizationDiv" class="borderStyle" style="visibility: hidden; top: 20%; left: 50%; transform: translate(-50%, -20%);">
    <div class="authorizationDivTop" class="borderStyle">
        <span class="authorizationDivTopTitle">{{authorization}}</span>
        <span class="authorizationDivCloseFun" onClick="authorizationDivCloseFun()" class="editib"></span>
    </div>
    <div class="authorizationDivMainDiv">
        <div class="formRow">{{account_authorization}}</div>
        <div class="formRow">
            <button type="button" id="loginButton" onClick="loginButtonFunCreate()">{{login}}</button>
            <button type="button" id="loginButton" onClick="registrationButtonFunCreate()">{{register}}</button>
        </div>
    </div>
</div>

<script>
window.addEventListener("load", function() {
    try {
        var buttonHTML = document.getElementById("authorizationButton").outerHTML;
        var divHTML = document.getElementById("authorizationDiv").outerHTML;

        document.getElementById("authorizationButton").remove();
        document.getElementById("authorizationDiv").remove();

        var container = document.getElementById("hbody");
        if (!container) throw new Error("#hbody не найден для authorization");
        container.insertAdjacentHTML("beforeend", buttonHTML);
        container.insertAdjacentHTML("beforeend", divHTML);
    } catch (e) {
        console.error("Ошибка в блоке authorization:", e);
    }
});
</script>