@import "global.css";

* {
    box-sizing: border-box;
}

html, body {
    margin: 0px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
}

button {
    height: 2.5rem;
    padding: 0px;
    border: none;
    font-style: italic;
    font-size: 1.2rem;
    text-align: center;
    line-height: 2.5rem;
    text-transform: uppercase;
    color: white;
}

    button.select {
        width: 100%;
        background-color: var(--med-blue);
    }

        button.select:hover {
            background-color: var(--dark-blue);
        }

    button.select-disabled {
        width: 100%;
        background-color: var(--disabled);
    }

.icon-back {
    width: 24px;
    height: 24px;
    background-color: #ffffff; /* any color */
    -webkit-mask: url('/client/images/back.mask.svg') no-repeat center / contain;
    mask: url('/client/images/back.mask.svg') no-repeat center / contain;
}

.header-box {
    grid-row: 1;
    display: flex;
    flex-direction: row;
    height: 6rem;
    padding: 0px;
    color: white;
    background-color: var(--dark-blue);
    vertical-align: middle;
    text-align: right;
}

    .header-box .header-back-box {
        display: inline-block;
        position: sticky;
        width: 5rem;
        height: 100%;
        background-color: var(--very-dark-gray);
    }

        .header-box .header-back-box .back-icon {
            display: inline-block;
            margin: 1.5rem 0px;
            padding: 0px;
            width: 5rem;
            height: 3rem;
            text-align: center;
            background-color: #ffffff; /* any color */
            -webkit-mask: url('/client/images/back-mask.svg') no-repeat center / contain;
            mask: url('/client/images/back-mask.svg') no-repeat center / contain;
        }

    .header-box .header-back-box-disabled {
        display: none;
        position: sticky;
    }

    .header-box .header-label-box {
        flex: 1;
        min-width: 0;
    }

        .header-box .header-label-box .label {
            display: inline-block;
            position: sticky;
            width: calc(100% - 1rem);
            padding: var(--header-padding) 0px;
            margin-right: .5rem;
            font-size: 1.5rem;
            font-style: italic;
            text-transform: lowercase;
            letter-spacing: 1rem;
            line-height: 1.5rem;
            text-align: right;
        }

.form-box {
    min-height: calc(400px - 11rem);
    background-color: white;
    font-family: Arial, sans-serif;
}

/*
 * LAYOUT SKELETON (flex column)
 * ---------------------------------------------------------------
 * #view is a full-viewport flex column: header (fixed 6rem),
 * form-box (flex: 1 -> fills ALL space between header and navbar,
 * scrolls internally if content is taller), navbar (6rem).
 *
 * This replaces the old per-breakpoint `height: calc(...)` rules:
 * the form-box no longer needs viewport math to fill the middle,
 * so it can never overlap or push the navbar off screen. The old
 * content-hiding media queries (time-box hidden on short viewports)
 * are kept as-is — they remain the tool for tight vertical space.
 */
#view {
    display: flex;
    flex-direction: column;
    min-height: 100vh;       /* fallback for older browsers */
    min-height: 100dvh;      /* mobile URL-bar-aware height */
}

    /* fill whatever vertical space the header and navbar leave */
    #view .form-box {
        flex: 1 1 auto;
        overflow-y: auto;    /* squeezed content scrolls, never overlaps */
    }

.sidebar a {
    display: block;
    height: 100%;
    width: 100%;
}

.sidebar .navlink-active {
    height: 100%;
    width: 100%;
    background-color: var(--dark-gray);
}

.navmenu {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 6rem;
    background-color: var(--med-dark-gray);
}

    .navmenu .navlink-box {
        display: block;
        height: 6rem;
        width: 100%;
        color: white;
        background-color: var(--med-dark-gray);
    }

        .navmenu .navlink-box:hover {
            background-color: var(--dark-gray);
        }

    .navmenu .navlink-box-selected {
        display: block;
        height: 6rem;
        width: 100%;
        color: white;
        background-color: var(--dark-gray);
    }

    .navmenu .navlink {
        position: relative;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        border: 0px;
        text-align: center;
        font-weight: bold;
        font-size: .7em;
        color: white;
    }

        .navmenu .navlink img {
            width: 40px;
            border: 0px;
        }

    .navmenu .navlink-last {
        position: relative;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        border: 0px;
        text-align: center;
        font-weight: bold;
        font-size: .7em;
        color: white;
        /*height: 100%;
        border: none;
        padding: 15px 0px;
        text-align: center;
        font-weight: bold;
        font-size: 8pt;
        color: var(--bright-gray);*/
    }

        .navmenu .navlink-last img {
            width: 40px;
            border: 0px;
        }

    .navmenu .navlink p {
        margin-top: 0px;
    }

    .navmenu .navlink-last p {
        margin-top: 0px;
    }

    .navmenu .navlink-active p {
        margin-top: 0px;
    }

@media (max-width: 499.98px) {
}

@media (min-width: 500px) and (max-width: 899.98px) {
}

@media (max-width: 499.98px) {

    .header-box {
        width: max(100vw, 400px);
    }

    .form-box {
        width: max(100vw, 400px);
    }

    /* narrow viewports: navbar is a horizontal bar pinned to the bottom
       (flex column above guarantees the form-box ends exactly where it begins) */
    .navmenu {
        display: flex;
        flex-direction: row;
        position: sticky;
        bottom: 0px;
        width: 100%;
        height: 6rem;
        flex-shrink: 0;
    }

        .navmenu .navlink-box {
            height: 100%;
            width: 100%;
        }

    @media (max-height: 529.98px) {
    }

    /* (old form-box height calc rules removed — flex fill handles it) */
}

@media (min-width: 500px) and (max-width: 899.98px) {
    .header-box {
        width: min(100vw, 400px);
    }

    .form-box {
        width: min(100vw, 400px);
        margin: 0px auto;   /* center the capped column */
    }

    /* mid-width: navbar still a bottom bar (same as narrow) */
    .navmenu {
        display: flex;
        flex-direction: row;
        position: sticky;
        bottom: 0px;
        width: 100%;
        height: 6rem;
        flex-shrink: 0;
    }

    /* (old form-box height calc rules removed — flex fill handles it) */
}

/*
 * DESKTOP (>= 900px): navbar becomes a LEFT SIDEBAR column.
 * The form-box stays a capped content column (max-height reuses the
 * old --heightfull-widthfull value) so buttons hug the content instead
 * of dropping to the bottom of a tall maximized window.
 */
@media (min-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0px;
        top: 6rem;          /* sits below the fixed-size header */
        bottom: 0px;
        width: 6rem;
    }

    /* header spans the content column + navbar column on desktop */
    .header-box {
        width: 100vw;
        position: relative;
    }

    /* back button hugs the far left, above the navbar sidebar column
       (same width as the navbar, header height unchanged) */
    .header-box .header-back-box {
        position: absolute;
        left: 0px;
        top: 0px;
        width: 6rem;
        height: 6rem;
    }

    .form-box {
        margin-left: 6rem;  /* clear the sidebar column */
        max-height: var(--heightfull-widthfull); /* content-hug on tall windows */
    }

    /* (old form-box height calc rules removed — flex fill + max-height handles it) */
}

@media (min-width: 900px) and (max-width: 1299.98px) {
    .header-box {
        width: min(100vw, 400px);
    }

    .form-box {
        width: min(100vw, 400px);
    }
}

@media (min-width: 1300px) {
    .header-box {
        width: min(100vw, 400px);
    }

    .form-box {
        width: min(100vw, 400px);
    }
}
/* auth (login/activate) — same design language as other pages */
.auth-screen {
    display: grid;
    place-items: center;
    min-height: calc(var(--min-height-width500) - 11rem);
}

.auth-inner {
    width: calc(100% - 1rem);
    margin-left: 1rem;
}

    .auth-inner input, input.note {
        display: block;
        width: 80%;
        margin: 0px auto;
        padding: 0px .5rem;
        border-top: none;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid var(--light-gray);
        font-size: 1.2rem;
    }

        .auth-inner input + input {
            margin-top: .5rem;
        }

.auth-btn {
    margin-top: .5rem;
    font-style: italic;
}

#msg {
    text-align: center;
    color: var(--med-dark-gray);
}

    #msg .err {
        color: var(--med-dark-gray);
    }
