/* Helpers 
------------------------------------------------------ */
.bold {
    font-weight: 600;
}

.margin-bottom-7 {
    margin-bottom: 7px;
}

/* Containers
------------------------------------------------------ */
body * {
    box-sizing: border-box;
}

.body {
    margin: 0;
}

.login-theme {
    --infoMentorMainColour: #660896;
    --textColour: #444955;
    --formWidth: 600px;
    --loginFormWidth: 335px;
    --announcementWidth: min(calc(100% - 40px), 560px);
}

.login-container {
    color: var(--textColour);
    font-family: 'Open Sans', sans-serif;
    display: flex;
}

/* Panels
------------------------------------------------------ */
.left-panel {
    padding: 17px 0;
    width: 50%;
    max-width: var(--formWidth);
    display: grid;
    gap: 0px 0px;
    grid-template-rows: max-content max-content auto;
    grid-template-areas: 
        "help"
        "announcement"
        "main";
    min-height: 100vh;
}

.help { grid-area: help; }
.announcement { grid-area: announcement; }

.main {
    grid-area: main;
}

/* using position: fixed allows banner to be centred & fill full height, but allows form to scroll if it exceeds page height */
.right-panel {
    position: fixed;
    display: flex;
    height: 100%;
    background-color: #F8F3FA;
    align-items: center;
    justify-content: center;
    width: max(50%, calc(100% - var(--formWidth)));
    left: min(50%, var(--formWidth));
}

.banner-image {
    background-image: url(../../images/login/login-banner-sweden.manual-cache-key.1.png);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    width: min(100%, 1144px);
    height: 551px;
}
.banner-image.is-iceland {
    background-image: url(../../images/login/login-banner-iceland.manual-cache-key.1.png);
}

.login-form {
    width: var(--loginFormWidth);
    justify-self: center;
    margin-top: auto;
    margin-bottom: auto;
}

/* Need Help Link
------------------------------------------------------ */
.need-help {
    display: inline-block;
    justify-self: center;
    text-align: left;
    width: var(--loginFormWidth);
}

.need-help-icon {
    border-radius: 50%;
    border: 1px solid var(--infoMentorMainColour);
    width: 25px;
    height: 25px;
    display: inline-block;
    margin-right: 10px;
    text-align: center;
    line-height: 1.6em;
    flex-shrink: 0;
}

.link.need-help-link {
    font-size: .9em;
    width: 445px;
    display: flex;
    align-items: center;
}

.link.need-help-link:hover { text-decoration: none; }
.need-help-link:hover .need-help-text { text-decoration: underline; }

/* Announcements
------------------------------------------------------ */
.announcement {
    width: var(--announcementWidth);
    background-color: #FEF9F2;
    border: 1px solid #CA5010;
    border-radius: 5px;
    justify-self: center;
    padding: 17px;
    margin-top: 16px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: min-content 1fr;
    grid-template-rows: min-content 1fr;
    grid-template-areas: ". ." ". announcement-message";
}

.announcement-icon {
    margin-right: 16px;
    /* https://stackoverflow.com/a/64750654/3244751 */
    filter: invert(30%) sepia(100%) saturate(897%) hue-rotate(351deg) brightness(101%) contrast(98%);
}

.announcement-header {
    margin: 0;
    font-size: 1.1em;
}

.announcement-message {
    grid-area: announcement-message;
}

.announcement p { margin: 0 0 10px; }
.announcement p:last-child { margin-bottom: 0; }

/* Inputs
------------------------------------------------------ */
.input-container {
    display: flex;
    position: relative;
    margin-bottom: 16px;
}

.input {
    -webkit-appearance: none;
    padding: 10px 12px 10px 46px;
    border-radius: 2px;
    border: 1px solid #DBDCDD;
    width: 100%;
}

.input-container--pin .input {
    width: 130px;
    font-size: 1.2em;
}
.input-container--pin .input::placeholder {
    font-size: .7em;
    /* vertical alignment hack - https://stackoverflow.com/a/47357850/3244751 */
    transform: translate3d(0,-2px,0);
}

.input-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    height: 25px;
    width: 25px;
    transform: translate(-50%, -50%);
    /* https://stackoverflow.com/a/64750654/3244751 */
    filter: invert(79%) sepia(6%) saturate(93%) hue-rotate(182deg) brightness(84%) contrast(85%);
}

.input-container--pin .input-icon:not(.disabled) {
    filter: none;
}

/* Select 
------------------------------------------------------ */
.select {
    padding: 10px 12px;
    width: 100%;
}

/* Buttons
------------------------------------------------------ */
.button {
    -webkit-appearance: none;
    width: 100%;
    border-radius: 5px;
    padding: 10px 12px;
    color: white;
    border: none;
    cursor: pointer;
    margin-bottom: 16px;
    display: inline-flex;
    font-size: 1em;
    text-decoration: none;
    justify-content: center;
}

.button__with-icon {
    display: flex;
    justify-content: unset;
    align-items: center;
    padding: 0;
}

.button__with-icon--text {
    flex-grow: 1;
    text-align: center;
    margin-right: 46px;
}

.button--purple {
    background-color: var(--infoMentorMainColour);
    margin-top: 16px;
}

.button--white {
    border: 1px solid var(--infoMentorMainColour);
    color: var(--infoMentorMainColour);
    background-color: white;
}

.button--O365-sign-in {
    background-color: #E54128;
}

.button--google-sign-in {
    background-color: #4285F4;
}

.button--commune-sign-in {
    background-color: #6C7587;
}

.button-icon {
    width: 25px;
    height: 25px;
    border-right: 1px solid #fff;
    padding: 4px 7px 4px 4px;
    box-sizing: content-box;
    left: 0;
    top: 0;
    margin: 4px 5px;
}

/* Links
------------------------------------------------------ */
.link {
    color: var(--infoMentorMainColour);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

    .link:hover {
        text-decoration: underline;
    }

.link--forgotten-password {
    font-size: .8em;
    margin-bottom: 16px;
}

/* SSO
------------------------------------------------------ */
/* hides "or" heading if has no siblings */
.sso-buttons > div:only-child {
    display: none;
}

.heading-with-line {
    margin-bottom: 20px;
    background: white;
    display: flex;
    justify-content: center;
    padding: 0 10px;
    position: relative;
}

.heading-with-line--text {
    z-index: 1;
    background: white;
    padding: 0 25px;
}

.heading-with-line:before {
    content: '';
    border-top: 1px solid #DBDCDD;
    width: 100%;
    position: absolute;
    top: 11px;
    left: 0;
    z-index: 0;
}


/* Errors
------------------------------------------------------ */
.error-message {
    color: red;
    margin-bottom: 8px;
}

    .error-message:last-child {
        margin-bottom: 0;
    }

/* Overrides/Hacks for existing code
------------------------------------------------------ */
/* added by existing JS */
.js-hide {
    display: none;
}

/* asp.net forces errors to be display: inline. This is required to allow margin-bottom :( */
.emulate-block {
    float: left;
    clear: both;
}

/* Media Queries 
------------------------------------------------------ */
@media (max-width: 768px) {
    .controls {
        padding: 0;
    }

    .left-panel {
        width: 100%;
        margin: 0 auto;
        padding-top: 0;
        grid-template-areas: "announcement" "main" "help";
        grid-template-rows: max-content auto;
    }

    .right-panel {
        display: none;
    }

    .need-help {
        padding-right: 0;
        text-align: center;
        width: auto;
    }

    .link.need-help-link { 
        width: auto;
        display: block;
    }

    .button__with-icon {
        justify-content: flex-start;
    }
}

@media (max-width: 360px) {
    .login-form {
        width: calc(100vw - 40px);
    }
}

/* wider than mobile, but short enough for alert to push form down */
@media screen and (min-width: 769px) and (min-height: 850px)  {

    .left-panel { position: relative; }
    .announcement {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        max-height: 18vh;
        overflow-y: auto;
    }
}
    