* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    color: white;
    background-color: #070913;
    background-image: url("space.jpg");
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    font-family: Arial, sans-serif;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

/* //////////////////////////////////////////////////////////// */
/* НАЧАЛО БЛОКА: ВЕРХНЯЯ ЧАСТЬ САЙТА */
/* //////////////////////////////////////////////////////////// */

.box1 {
    display: flex;
    min-height: 40vh;
    padding: 30px 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 5px solid white;
    text-align: center;
    font-size: clamp(20px, 3vw, 30px);
}

.box1 h1 {
    margin: 0 0 28px;
}

.box1 p {
    margin: 12px 0;
}

.box1 a {
    color: white;
}

/* //////////////////////////////////////////////////////////// */
/* КОНЕЦ БЛОКА: ВЕРХНЯЯ ЧАСТЬ САЙТА */
/* //////////////////////////////////////////////////////////// */


/* //////////////////////////////////////////////////////////// */
/* НАЧАЛО БЛОКА: НИЖНЯЯ ЧАСТЬ САЙТА */
/* //////////////////////////////////////////////////////////// */

.container {
    display: flex;
    min-height: 60vh;
    font-size: clamp(24px, 5vw, 60px);
}

.left,
.right {
    width: 50%;
    min-height: 60vh;
}

.left {
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
}

.right {
    display: flex;
    padding: 22px 24px 24px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.top-top-right {
    width: 100%;
    text-align: center;
}

#welcome {
    font-size: 30px;
}

#welcome > p {
    margin: 0;
}

#authStatus {
    margin-top: 10px !important;
    font-size: 18px;
}

.top-right {
    display: flex;
    width: 100%;
    margin-top: 16px;
    align-items: flex-start;
    justify-content: center;
}

.top-right-left,
.top-right-right {
    display: flex;
    width: 50%;
    justify-content: center;
}

.top-right p {
    margin: 0;
}

#userActions {
    justify-content: center;
}

/* //////////////////////////////////////////////////////////// */
/* КОНЕЦ БЛОКА: НИЖНЯЯ ЧАСТЬ САЙТА */
/* //////////////////////////////////////////////////////////// */


/* //////////////////////////////////////////////////////////// */
/* НАЧАЛО БЛОКА: КНОПКИ ГЛАВНОЙ СТРАНИЦЫ */
/* Размеры соответствуют первоначальному варианту сайта. */
/* //////////////////////////////////////////////////////////// */

#log,
#reg,
#logout {
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 1px 6px;
    color: white;
    border: 2px outset ButtonBorder;
    border-radius: 15px;
    background-color: ButtonFace;
    background-position: 0 0;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    font-size: 30px;
    font-weight: normal;
    line-height: normal;
    box-shadow: 10px 10px 20px black;
}

#log,
#logout {
    background-image: url("spaceLOG.gif");
}

#reg {
    background-image: url("spaceREG.gif");
}

#button1Box2 {
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 1px 6px;
    color: white;
    border: 2px outset ButtonBorder;
    border-radius: 5px;
    background-color: ButtonFace;
    background-image: url("spaceMAL.gif");
    background-position: 0 0;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    font-size: 60px;
    font-weight: normal;
    line-height: normal;
    box-shadow: 0 0 20px white;
}

#log:disabled,
#reg:disabled,
#logout:disabled,
#button1Box2:disabled,
.auth-form button:disabled {
    cursor: wait;
    opacity: 0.6;
}

/* //////////////////////////////////////////////////////////// */
/* КОНЕЦ БЛОКА: КНОПКИ ГЛАВНОЙ СТРАНИЦЫ */
/* //////////////////////////////////////////////////////////// */


/* //////////////////////////////////////////////////////////// */
/* НАЧАЛО БЛОКА: ВСПЛЫВАЮЩИЕ ОКНА */
/* //////////////////////////////////////////////////////////// */

.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    overflow: auto;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
}

.popup.is-open {
    display: grid;
    place-items: center;
}

.auth-form {
    width: min(100%, 430px);
    padding: 32px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 14px;
    background-color: #080b19;
    background-position: center;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    box-shadow: 10px 10px 20px black;
    text-shadow: 1px 1px 3px black;
}

#loginForm {
    background-image: url("spaceLOG.gif");
}

#registerForm {
    background-image: url("spaceREG.gif");
}

.auth-form h2 {
    margin: 0 0 22px;
    text-align: center;
}

.auth-form label {
    display: block;
    margin: 15px 0 7px;
    font-size: 16px;
}

.auth-form input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: #111522;
    border: 2px solid transparent;
    border-radius: 7px;
    background: rgba(247, 248, 255, 0.94);
    text-shadow: none;
}

.auth-form input:focus {
    outline: none;
    border-color: #9fc0ff;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.form-actions button {
    flex: 1;
    min-width: 135px;
    padding: 11px 14px;
    border: 0;
    border-radius: 7px;
}

.form-actions button[type="submit"] {
    color: white;
    background: rgba(39, 104, 232, 0.9);
}

.form-message {
    min-height: 22px;
    margin: 14px 0 0;
    color: #ffcf70;
    font-size: 15px;
}

.form-message.success {
    color: #7cf0a6;
}

/* //////////////////////////////////////////////////////////// */
/* КОНЕЦ БЛОКА: ВСПЛЫВАЮЩИЕ ОКНА */
/* //////////////////////////////////////////////////////////// */


@media (max-width: 800px) {
    .container {
        flex-direction: column;
    }

    .left,
    .right {
        width: 100%;
        min-height: 45vh;
    }

    .right {
        padding-top: 18px;
    }

    .top-right {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .top-right-left,
    .top-right-right {
        width: 100%;
    }
}
