@use '../../../../shared/styles/variables' as *;

.add-organisation-modal__overlay {
  position: fixed;
  inset: 0;
  z-index: 110;

  background: $color-backdrop;
  backdrop-filter: blur(2px);
}

.add-organisation-modal {
  position: fixed;
  z-index: 120;
  top: 50%;
  left: 50%;

  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 24px;

  border-radius: 24px;
  background: $color-surface;
  box-shadow: $shadow-modal;

  transform: translate(-50%, -50%);
}

.add-organisation-modal--with-policy {
  width: min(980px, calc(100vw - 32px));
}
.add-organisation-modal--without-policy{
  width: min(460px, calc(100vw - 32px));
  .avatar-upload{
    width: inherit;
  }
}

.add-organisation-modal__header {
  margin-bottom: 22px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.add-organisation-modal__title {
  margin: 0;

  color: $color-text;
  font-size: $font-size-24;
  font-weight: 650;
}

.add-organisation-modal__description {
  margin: 6px 0 0;

  color: $gray50;
  font-size: $font-size-15;
  font-weight: 400;
  line-height: 1.4;
}

.add-organisation-modal__close {
  width: 40px;
  height: 40px;

  border: none;
  border-radius: 12px;
  background: $color-bg;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: $gray50;
  cursor: pointer;
  transition: 0.2s ease;

  &:hover {
    color: $blue;
    background: $gray20;
  }
}

.add-organisation-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.add-organisation-form--with-policy {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(460px, 1.18fr);
  align-items: stretch;
  gap: 16px;

  .add-organisation-error,
  .add-organisation-modal__footer {
    grid-column: 1 / -1;
  }
  .avatar-upload{
    flex: 1;
    width: inherit;
    .avatar-upload__actions{
      //display: none;
    }
    &__preview{
      width: 200px;
      height: 200px;
    }
    &__camera{
      right: 6px;
      bottom: 6px;
    }
  }
  .add-organisation-field{
    span{
      display: none;
    }
  }
}

.add-organisation-form__main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.add-organisation-field {
  display: flex;
  flex-direction: column;
  gap: 8px;

  span {
    color: $color-text;
    font-size: $font-size-14;
    font-weight: 500;
  }

  input {
    height: 44px;
    border: 1px solid $color-border-strong;
    border-radius: 14px;
    padding: 0 14px;

    background: $color-surface-muted;
    outline: none;

    color: $color-text;
    font-size: $font-size-15;
    font-weight: 400;

    transition: 0.2s ease;

    &:focus {
      border-color: $blue;
      background: $color-surface;
    }

    &::placeholder {
      color: $gray50;
    }
  }
}

.add-organisation-error {
  border-radius: 14px;
  background: $color-danger-tint;
  padding: 12px 14px;

  color: $red;
  font-size: $font-size-14;
  font-weight: 500;
}

.add-organisation-modal__footer {
  margin-top: 8px;

  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.add-organisation-cancel,
.add-organisation-submit {
  height: 42px;
  padding: 0 18px;

  border: none;
  border-radius: 14px;

  font-size: $font-size-15;
  font-weight: 600;
  cursor: pointer;

  transition: 0.2s ease;

  &:disabled {
    opacity: 0.6;
    cursor: default;
  }
}

.add-organisation-cancel {
  background: $color-bg;
  color: $gray50;

  &:hover {
    background: $gray20;
    color: $color-text;
  }
}

.add-organisation-submit {
  background: $blue;
  color: $color-text-inverse;

  &:hover {
    box-shadow: 0 8px 20px -8px rgba(var(--color-primary-rgb), 0.8);
  }
  &:disabled:hover {
    box-shadow: none;
  }
}

@media (max-width: 900px) {
  .add-organisation-modal--with-policy {
    width: min(560px, calc(100vw - 32px));
  }

  .add-organisation-form--with-policy {
    display: flex;
    flex-direction: column;
  }
}
