:root {
    --midnight: #030509;
    --steel: #818a91;
    --silver: #dfdfd0;
    --gallery: #f3f3f3;
    --mercury: #f0f0f0;
    --sea: #006fd1;
    --cerulean: #0096ff;
    --azure: #07f;
    --polar: #f0f8fc;
    --ice: #e5f3fb;
    --ion-header-height: 46px;
}

html, body, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}

html {
    font-size: 62.5%;
    font-family:'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}

body {
	line-height: 1;
	background-color: #fff;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}

table {
	border-collapse: collapse;
	border-spacing: 0;
}

.ion-header {
    position: fixed;
    inset: 0 0 auto;
    display: flex;
    align-items: center;
    background: #fff;
    z-index: 2;
    height: var(--ion-header-height);
    border-bottom: 1px solid var(--mercury);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

    & > div {
        flex: 1;
        height: 22px;
        margin: 0 1.5rem;
        background: url(./ion-analytics.svg) 0 50% no-repeat;
        background-size: contain;

        & span {
            font-size: 0;
            opacity: 0;
        }
    }
}

.page-wrapper {
    box-sizing: border-box;
    height: 100vh;
    min-height: max(500px, 100dvh);
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    & .mainBody {
        flex: 1;
    }

    & .mainCentral {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-content: center;
        gap: 2rem;
        height: 100%;
        width: min(420px, 90vw);
        margin: 0 auto;
    }
}

/* in case there is a ion header, add some padding to the top */
body:has(.ion-header) {
    & .page-wrapper {
        padding-top: calc(var(--ion-header-height) + 1.5rem);
    }
}

#mainTitle {
    font-size: 1.4rem;
    padding: 1em 0;

    & .dealogic {
        margin: 0 0 4.5rem;

        & h1 {
            height: 30px;
            background: url(./dealogic.png) 0 50% no-repeat;
            background-size: contain;

            & span {
                font-size: 0;
                opacity: 0;
            }
        }
    }

    & p {
        margin: 0;

        & + p {
            margin-top: .35em;
        }
    }
}

.mainBody form {
    font-size: 1.4rem;
    padding: 3rem;
    border: 1px solid var(--gallery);
    border-radius: 5px;
    box-shadow:
        0 4px 4px rgba(0, 0, 0, 0.017),
        0 7px 11px rgba(0, 0, 0, 0.025),
        0 12px 26px rgba(0, 0, 0, 0.033),
        0 26px 80px rgba(0, 0, 0, 0.05);

    & fieldset .dl-field {
        margin-bottom: 16px;
    }

    /* disable colored background on auto-fill */
    & input {
        transition: background 5000s 10s ease !important;
    }

    & dl-input {
        display: block;
        width: 100%;
    }

    & dl-input[type="password"] {
        & input {
            font-family: Verdana;
            letter-spacing: 0.1em;
        }
    }

    & .dl-select {
        position: relative;
        border: 1px solid var(--silver);
        border-radius: 3px;
        transition: all .3s ease;

        &:focus-within {
            border-color: var(--cerulean);
        }

        &::after {
            content: '';
            position: absolute;
            display: inline-block;
            right: 12px;
            top: 50%;
            border: 4px solid transparent;
            border-top-color: var(--midnight);
            border-radius: 3px;
            translate: 0 -25%;
        }

        & select {
            display: block;
            appearance: none;
            width: 100%;
            background: transparent;
            border: 0;
            padding: 8px 12px;
            font-family: inherit;
            font-size: 12px;
            line-height: 1.33;

            &:focus {
                outline: none;
            }
        }
    }

    & fieldset.actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 3rem;
        margin: 3rem 0 0;
    }

    & label.dl-checkbox {
        margin: 0;

        & .label {
            font-size: 92%;
        }
    }
}

.forgot-password {
    margin: 3rem 0 0;
    text-align: center;

    & a {
        display: inline-block;
        color: var(--cerulean);
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

.footer {
    --color: var(--steel); 

    font-size: 12px;
    padding: 4em 2em 1em;
    text-align: center;
    color: var(--color);
    
    & .support,
    & .disclaimer,
    & .dealogicLink {
        margin: 1.5rem 0 0;
        color: var(--color);

        & p {
            margin: 0;
            color: var(--color);
        }

        &:empty {
            display: none;
        }

        &:not(:has(> *)) {
            display: none;
        }
    }

    & .support {
        --color: var(--midnight);
        box-sizing: border-box;
        display: block;
        text-align: left;
        width: min(420px, 90vw);
        margin: 1.5rem auto 3rem;
        padding: 1.5rem;
        border: 1px solid var(--ice);
        border-radius: 5px;
        background: var(--polar);
        /* max-height: 6lh; */
        overflow-y: auto;

        & .login-support-details {
            white-space: pre-wrap;
        }

        & .supportEmail {
            font-weight: bold;
            margin-top: .6em;
        }
    }

    & a {
        color: var(--color);
        text-decoration: underline;

        &:hover {
            color: var(--cerulean);
        }
    }
}

form[name="frmForgot"] {
    padding: calc(var(--ion-header-height) + 14px) 14px 14px;

    & .header {
        position: fixed;
        inset: 0 0 auto;
        display: flex;
        align-items: center;
        background: #fff;
        z-index: 2;
        height: var(--ion-header-height);
        padding: 0 14px;
        border-bottom: 1px solid var(--mercury);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    & article {
        & p {
            /* margin: 0; */
            line-height: 1.1;

            & + p {
                /* margin-top: .75em; */
            }

            &:empty {
                display: none;
            }
        }
    }

    & div.modes {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin: 3rem 0 1.5rem;
    }

    & fieldset.username,
    & fieldset.userid,
    & fieldset.actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 34rem;
        margin: 0 auto;
    }

    & fieldset.username,
    & fieldset.userid {
        gap: 0.5rem;
        
        & > label.dl-radio {
            flex: 1;
        }

        & .dl-field {
            display: flex;
            align-items: center;
            gap: 1rem;

            & > label {
                display: none;
                padding: 0;
            }
        }

        &:has(input[disabled]) {
            & .dl-field {
                opacity: .5;
            }
        }
    }

    & fieldset.actions {
        justify-content: flex-end;
    }
}