:root {
    --color-light: #EBE6DD;
    --color-light-theme-bg: #BE9A7A;
    --color-font-light: white;
    --color-dark: #551C0A;
    --color-font-dark: black;
    --color-dark-secondary: #0A1F57;
    font-family: "Inter", sans-serif;
}
html, body {
    margin: 0;
    height: 100%;
    background-color: var(--color-dark);
}

button:enabled, .clickable {
    transition: opacity ease-in-out 0.4s;
    cursor: pointer;
}
button:enabled:hover, .clickable:hover {
    opacity: 80%;
}

main {
    margin: 0;
    background-color: var(--color-light);
    color: var(--color-font-dark);
    position: relative;
    z-index: 100;

    & > div {
        max-width: 150rem;
        padding: 1rem;
        margin: 1rem;
    }

    @media (width <= 30rem) {
        & > div:empty {
            display: none;
        }
    }

    & .info {
        background-color: var(--color-light-theme-bg);
        padding: 1rem;
        white-space: nowrap;

        @media (width > 30rem) {
            & {
                margin-top: 2rem;
                padding: 1rem 2rem;
            }
        }
        @media (width <= 30rem) {
            & {
                margin: 0 auto;
                display: block;
                text-align: center;
            }
        }
    }

    & .logo {
        aspect-ratio: 1;

        @media (width > 30rem) {
            & {
                max-width: 40%;
                float: left;
                margin-right: 1rem;
                margin-bottom: 1rem;
            }
        }
        @media (width <= 30rem) {
            & {
                max-width: 60%;
                margin: 0 auto;
                display: block;
            }
        }
    }

    & .main-end {
        margin: 0;
        padding: 0;
        height: 2rem;
        clear: both;
        mask-size: 100% 2rem;
        mask-repeat: no-repeat;
        mask-position: top center;
        mask-image: url("img/curve-mask.svg");
        background-color: var(--color-light);
        top: 2rem;
        position: relative;
    }
}
footer {
    padding-top: 2rem;
    align-items: center;
    background-color: var(--color-dark);
    bottom: 0;
    color: var(--color-font-light);
    left: 0;
    position: sticky;
    width: 100%;
    z-index: 0;

    & > div {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;

        & > div {
            margin: 2rem 1rem;
            width: fit-content;
        }
    }

    & a {
        color: var(--color-font-light);
    }
}

@keyframes loading {
    0% { background-position-x: -80%; }
    100% { background-position-x: 200%; }
}

.loading {
    animation-name: loading;
    animation-duration: 3s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    background-image: url("img/metalic-sheen.svg");
    background-size: contain;
    background-repeat: no-repeat;
}

dialog {
    background-color: var(--color-light);
    color: var(--color-font-dark);
    width: 50%;
    height: 80%;

    & h1 {
        margin: 0 0.5rem;
    }

    @media (width <= 80rem) {
        width: 80%;
    }
    @media (width <= 30rem) {
        width: 100%;
        height: 100%;
    }

    & form {
        display: flex;
        flex-direction: column;
        height: inherit;
        gap: 0.25rem;
    }

    & div.stretch{
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }

    & div.stretch textarea {
        flex-grow: 1;
    }

    & div.ctrl {
        display: flex;
        flex-direction: row;
        justify-content: end;
    }

    & input, select, textarea {
        width: 100%;
        display: block;
        box-sizing: border-box;
    }

    & button {
        margin: 0 0.75rem;
        padding: 0.375rem 0.75rem;
        font-weight: 400;
        border-radius: 0.375rem;
    }

    & button.primary {
        background-color: var(--color-dark);
        color: var(--color-font-light);
    }

    & button.secondary{
        background-color: var(--color-dark-secondary);
        color: var(--color-font-light);
    }

    & .error:empty {
        display: none;
    }

    & .error {
        background-color: var(--color-dark-secondary);
        color: var(--color-font-light);

        width: auto;
        height: fit-content;
        padding: 0.375rem;

        & span {
            vertical-align: middle;
            display: inline-block;
        }
    }

    & textarea {
        height: 30%;
    }

    &::backdrop {
        background-color: rgb(0 0 0 / 40%);
    }
}

dialog.dialog-small {
    width: 40%;
    max-width: 40rem;
    height: fit-content;
}
