* {
    font-family: "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "Helvetica Neue", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #FFFFFF;
}

form {
    width: 20rem;
    max-width: 90%;
    align-self: flex-start;
    padding: 3rem 0;
    background-color: inherit;
    opacity: 0;
    will-change: opacity;
    animation: fadeIn 0.25s 0.6s 1 ease-out forwards;

    .heading {
        margin-bottom: 2rem;
        margin-left: -2em;
        margin-right: -2em;
        padding: 1.2rem 2rem;

        svg {
            display: block;
            width: 11rem;
            max-width: 100%;
            margin: auto;
            padding: 0;
            fill: #3700B3;
            filter: none;
        }
    }

    label {
        display: block;
        font-size: 0.78rem;
        position: relative;

        input {
            display: block;
            width: 100%;
            padding: 0.4rem 0.4rem;
            margin-top: 0.3rem;
            margin-bottom: 0.6rem;
            font-family: inherit;
            font-size: 0.85rem;
            font-weight: normal;
            color: #000000;
            border: solid thin #CCCCCC;
            border-radius: 3px;
            outline: none;
            /* ios overwrite */
            -webkit-appearance: none;
            /* -webkit-border-top-left-radius: 0px;
            -webkit-border-top-right-radius: 0px;
            -webkit-border-bottom-left-radius: 0px;
            -webkit-border-bottom-right-radius: 0px; */
        }

        input[type=text]:focus,
        input[type=password]:focus {
            border-color: #AFCFFB;
            box-shadow: 0 0 4px #AFCFFB;
        }

        input[type=password] {
            padding-right: 2.5rem;
        }

        /* toggle password visibility */
        button#toggle-password {
            position: absolute;
            bottom: 0;
            right: 0;
            display: block;
            height: 1.935rem;
            width: 1.935rem;
            font-size: 0.85rem;
            background-color: transparent;
            background-size: 1rem;
            background-repeat: no-repeat;
            background-position: center center;
            border: none;
            outline: none;
        }
        input[type=password] + button#toggle-password {
            background-image: url(/ui-icons/visibility_off.svg);
        }
        input[type=text] + button#toggle-password {
            background-image: url(/ui-icons/visibility_on.svg);
        }
    }

    /* tabs to sign-in to webapp vs. mobile collector */
    input.inline-radio, input.inline-radio + label {
        display: none;
    }

    #submit-button {
        position: relative;
        width: 100%;
        border: none;
        background-color: #3700B3;
        color: #FFFFFF;
        font-weight: 300;
        padding: 0.8em 0;
        margin-top: 1.5em;
        box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.16), 0px 2px 10px 0px rgba(0, 0, 0, 0.12);
        transition: all 0.18s ease 0s;
        outline: none;
        border-radius: 2px;
        user-select: none;
        will-change: filter, box-shadow, color;

        &:hover {
            opacity: 0.85;
            box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.31), 0px 2px 10px 0px rgba(0, 0, 0, 0.27);
        }
    }
    
    /* hide the default text and show spinner in the button after submitting the form */
    #submit-button.loading {
        color: #3700B3 !important;
    }
    #submit-button.loading:after {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        border: 4px solid transparent;
        border-top-color: #FFFFFF;
        border-radius: 50%;
        transform: rotate(0turn);
        animation: button-loading-spinner 1s ease infinite;
    }
    
    a {
        display: block;
        margin-top: 2em;
        color: #018786;
        text-decoration: none;
        font-size: 0.875rem;

        &:hover {
            text-decoration: underline;
        }
    }
}

.message {
    color: #FFFFFF;
    display: none;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    padding: 0.6em 1.7em;
    z-index: 1;

    &.green-msg, &.red-msg, &.blue-msg {
        display: block;
    }
    &.green-msg {
        background-color: #5CB85C;
        border: thin solid #4CA84C;
    }
    &.red-msg {
        background-color: #D35351;
        border: thin solid #C34341;
    }
    &.blue-msg {
        background-color: #009CDE;
        border: thin solid #009CDE;
    }
}

/* splash screen animation beginning */
#animation {
    background-color: #FFFFFF;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    animation-name: fadeOut;
    animation-delay: 6s;
    animation-duration: 0.15s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in;
    animation-fill-mode: both;

    #circle {
        position: absolute;
        top: 50%;
        left: 50%;
        animation: circle-show .5s 1.25s 1 linear forwards, circle-transform .6s 1.25s 1 cubic-bezier(0, 0, .2, 1);
        background: #EEEEEE;
        border-radius: 50%;
        opacity: 1;
        width: 90vmin;
        height: 90vmin;
        transform: translate(-50%, -55%) scale(0);
        will-change: opacity, transform;
        z-index: 1;
    }

    .wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 99999999;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 2;

        #logo {
            display: block;
            width: auto;
            height: 15vmin;
            padding: 0;
            fill: url(#my-cool-gradient) #FFFFFF;
            transform: scale(.68);
            opacity: 0;
            filter: grayscale(1) drop-shadow(0 11px 5px rgba(0, 0, 0, .23)) opacity(0.17);
            animation: fadeIn .5s .5s 1 linear forwards, growbounce 1.75s .5s 1 cubic-bezier(0, 0, .67, 1) forwards, colors .6s 1.25s 1 cubic-bezier(0, 0, .2, 1) forwards;
            will-change: opacity, transform, filter;
            z-index: 3;
        }

        #progress {
            animation: fadeIn .5s 2.5s 1 forwards;
            background-color: #F1F1F1;
            height: 2px;
            margin: 1.4em auto 0.8em;
            opacity: 0;
            overflow: hidden;
            position: relative;
            width: 37vmin;
            will-change: opacity;
            z-index: 3;

            &::before {
                animation: loading 4s 3s linear forwards;
                background-color: #DB4437;
                content: '';
                display: block;
                height: 100%;
                position: absolute;
                transform: translateX(-100%);
                width: 100%;
                will-change: transform;
                z-index: 3;
            }
        }

        #loading_txt {
            animation: fadeIn .25s 1.25s 1 forwards;
            opacity: 0;
            color: #757575;
            font: 0.7em/0.7em Arial, sans-serif;
            letter-spacing: .2px;
            text-align: center;
            will-change: opacity;
            z-index: 3;
        }
    }
}
/* splash screen animation end */

/* sm */
@media (min-width: 768px) {
    form {
        align-self: unset;
        padding: 0 2rem 2rem;
        box-shadow: 0 2px 17px rgba(0, 0, 0, 0.17);
        box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.18),
            0px 8px 10px 1px rgba(0, 0, 0, 0.14),
            0px 3px 15px 2px rgba(0, 0, 0, 0.12);
        border-radius: 10px;
        overflow: hidden;
        transform: translateY(-4em);

        .heading {
            background-color: #3700B3;

            svg {
                width: 11rem;
                fill: #FFFFFF;
            }
        }

        label {
            margin-bottom: 1.3em;
        }
    }

    .message {
        width: unset;
        max-width: 44vw;
        top: 2.5em;
        left: 50%;
        transform: translateX(-50%);

        &.green-msg {
            min-width: 27em;
        }
    }

    #animation {
        .wrapper {
            #progress {
                height: 4px;
                margin: 2.0em auto 1.1em;
            }
            #loading_txt {
                font: 1.1em/1.1em Arial, sans-serif;
                letter-spacing: .2px;
            }
        }
    }

}

@media screen and (min-width: 1024px) {
    #animation {
        .wrapper {
            #progress {
                height: 4px;
                margin: 2.7em auto 1.1em;
            }
            #loading_txt {
                font: 1.2em/1.2em Arial, sans-serif;
                letter-spacing: .2px;
            }
        }
    }

    /* Seasonal backgrounds set by JS */
    body.pancake {
        background-position: 4rem calc(100% - 1rem), calc(100% - 4rem) calc(100% - 1rem);
        background-size: 7%, 6%;
        background-repeat: no-repeat;
        background-image: url(static/bg-pancake-left.jpg), url(static/bg-pancake-right.jpg);
    }
    body.patrick {
        background-position: 0 118%;
        background-size: 36%;
        background-repeat: repeat-x;
        background-image: url(static/bg-patrick2.jpg);
    }
    body.roseoftralee {
        background-position: calc(100% - 4rem) calc(100% - 1rem);
        background-size: 7%;
        background-repeat: no-repeat;
        background-image: url(static/bg-roseoftralee.png);
    }
    body.halloween {
        background-position: calc(100% - 4rem) bottom;
        background-size: 18%;
        background-repeat: no-repeat;
        background-image: url(static/bg-halloween.jpg);
    }
    body.winter {
        background-position: 0 109%;
        background-size: 100%;
        background-repeat: repeat-x;
        background-image: url(static/bg-winter.png);
    }
    body.newyear {
        background-position: bottom;
        background-size: 35%;
        background-repeat: repeat-x;
        background-image: url(static/bg-newyear.gif);
    }
}

@media screen and (max-width: 1024px) {
    form {
        label {
            input {
                font-size: 1rem;
            }
            button#toggle-password {
                font-size: 1rem;
                width:  2.11rem;
                height: 2.11rem;
            }
        }

        input.inline-radio + label {
            display: inline-block;
            color: #AAAAAA;
            border-bottom: solid 3px #AAAAAA;
            padding: 0.8em 3em 0.6em 0;
            margin-bottom: 1.4em;
            transition: all 0.3s ease;
        }

        input.inline-radio:checked + label {
            color: #018786;
            border-bottom: solid 3px #018786;
        }

        #submit-button {
            min-height: 48px;
        }
    }
}

@keyframes button-loading-spinner {
    from { transform: rotate(0turn); }
    to { transform: rotate(1turn); }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    99% {
        opacity: 0;
        visibility: visible;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-100%);
    }
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    5% { transform: translateX(-80%); }
    15% { transform: translateX(-15%); }
    25% { transform: translateX(-15%); }
    30% { transform: translateX(-6.66%); }
    45% { transform: translateX(-6.66%); }
    50% { transform: translateX(-5%); }
    65% {transform: translateX(-5%); }
    70% { transform: translateX(-3%); }
    95% { transform: translateX(-3%); }
    100% { transform: translateX(-1.66%); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes growbounce {
    43% {
        animation-timing-function: cubic-bezier(.8, 0, .2, 1);
        transform: scale(.75)
    }
    60% {
        animation-timing-function: cubic-bezier(.8, 0, 1, 1);
        transform: translateY(-16px)
    }
    77% {
        animation-timing-function: cubic-bezier(.16, 0, .2, 1);
        transform: none
    }
    89% {
        animation-timing-function: cubic-bezier(.8, 0, 1, 1);
        transform: translateY(-5px)
    }
    100% { transform: none; }
}

@keyframes colors {
    0% { filter: grayscale(1) drop-shadow(0 11px 5px rgba(0, 0, 0, .23)) opacity(0.17); }
    100% { filter: grayscale(0) drop-shadow(0 11px 5px rgba(0, 0, 0, .23)) opacity(1); }
}

@keyframes circle-show {
    100% { opacity: 0; }
}

@keyframes circle-transform {
    100% { transform: translate(-50%, -55%) scale(1); }
}