//settings
@use "colors";

.dweb_ps {
  &__settings p {
    font-size: 1em;
    line-height: 1.5em;
    color: colors.$text-color;
    margin-top: 0;
    margin-bottom: 18px;
  }

  &__settings__intro {
    max-width: 760px;
  }

  &__value-note {
    max-width: 760px;
    margin-bottom: 6px;
    padding: 16px 18px;
    border: 1px solid rgba(58, 123, 213, 0.18);
    border-radius: 8px;
    background: #ffffff;
  }

  &__value-note-title {
    margin-bottom: 8px;
    font-weight: 700;
    color: colors.$heading-color;
  }

  &__value-note-text {
    margin-bottom: 12px;
    color: colors.$text-color;
  }

  &__about-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
    gap: 24px;
    align-items: start;
    max-width: 760px;
    margin-bottom: 30px;
  }

  &__about-hero h2 {
    max-width: 620px;
    margin-top: 0;
    margin-bottom: 12px;
  }

  &__about-hero-content p {
    max-width: 660px;
    margin-bottom: 14px;
  }

  &__about-benefits {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 0;
    list-style: none;
    color: colors.$text-color;
  }

  &__about-benefits li {
    position: relative;
    padding-left: 24px;
  }

  &__about-benefits li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.42em;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: colors.$secondary;
    box-shadow: inset 0 0 0 3px #ffffff;
    outline: 1px solid rgba(58, 123, 213, 0.28);
  }

  &__about-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  &__about-actions .dweb_ps__button {
    width: auto;
  }

  &__theme-support {
    max-width: 620px;
    margin-top: -6px;
  }

  &__settings {
    background-color: #f7f8fa;
    padding: 28px 24px 20px 24px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 10px;

    a {
      text-decoration: none;
      font-weight: 600;
    }

    &__holder {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 10px;
      margin-top: 18px;
      padding-top: 16px;
      border-top: 1px solid #d9dfe7;
    }

    &__holder--compact {
      border-top: 0;
      margin-top: 0;
      margin-bottom: 18px;
      padding-top: 0;
    }

    &-holder {
      padding: 0;
      display: flex;
      align-items: flex-start;
      flex-direction: column;
      align-content: flex-start;
      max-width: 480px;
      width: 100%;
    }

    &-holder__description {
      margin-top: 4px;
      font-size: 0.875rem;
      line-height: 1.4;
      color: colors.$muted-text;
      display: inline-block;
    }

    &__table {
      display: grid;
      grid-template-columns: 1fr;
      gap: 14px;
    }

    &__row {
      display: grid;
      grid-template-columns: minmax(230px, 320px) minmax(220px, 1fr);
      align-items: start;
      gap: 14px 24px;
      background: #ffffff;
      border: 1px solid #d9dfe7;
      border-radius: 8px;
      padding: 14px 16px;

      &--actions {
        align-items: center;
      }

      & > div:first-child > div {
        white-space: normal;
      }

      &:last-of-type > div {
        border-bottom: none;
      }
    }

    &__meta {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    &__label {
      font-weight: 700;
      color: colors.$heading-color;
    }

    &__input[type="text"],
    &__input[type="number"],
    &__input[type="password"],
    &__input--textarea {
      width: 100%;
      max-width: 420px;
      min-height: 38px;
      box-sizing: border-box;
      border: 1px solid colors.$border;
      border-radius: 0.45rem;
      padding: 0.55rem 0.75rem;
      color: colors.$text-color;
      background-color: #ffffff;

      &:focus {
        border-color: colors.$secondary;
        box-shadow: 0 0 0 2px rgba(58, 123, 213, 0.12);
        outline: none;
      }
    }

    &__input--textarea {
      min-height: 96px;
      resize: vertical;
      line-height: 1.45;
      overflow-wrap: anywhere;
      word-break: break-all;
    }

    &__input[type="checkbox"] {
      width: 22px;
      height: 22px;
      min-width: 22px;
      margin-top: 6px;
      align-self: flex-start;
      appearance: none;
      -webkit-appearance: none;
      border: 1px solid colors.$border;
      border-radius: 0.4rem;
      background-color: #ffffff;
      background-position: center;
      background-repeat: no-repeat;
      background-size: 11px 11px;
      cursor: pointer;
      transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;

      &:hover {
        border-color: colors.$secondary;
      }

      &:focus-visible {
        outline: none;
        border-color: colors.$secondary;
        box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.16);
      }

      &:checked {
        border-color: colors.$secondary;
        background-color: colors.$secondary;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.6' d='M4.5 10.5 8.1 14 15.5 6.5'/%3E%3C/svg%3E");
      }
    }

    &__actions {
      width: 100%;
      max-width: 420px;
      display: flex;
      flex-direction: row;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      min-height: 40px;
    }
  }

  &__settings-holder select,
  &__settings-holder .dweb_ps__settings__input:not([type="checkbox"]) {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    min-height: 38px;
    border: 1px solid colors.$border;
    border-radius: 0.45rem;
    padding: 0.55rem 0.75rem;
    color: colors.$text-color;
    background-color: #ffffff;
  }

  &__settings-holder select[name="dweb_ps_configurator_host_version"] {
    width: 160px;
    max-width: 160px;
  }

  &__auth-result {
    margin: 0;
    min-height: 18px;
    line-height: 1.4;
    display: flex;
    align-items: center;
  }

  #dweb_ps-test-auth {
    align-self: center;
  }

  @media (max-width: 900px) {
    &__settings__actions {
      flex-direction: column;
      align-items: flex-start;
    }

    #dweb_ps-test-auth {
      align-self: flex-start;
    }
  }

  &__error {
    margin: 0;
    color: colors.$error;
    font-size: 13px;
  }

  &__success {
    margin: 0;
    color: colors.$success;
    font-size: 13px;
  }

  @media (max-width: 782px) {
    &__settings {
      padding: 18px 14px 14px 14px;
    }

    &__settings__row {
      grid-template-columns: 1fr;
      gap: 10px;
      padding: 12px;
    }

    &__settings__holder {
      align-items: stretch;
    }

    &__button--normal {
      min-width: 100%;
    }
  }

  @media (max-width: 782px) {
    &__about-hero {
      grid-template-columns: 1fr;
      gap: 16px;
      margin-bottom: 24px;
    }

    &__about-actions {
      align-items: stretch;
    }
  }
}
