﻿.page-wrapper {
  .modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    padding: 24px 10px;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overflow-y: auto;
    background-color: rgba(58, 58, 58, 0.4);

    &.open {
      display: flex;
    }

    &.modal-index-100000 {
      z-index: 100000;
    }

    &[style*='display: block'] {
      display: flex !important;
      justify-content: center;

      >* {
        margin: auto;
      }
    }

    &.sm {
      .modal-content {
        max-width: 440px;
        /* Ширина модального окна */
      }
    }

    &.xl {
      .modal-content {
        max-width: 900px;
        /* Ширина модального окна */
      }
    }

    &.fpg {
      background-color: rgba(43, 43, 43, 0.75);

      .modal-content {
        max-width: 1564px;
        /* Ширина модального окна */
        border-radius: 0px;
        border: 1px solid var(--Stroke);
      }

      .modal-header {
        .modal-title {
          text-transform: none;
          font-size: 34px;
          line-height: 46px;
          color: var(--Subsidiary);
          font-weight: 100;
          font-family: 'PT Sans Caption', sans-serif;
          margin-bottom: 30px !important;

          @media (max-width: 991px) {
            padding-top: 35px;
          }

          @media (max-width: 767px) {
            padding-top: 80px;
          }
        }

        .close-click {
          top: 20px;
          width: auto;
          height: auto;

          svg {
            width: 50px;
            height: 50px;
          }
        }
      }

      .modal-body {
        padding: 66px;
        padding-top: 0;
        padding-bottom: 10px;

        .fpg__item {
          background: #FFFFFF;
          border: 1px solid var(--Stroke);
          height: 142px;
          margin-bottom: 24px;
          padding: 0 30px;
          display: flex;
          align-items: center;
          justify-content: center;
          transition: 0.2s;

          &:hover {
            box-shadow: 0px 14px 40px rgba(169, 150, 125, 0.31);
          }

          svg {
            max-width: 100%;
          }
        }
      }
    }

    &.full {
      padding: 0;

      .modal-content {
        max-width: 100%;
        width: 100%;
        min-height: 100%;
        border-radius: 0;
        overflow-y: auto;
        overflow-x: hidden;
      }
    }

    &-content {
      max-width: 670px;
      /* Ширина модального окна */
      width: 100%;
      position: relative;
      background-color: #fff;
      margin: auto !important;
      box-shadow: 0px 4px 10px rgba(58, 58, 58, 0.15);
      border-radius: 4px;

      &.accent-head {
        &.head-error {
          .modal-body-banner {
            background: var(--Warning);
    
            &__icon {
              svg {
                path {
                  stroke: var(--Red);
                }
              }
            }
    
            &__text {
              color: var(--Red);
            }
          }
        }
    
        &.head-warning {
          .modal-body-banner {
            background: var(--Attention);
  
            &__icon {
              svg {
                path {
                  stroke: var(--Orange);
                }
              }
            }
      
            &__text {
              color: var(--Orange);
            }
          }
        }
    
        &.head-success {
          .modal-body-banner {
            background: var(--Good);
  
            &__icon {
              svg {
                path {
                  stroke: var(--Green);
                }
              }
            }
      
            &__text {
              color: var(--Green);
            }
          }
        }
      }

      div[old-class].loader {
        height: 20em;
      }
    }

    &-header {
      min-height: 60px;
      text-align: center;

      p {
        padding: 0 !important;
        margin: 0;
      }

      .modal-title {
        padding: 20px 24px;
        padding-top: 35px;
        display: flex;
        align-content: center;
        align-items: center;
        justify-content: space-around;
        font-weight: bold;
        font-size: 18px;
        line-height: 24px;
        text-align: center;
        text-transform: uppercase;
        color: var(--Main1);

        @media (max-width: 991px) {
          padding: 12px 16px;
        }

        &-small {
          margin-top: -15px;
          margin-bottom: 24px;
          color: var(--Secondary);
          font-size: 14px;
          padding: 0px 24px;

          @media (max-width: 991px) {
            padding: 0px 16px;
          }
        }
      }

      &-title {
        width: 100%;
        float: left;
      }

      .close-click {
        opacity: 1;
        cursor: pointer;
        position: absolute;
        top: 14px;
        right: 14px;
        transition: all 0.2s ease-in-out;

        svg {
          width: 14px;
          height: 14px;
        }

        &:hover {
          transform: scale(1.1);
        }
      }
    }

    &-body {
      width: auto;
      padding:0 24px 16px;

      @media screen and (max-width: 991px) {
        padding: 16px;
        padding-top: 0;
      }

      &-banner {
        display: flex;
        align-items: flex-start;
        border-radius: 4px;
        padding: 12px 16px;
        margin-bottom: 16px;
        background: var(--TooltipBG);
  
        &__icon {
          display: flex;
          align-items: center;
          justify-content: center;
          margin-right: 8px;
        }
  
        &__text {
          font-weight: bold;
          font-size: 12px;
          line-height: 16px;
          text-align: left;
        }
      }

      &-browser {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;

        &__item {
          display: flex;
          align-items: center;
          justify-content: space-between;
          padding: 8px 0;
          border-bottom: 1px solid #EFF3F5;
        }

        &__info {
          display: flex;
          align-items: center;
        }

        &__icon {
          display: flex;
          align-items: center;
          justify-content: center;
          margin-right: 12px;
        }

        &__name {
          font-family: 'PT Sans', sans-serif;
          font-size: 14px;
          line-height: 143%;
          color: var(--Main1);
        }

        &__link {
          font-family: 'PT Sans', sans-serif;
          font-size: 14px;
          line-height: 143%;
          color: var(--Main2);
          text-decoration: none;
        }
      }

      .modal-title-small {
        margin-top: -15px;
        margin-bottom: 24px;
        color: var(--Stroke);
        font-size: 14px;
      }

      p {
        font-size: 14px;
        line-height: 1.43;
      }

      div {
        &.info-row {
          label {
            &.name-label {
              .label-text;
              display: inline-block;
              min-width: 20%;
              color: var(--Secondary);
            }
          }

          label {
            &.value-label {
              .label-text;
              width: 70%;
              color: var(--Main1);
              word-break: normal;
              word-wrap: normal;
            }
          }
        }
      }

      .required-field__container {
        display: flex;

        .star {
          position: relative;
          font-size: 25px;
          top: 5px;
          color: var(--Red);
        }

        p {
          margin-right: 5px;
        }
      }

      .empty {
        padding: 0;
        margin: 0;
      }

      .expert {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 16px;

        &-avatar {
          width: 36px;
          height: 36px;
          border-radius: 50%;
          overflow: hidden;
          margin-right: 12px;
          display: flex;
          align-items: center;
          justify-content: center;
          position: relative;

          &:after {
            content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' width='24px' viewBox='0 0 24 24'%3E%3Cdefs/%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M20 21v-2c0-2.2091-1.7909-4-4-4H8c-2.20914 0-4 1.7909-4 4v2'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M12 11c2.2091 0 4-1.79086 4-4s-1.7909-4-4-4C9.79086 3 8 4.79086 8 7s1.79086 4 4 4z' clip-rule='evenodd'/%3E%3C/svg%3E");
            position: absolute;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(0deg, rgba(1, 1, 1, 0.5), rgba(1, 1, 1, 0.5));
            transition: 0.2s;
            z-index: 1;
          }

          img {
            max-width: 100%;
            position: relative;
            z-index: 2;
          }
        }

        &-info {
          &__role {
            font-size: 12px;
            line-height: 16px;
            color: var(--Secondary);
          }

          &__name {
            font-size: 14px;
            line-height: 18px;
            color: #3a3a3a;
          }
        }
      }
    }

    &-footer {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      padding:0 24px 16px;

      @media screen and (max-width: 991px) {
        padding:0 16px 16px;
      }

      .btn {
        margin: 8px;
        margin-top: 0;
        min-width: 120px;
        max-width: calc(~'50% - 20px');

        @media screen and (max-width: 400px) {
          width: 100%;
          max-width: calc(~'100% - 20px') !important;
        }
      }
    }

    form {
      .modal-footer {
        padding: 0;
        padding-top: 20px;
      }
    }

    .btn-close {
      opacity: 1;
    }

    .input-bg {
      width: 440px;
    }

    .input-sm,
    .date-input {
      width: 212px;
    }

    .input-right {
      float: right;
    }

    .input-left {
      float: left;
    }

    .small {
      font-size: 12px;
      color: var(--Stroke);
    }

    .gray {
      color: var(--Stroke);
    }

    .field-text {
      background-color: #fff;
      font-size: 14px;
      font-weight: 400;
      text-align: left;
      color: var(--Main1);
      margin-bottom: 15px;

      .value {
        font-weight: 600;
        font-size: 14px;
        line-height: 100%;
      }
    }

    &.accent-head {
      .modal-header {
        border-radius: 4px 4px 0px 0px;
        overflow: hidden;
        min-height: 52px;
        margin-bottom: 24px;
        position: relative;

        .modal-title {
          background: var(--Main2);
          padding: 16px;
          padding-right: 30px;
          min-height: 52px;
          color: #fff;

          h4 {
            color: #fff !important;
            line-height: 24px;
          }

          &-small {
            margin-top: 24px;
            margin-bottom: 0;
          }
        }

        .close-click {
          width: 24px;
          height: 24px;
          display: flex;
          align-items: center;
          justify-content: center;
          top: 14px;
          right: 8px !important;

          svg {
            path {
              stroke: #fff;
            }
          }
        }
      }

      &.head-default {
        .modal-header {
          .modal-title {
            h4 {
              color: inherit !important;
            }
          }

          .close-click {
            svg {
              path {
                stroke: var(--Main1);
              }
            }
          }
        }
      }

      &.head-error {
        .modal-header {
          .modal-title {
            background: var(--Red) !important;
          }
        }

        .modal-footer {
          .btn {
            background-color: var(--Red);
            border-color: var(--Red);
            color: #fff;

            &.n-border {
              border-color: transparent !important;
              box-shadow: none;
            }

            &.btn-outline {
              border-color: var(--Red);
              color: var(--Red);
              background-color: transparent;

              &:hover {
                background-color: var(--Warning);
                color: var(--DarkRed);
                border-color: var(--DarkRed);
              }

              &.active,
              &:active {
                background-color: var(--Warning);
                color: var(--DarkRed);
                border-color: var(--DarkRed);
              }

              &.n-border {
                border-color: transparent !important;
                box-shadow: none;
              }
            }
          }
        }
      }

      &.head-warning {
        .modal-header {
          .modal-title {
            background: var(--Orange) !important;
          }
        }

        .modal-footer {
          .btn {
            background-color: var(--Orange);
            border-color: var(--Orange);
            color: #fff;

            &.n-border {
              border-color: transparent !important;
              box-shadow: none;
            }

            &.btn-outline {
              border-color: var(--Orange);
              color: var(--Orange);
              background-color: transparent;

              &:hover {
                background-color: var(--Attention);
              }

              &.active,
              &:active {
                background-color: var(--Attention);
              }

              &.n-border {
                border-color: transparent !important;
                box-shadow: none;
              }
            }
          }
        }
      }

      &.head-success {
        .modal-header {
          .modal-title {
            background: var(--Green) !important;
          }
        }
      }
      &.head-attention {
        .modal-header {
          .modal-title {
            background: var(--system-bg-controls-attention-default) !important;
          }
        }
      }
      &.head-positive {
        .modal-header {
          .modal-title {
            background: var(--system-bg-controls-positive-default) !important;
          }
        }
      }
      &.head-negative {
        .modal-header {
          .modal-title {
            background: var(--system-bg-controls-negative-default) !important;
          }
        }
      }
    }

    //Дубль стилей для Angular
    &-content {
      width: calc(100vw - 20px);

      &.sm {
        max-width: 440px;
        /* Ширина модального окна */
      }

      &.xl {
        max-width: 900px;
        /* Ширина модального окна */
      }

      &.full {
        max-width: 100%;
        width: 100%;
        min-height: 100%;
        border-radius: 0;
        overflow-y: auto;
        overflow-x: hidden;
      }

      &.accent-head {
        .modal-header {
          border-radius: 4px 4px 0px 0px;
          overflow: hidden;
          min-height: 52px;
          margin-bottom: 24px;
          position: relative;

          .modal-title {
            background: var(--Main2);
            padding: 16px;
            padding-right: 30px;
            min-height: 52px;
            color: #fff;

            h4 {
              color: #fff !important;
              line-height: 24px;
            }

            &-small {
              margin-top: 24px;
              margin-bottom: 0;
            }
          }

          .close-click {
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            top: 14px;
            right: 8px !important;

            svg {
              path {
                stroke: #fff;
              }
            }
          }
        }

        &.head-default {
          .modal-header {
            .modal-title {
              color: inherit !important;
              background: var(--neutral-bg-page) !important;

              h4 {
                color: inherit !important;
              }
            }

            .close-click {
              svg {
                path {
                  stroke: var(--Main1);
                }
              }
            }
          }
        }

        &.head-error {
          .modal-header {
            .modal-title {
              background: var(--Red) !important;
            }
          }

          .modal-footer {
            .btn {
              background-color: var(--Red);
              border-color: var(--Red);
              color: #fff;

              &.n-border {
                border-color: transparent !important;
                box-shadow: none;
              }

              &.btn-outline {
                border-color: var(--Red);
                color: var(--Red);
                background-color: transparent;

                &:hover {
                  background-color: var(--Warning);
                  color: var(--DarkRed);
                  border-color: var(--DarkRed);
                }

                &.active,
                &:active {
                  background-color: var(--Warning);
                  color: var(--DarkRed);
                  border-color: var(--DarkRed);
                }

                &.n-border {
                  border-color: transparent !important;
                  box-shadow: none;
                }
              }
            }
          }
        }

        &.head-warning {
          .modal-header {
            .modal-title {
              background: var(--Orange) !important;
            }
          }

          .modal-footer {
            .btn {
              background-color: var(--Orange);
              border-color: var(--Orange);
              color: #fff;

              &.n-border {
                border-color: transparent !important;
                box-shadow: none;
              }

              &.btn-outline {
                border-color: var(--Orange);
                color: var(--Orange);
                background-color: transparent;

                &:hover {
                  background-color: var(--Attention);
                }

                &.active,
                &:active {
                  background-color: var(--Attention) !important;
                }

                &.n-border {
                  border-color: transparent !important;
                  box-shadow: none;
                }
              }
            }
          }
        }

        &.head-success {
          .modal-header {
            .modal-title {
              background: var(--Green) !important;
            }
          }
        }
        
        &.head-attention {
          .modal-header {
            .modal-title {
              background: var(--system-bg-controls-attention-default) !important;
            }
          }
        }
        &.head-positive {
          .modal-header {
            .modal-title {
              background: var(--system-bg-controls-positive-default) !important;
            }
          }
        }
        &.head-negative {
          .modal-header {
            .modal-title {
              background: var(--system-bg-controls-negative-default) !important;
            }
          }
        }

        &.certificate {
          .modal-header {
            margin-bottom: 0;

            .modal-title {
              font-family: 'PT Sans Caption', sans-serif;
              justify-content: center;
              color: var(--Main1);
              background: var(--Disabled);
            }

            .close-click {
              svg {
                path {
                  stroke: var(--Main1);
                }
              }
            }
          }

          .modal-body {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            padding: 0;

            &-info {
              display: flex;
              flex-direction: column;
              align-items: flex-start;
              padding-bottom: 16px;
              padding-top: 16px;
              border-bottom: 1px solid var(--Stroke);

              &__item {
                display: flex;
                align-items: center;
                font-size: 14px;
                line-height: 140%;

                .text {
                  text-align: left;
                  color: var(--Main1);
                  margin-bottom: 8px;

                  &:first-child {
                    min-width: 100px;
                    margin-right: 8px;
                  }

                  &.hash {
                    color: var(--Stroke);
                  }
                }
              }
            }

            &-other {
              max-height: 520px;
              overflow: auto;
              width: 100%;
              padding: 24px;
              padding-top: 0;
            }
          }
        }
      }
    }
  }

  .loader,
  .loader:after {
    border-radius: 50%;
    width: 10em;
    height: 10em;
  }

  .loader {
    margin: 4em auto;
    font-size: 10px;
    position: relative;
    text-indent: -9999em;
    border-top: 1.1em solid var(--Stroke);
    border-right: 1.1em solid var(--Stroke);
    border-bottom: 1.1em solid var(--Stroke);
    border-left: 1.1em solid var(--Main1);
    transform: translateZ(0);
    animation: load8 1.1s infinite linear;
    overflow: hidden;
  }

  @-webkit-keyframes load8 {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
  }

  @keyframes load8 {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
  }

  .label-text {
    font-size: 16px;
    line-height: 1.25;
  }
}

.modal-open {
  overflow: hidden;
}