/*
 * Copyright 2022 Cendio AB.
 * For more information, see http://www.cendio.com
*/

/*
 * NOTE: Use multiples of 6px for alignments (margins, padding, etc.)
 */

@import "constants.css";
@import "fonts.css";
@import "input.css";
@import "baseelems.css";

/* ------- TOP ELEMENTS -------- */

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 100dvh;
    background-color: white;
    margin: 0px;
}
@supports not (min-height: 100dvh) {
    body {
        min-height: 100vh;
    }
    :root.noVNC_connected body {
        min-height: unset;
    }
}
/* This is just to get the main box centered */
body::before {
    content: "";
}

.main_box {
    width: 500px;
    /*
     * This has the same effect as justify-content: safe center;
     * but works on all browsers.
     */
    margin: 48px;
    padding: 0 180px;
    border: var(--border-width) solid var(--thinlinc-lightgrey);
    border-radius: var(--large-border-radius);
    /*
     * Almost everything here will be some small UI, meaning Poppins
     * should be used. It's easier to style the execptions back to
     * Mulish.
     */
    font-family: Poppins, sans-serif;
    text-align: center;
    transition: margin 0.3s linear;
}
@media (max-width: 958px) {
    /* Hide border on small devices. The limit of 958px stems from the main box
       width of 862px + 2*48px. Horizontal margins are set to be at least 48px
       above and below the max-width condition.
   */
    .main_box {
        max-width: calc(100% - 48px * 2);
        border: none;
        padding: 0;
        margin: 0px 48px 0px 48px;
    }
}

/* Switch between noVNC and our elements based on state */

:root:not(.noVNC_connected) #noVNC_container {
    display: none;
}
:root:not(.noVNC_connected),
:root:not(.noVNC_connected) body {
    height: unset;
    touch-action: unset;
}

:root.noVNC_loading .main_box,
:root.noVNC_connecting .main_box,
:root.noVNC_connected .main_box,
:root.noVNC_disconnecting .main_box {
    display: none;
}

:root.noVNC_loading .bottom_graphic,
:root.noVNC_connecting .bottom_graphic,
:root.noVNC_connected .bottom_graphic,
:root.noVNC_disconnecting .bottom_graphic {
    display: none;
}
:root.noVNC_loading body,
:root.noVNC_connecting body,
:root.noVNC_connected body,
:root.noVNC_disconnecting body {
    margin-bottom: 0px;
}

/* ------- MAIN CONTENT -------- */

#content {
    width: 100%;
}

#logo {
    display: block;
    margin: 4em auto;
}

.main_box > *,
[id="content"] > * {
    margin: 2em auto;
}

[id="content"] form > * {
    display: block;
    width: 100%;
    /* We want strict adherence to the above width */
    box-sizing: border-box;
    margin: 1em auto;
}

[id="content"] form > button {
    width: unset;
    box-sizing: unset;
    margin: 2em auto;
}

/* ------- FOOTER -------- */

#footer {
    font-size: 0.8em;
}

#footer a {
    color: black;
}

#footer .version {
    font-weight: 600;
}

/* ------- BOTTOM GRAPHIC -------- */

.bottom_graphic {
    /* match the colors at ends of the bottom_graphic image */
    background-image: url("../images/bottom_graphic.svg"),
        linear-gradient(to right, #0025a2 0%, #0025a2 45%, #0029b5 55%, #0029b5 100%);
    background-position: center;
    min-height: 6px;
    height: 3vh;
    max-height: 48px;
    width: 100%;
}
