:root {
  --primary-color: #5a54ad;
  --primary-text-color: #ffffff;
  --danger-color: #de3e44;
  --success-color: #107a37;

  --default-font-family: "Roboto", sans-serif;
  --default-text-color: #424242;
  --default-text-font-size: 14px;
  --default-border-radius: 8px;

  --default-control-border-color: #cdcdcd;
  --default-control-outline-focused: #5a54ad solid 1px;
  --default-control-outline-error: #de3e44 solid 1px;
}

/***************************************************
 * Reset
 ***************************************************/
html,
body {
  font-family: var(--default-font-family);
  font-size: var(--default-text-font-size);
  color: var(--default-text-color);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  outline: none;
}

a {
  color: #090084;
}

/***************************************************
 * Base layout
 ***************************************************/
.container {
  display: flex;
  width: 100vw;
  height: 100vh;

  .left {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;

    .logo {
      text-align: center;
      margin-bottom: 1rem;

      img {
        height: 60px;
      }
    }

    .content {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      max-width: 400px;
      margin: 0 auto;
      width: 100%;
      gap: 16px;

      >a {
        text-align: center;
      }
    }

    .footer {
      text-align: center;

      a {
        cursor: pointer;
        color: inherit;
        font-weight: 400;
        opacity: 0.8;
      }
    }
  }

  .right {
    flex: 1;
    position: relative;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      border-radius: 25px;
      padding: 10px;
    }
  }
}

@media screen and (max-width: 768px) {
  .container {
    .right {
      display: none;
    }
  }
}

.container--terms {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;

  .logo {
    text-align: center;
    margin-bottom: 1rem;

    img {
      height: 60px;
    }
  }

  .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
    gap: 16px;

    >a {
      text-align: center;
    }

    &.content--wide {
      max-width: 900px;

      button {
        max-width: 400px;
        align-self: center;
      }

      .terms-and-conditions-text {
        width: 100%;
      }
    }
  }

  .terms-and-conditions-scroll {
    overflow-y: auto;
    width: 100%;
    padding: 1.2rem;
    border: 1px solid var(--default-control-border-color);
    border-radius: 20px;
    box-shadow: 0 0 10px 2px var(--default-control-border-color);
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    max-height: min(50vh, 400px);

    &:hover {
      scrollbar-color: var(--default-control-border-color) transparent;
    }
  }
}

/***************************************************
 * Core
 ***************************************************/
.title {
  display: flex;
  justify-content: center;
  font-size: 2rem;
  font-weight: 300;
  line-height: 40px;
}

.subtitle {
  display: flex;
  justify-content: center;
  opacity: 0.8;
  margin-bottom: 16px;
  text-align: center;
  text-wrap: balance;

  &.error {
    color: var(--danger-color);
  }

  &.success {
    color: var(--success-color);
  }
}

.error-message {
  background-color: hsl(from var(--danger-color) h s l / 0.1);
  border-radius: var(--default-border-radius);
  border: 1px solid var(--danger-color);
  color: var(--default-color);
  padding: 1rem;
  text-align: center;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  opacity: 0.8;

  &::before,
  &::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--default-control-border-color);
  }

  span {
    padding-inline: 1rem;
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;

  .form-field {

    &:has(.validation-message) input {
      border-color: var(--danger-color);
    }

    label {
      display: block;
      margin-bottom: 8px;
    }

    input {
      width: 100%;
      padding: 10px;
      border: 1px solid var(--default-control-border-color);
      border-radius: var(--default-border-radius);
      color: inherit;
      font-size: inherit;
      font-family: inherit;
      resize: none;

      &:hover,
      &:active,
      &:focus {
        outline: var(--default-control-outline-focused) !important;
        outline-offset: -1px;
      }
    }
  }

  .forgot-password-link {
    text-align: left;
    margin-top: -10px;
    font-size: 12px;
  }

  .terms-back-link {
    align-self: center;
    width: fit-content;
  }

  .validation-message {
    color: var(--danger-color);
    font-size: 0.75rem;
    margin-top: 4px;
  }

  >a {
    text-align: center;
  }

  .email-password-admin-only {
    display: none;
  }

  button {
    width: 100%;
    padding: .75rem;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    cursor: pointer;
    font-size: inherit;
    color: var(--primary-color);
    background-color: white;
    font-family: inherit;

    img {
      width: 20px;
      height: 20px;
    }

    &.primary {
      background: var(--primary-color);
      color: var(--primary-text-color);

      &:hover {
        background-color: #4e47a8;
      }
    }

    &[disabled] {
      opacity: .7;
      cursor: default;
    }
  }
}

body.admin-show-email-password .email-password-admin-only {
  display: flex !important;
  flex-direction: column;
  gap: 16px;
}

body.admin-show-email-password .divider.email-password-admin-only {
  flex-direction: row;
  align-items: center;
}
