.modal {
  opacity: 0;
  visibility: hidden;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  text-align: left;
  background: rgba(black, 0.6);
  z-index: 12;
  flex: 1 1 auto;
  word-wrap: break-word;
  @include transition(opacity);

  // modal background
  &-bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    cursor: pointer;
  }

  .modal-body {
    position: absolute;
    top: 0;
    left: 50%;
    background: $white;
    border: 2px solid $muted-light;
    padding: 1.25rem;
    backface-visibility: hidden;
    @include translate(-50%, -50%);
    @include transition;

    @include resp(sm) {
      width: 90%;
      box-sizing: border-box;
    }
  }

  .btn-close {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    color: $primary-light;
    font-size: 30px;
    text-decoration: none;
    position: absolute;
    right: 1rem;
    top: 1rem;
    @include transition;

    &:hover,
    &:active,
    &:focus {
      color: $primary;
    }
  }

  h4,
  .modal-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
  }

  h5,
  .modal-subtitle {
    @extend .text-secondary;
    margin-top: 0;
    margin-bottom: 0.5rem;
  }

  p,
  .modal-text {
    margin-top: 0;
    margin-bottom: 1rem;
  }

  .modal-link+.modal-link,
  a+a {
    margin-left: 1.25rem;
  }

  .paper-btn {
    text-decoration: none;
    background: $white;
    display: inline-block;
  }

  .modal-link, a {
    text-decoration: none;
    background-image: linear-gradient(5deg, transparent 65%, $secondary 80%, transparent 90%), linear-gradient(165deg, transparent 5%, $secondary 15%, transparent 25%), linear-gradient(165deg, transparent 45%, $secondary 55%, transparent 65%), linear-gradient(15deg, transparent 25%, $secondary 35%, transparent 50%);
    background-repeat: repeat-x;
    background-size: 4px 3px;
    background-position: 0 90%;
    cursor: pointer;

    &:hover,
    &:focus,
    &:visited {
      text-decoration: none;
      color: $primary;
    }
  }
}

.modal-state {
  display: none;

  &:checked+.modal {
    opacity: 1;
    visibility: visible;

    .modal-body {
      top: 50%;
    }
  }
}
