// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

// TODO: rename to auth.scss

.auth {
  display: grid;
  grid-template-rows: auto;
  grid-template-columns: 33% auto;
  height: 100vh;
  overflow-y: scroll;
}

.auth-sidebar {
  grid-column: 1 / span 1;
  height: 100vh;
  display: flex;
  padding-top: 7vh;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: #151035;
  background-image: url("/images/login-penpot.svg");
  background-position: center 30vh;
  background-size: 96%;
  background-repeat: no-repeat;

  .tagline {
    text-align: center;
    width: 280px;
    font-size: $fs18;
    margin-top: 2vh;
    color: white;
  }

  .logo {
    svg {
      fill: white;
      max-width: 11vw;
      height: 80px;
    }
    .hidden-name {
      visibility: hidden;
      width: 0;
      height: 0;
      float: left;
    }
  }
}

.auth-content {
  grid-column: 2 / span 1;
  background-color: $color-white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;

  .form-container {
    width: 412px;
    flex-direction: column;
    margin-bottom: 30px;
    .auth-buttons {
      margin: $size-6 0 $size-4 0;
      display: flex;
      justify-content: center;
      column-gap: 17px;
    }

    form {
      margin: 2rem 0 0.5rem 0;
      .accept-terms-and-privacy-wrapper {
        position: relative;
        .input-checkbox {
          margin-bottom: 0;
        }
        .input-checkbox input[type="checkbox"] {
          position: absolute;
          display: block;
          width: 20px;
          height: 20px;
          opacity: 0;
          top: 22px;
        }
        label {
          margin-left: 40px;
        }
        label:before {
          position: absolute;
          top: 15px;
          left: -36px;
        }
        label:after {
          position: absolute;
          top: 15px;
          left: -33px;
        }
        .input-checkbox input[type="checkbox"]:focus {
          opacity: 100%;
        }
        .auth-links {
          margin-left: 40px;
          font-size: 0.75rem;
        }
      }
    }
  }

  input {
    margin-bottom: 0px;
  }

  .buttons-stack {
    display: flex;
    flex-direction: column;
    width: 100%;

    *:not(:last-child) {
      margin-bottom: $size-4;
    }
  }

  .btn-large {
    flex-grow: 1;
    font-size: $fs14;
    font-style: normal;
    font-weight: $fw400;
  }

  .btn-google-auth {
    background-color: #4285f4;
    color: $color-white;
    margin-bottom: $size-4;
    text-decoration: none;
    .logo {
      width: 20px;
      height: 20px;
      margin-right: 1rem;
    }
    &:hover,
    &:focus {
      background-color: #2065d7;
      color: $color-white;
    }
  }

  .btn-gitlab-auth {
    background-color: #fc6d26;
    color: $color-white;
    margin-bottom: $size-4;
    text-decoration: none;

    .logo {
      width: 20px;
      height: 20px;
      margin-right: 1rem;
    }

    &:hover,
    &:focus {
      background-color: #ee5f18;
      color: $color-white;
    }
  }

  .btn-github-auth {
    background-color: #4c4c4c;
    color: $color-white;
    margin-bottom: $size-4;
    text-decoration: none;

    .logo {
      width: 20px;
      height: 20px;
      margin-right: 1rem;
    }

    &:hover,
    &:focus {
      background-color: #2f2f2f;
      color: $color-white;
    }
  }

  .link-oidc {
    text-align: center;
  }

  .separator {
    display: flex;
    justify-content: center;
    width: 100%;
    text-transform: uppercase;
    text-align: center;

    .text {
      margin: 0 10px;
      color: $color-gray-40;
    }

    .line {
      border: 1px solid $color-gray-10;
      flex-grow: 10;
      margin: auto;
    }
  }

  .links {
    display: flex;
    font-size: $fs14;
    flex-direction: column;
    justify-content: space-between;
    margin-top: $size-4;
    margin-bottom: $size-4;

    &.demo {
      justify-content: center;
      margin-top: $size-5;
    }

    .link-entry {
      font-size: $fs14;
      color: $color-gray-40;
      margin-bottom: 10px;
      a {
        font-size: $fs14;
        font-weight: $fw500;
        color: $color-gray-50;
        &:hover,
        &:focus {
          text-decoration: underline;
        }
      }
    }
  }

  .terms-login {
    bottom: $size-5;
    font-size: $fs14;
    position: absolute;

    span {
      margin: 0 $size-2;
      color: $color-gray-40;
    }
  }
}
