.mdl-dialog {
  z-index: 2;

  display: flex;
  visibility: hidden;
}

.mdl-dialog__title {
  position: relative;
  .close {
    position: absolute;
    top: 20px;
    right: 20px;

    cursor: pointer;
    transition: all 0.5s;
    &:hover {
      transform: rotate(360deg);
    }
  }
}

.mdl-dialog,
.mdl-dialog__backdrop {
  position: fixed;
  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  align-items: center;
  justify-content: center;
}

.mdl-dialog__backdrop {
  z-index: -1;

  opacity: 0;
  background-color: rgba(0, 0, 0, 0.87);
}

.mdl-dialog__surface {
  display: inline-flex;
  flex-direction: column;

  width: calc(100% - 30px);
  min-width: 640px;
  max-width: 865px;

  transform: translateY(0) scale(1);

  opacity: 1;
  border-radius: 2px;
  background-color: #fff;
  box-shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2),
    0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12);
}

.mdl-dialog__content {
  overflow-x: hidden;
  overflow-y: auto;
}

.default-enter-active,
.default-leave-active {
  visibility: visible;

  transition: all 0.12s;
  .mdl-dialog__backdrop {
    transition: opacity 0.12s cubic-bezier(0, 0, 0.2, 1);
  }
  .mdl-dialog__surface {
    transition: opacity 0.12s cubic-bezier(0, 0, 0.2, 1),
      transform 0.12s cubic-bezier(0, 0, 0.2, 1);
  }
}

.default-enter,
.default-leave-to {
  .mdl-dialog__surface {
    transform: translateY(150px) scale(0.8);

    opacity: 0;
  }
}

.mdl-dialog--open {
  visibility: visible;
  .mdl-dialog__backdrop {
    opacity: 0.3;
  }
}

.mdl-dialog-scroll-lock {
  overflow: hidden; // fix z-index
  height: 100vh;
  .mdl-layout__content {
    z-index: 5;
  }
}

.mdl-alert,
.mdl-confirm {
  z-index: 5;

  .mdl-dialog__surface {
    width: 500px;
    min-width: 500px;
  }
  .mdl-dialog__actions {
    flex-direction: row;

    justify-content: center;
    .mdl-button {
      margin: 0 5px;
    }
  }
}

@media (max-width: 640px) {
  .mdl-dialog,
  .mdl-dialog__surface {
    min-width: 280px;
  }

  .mdl-dialog__body {
    line-height: 24px;
  }

  .mdl-alert,
  .mdl-confirm {
    .mdl-dialog__surface {
      width: calc(100% - 30px);
      min-width: initial;
    }
  }
}
