* {
    box-sizing: border-box;
}

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

body {
    position: relative;
    min-height: 100vh;

    background: #fdfdfd;
    color: #111111;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    overflow: hidden;
}

.page {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px;
}

.main-image {
    display: block;

    max-width: min(90vw, 1000px);
    max-height: 80vh;

    width: auto;
    height: auto;

    object-fit: contain;
}

/* -------------------- */
/* Login                */
/* -------------------- */

.login-area {
    position: fixed;
    top: 24px;
    right: 24px;

    z-index: 10;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    min-height: 42px;
}

.login-button,
.submit-button {
    height: 42px;

    border: 1px solid #111;
    border-radius: 8px;

    background: #111;
    color: #fff;

    padding: 0 18px;

    font: inherit;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.25s ease,
        opacity 0.2s ease;
}

.login-button:hover,
.submit-button:hover {
    background: #333;
}

.login-button:active,
.submit-button:active {
    transform: scale(0.97);
}

.login-button:disabled,
.submit-button:disabled {
    opacity: 0.6;
    cursor: default;
}

/* -------------------- */
/* Login popup          */
/* -------------------- */

.login-popup {
    position: absolute;
    top: 0;
    right: 0;

    display: flex;
    align-items: center;
    gap: 8px;

    margin: 0;
    padding: 0;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateX(12px);

    transition:
        opacity 0.2s ease,
        transform 0.25s ease,
        visibility 0.2s ease;
}

.login-area.open .login-button {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-area.open .login-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translateX(0);
}

.fields {
    display: flex;
    gap: 8px;
}

.fields input {
    width: 150px;
    height: 42px;

    padding: 0 12px;

    border: 1px solid #d0d0d0;
    border-radius: 8px;

    outline: none;

    background: #fff;
    color: #111;

    font: inherit;
    font-size: 14px;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.fields input::placeholder {
    color: #999;
}

.fields input:focus {
    border-color: #111;

    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.08);
}

/* -------------------- */
/* Error                */
/* -------------------- */

.login-error {
    position: absolute;

    top: 50px;
    right: 0;

    width: 100%;

    color: #c62828;

    font-size: 12px;
    line-height: 18px;

    text-align: right;

    opacity: 0;

    transition: opacity 0.15s ease;
}

.login-error.visible {
    opacity: 1;
}

/* -------------------- */
/* Footer               */
/* -------------------- */

footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 18px;

    text-align: center;

    color: #999;

    font-size: 12px;

    pointer-events: none;
}

/* -------------------- */
/* Mobile               */
/* -------------------- */

@media (max-width: 650px) {
    .login-area {
        top: 16px;
        right: 16px;
    }

    .login-popup {
        flex-direction: column;
        align-items: stretch;
    }

    .fields {
        flex-direction: column;
    }

    .fields input {
        width: 180px;
    }

    .submit-button {
        width: 180px;
    }

    .login-error {
        top: 142px;
        width: 180px;
    }

    .main-image {
        max-width: 92vw;
        max-height: 75vh;
    }
}
