@import '@vtmn/css-design-tokens/src/base-colors';
@import '@vtmn/css-design-tokens/src/themes/default';
@import '@vtmn/css-design-tokens/src/typography';
@import '@vtmn/css-design-tokens/src/opacities';
@import '@vtmn/css-design-tokens/src/shadows';
@import '@vtmn/css-design-tokens/src/animations';
@import '@vtmn/css-design-tokens/src/z-indexes';
@import '@vtmn/css-design-tokens/src/radius';

.vtmn-modal_background-overlay {
  background: hsl(
    var(--vtmn-semantic-color_background-primary-reversed--h)
      var(--vtmn-semantic-color_background-primary-reversed--s)
      var(--vtmn-semantic-color_background-primary-reversed--l) / 80%
  );
  position: fixed;
  inset: 0;
  z-index: calc(var(--vtmn-z-index_modal) - 1);
}

.vtmn-modal_content {
  box-sizing: border-box;
  background-color: var(--vtmn-semantic-color_background-primary);
  border-radius: var(--vtmn-radius_200);
  padding: rem(32px);
  font-family: var(--vtmn-typo_font-family);
  inline-size: rem(600px);
  max-block-size: 90vh;
  block-size: fit-content;
  position: fixed;
  inset-block-end: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, 50%);
  box-shadow: var(--vtmn-shadow_300);
  color: var(--vtmn-semantic-color_content-primary);
  z-index: var(--vtmn-z-index_modal);
  display: flex;
  flex-direction: column;
}

.vtmn-modal_content_title {
  display: flex;
  inline-size: 100%;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.vtmn-modal_content_title--text {
  font-weight: var(--vtmn-typo_font-weight--bold);
  font-size: rem(26px);
  line-height: rem(32px);
  flex: auto;
  margin: 0;
}

.vtmn-modal_content_title .vtmn-btn {
  margin-inline-start: rem(12px);
  margin-block-start: rem(-6px);
  margin-block-end: rem(-6px);
}

.vtmn-modal_content_title .vtmn-btn span[class^='vtmx-'] {
  font-size: var(--vtmn-typo_text-2-font-size);
}

.vtmn-modal_content_title > button:focus-visible {
  outline: none;
  box-shadow: var(--vtmn-shadow_focus-visible);
}

.vtmn-modal_content_body {
  margin: rem(16px) 0;
  overflow-y: auto;
  flex: auto;
}

.vtmn-modal_content_body--text {
  padding-block-end: rem(30px);
  font-weight: var(--vtmn-typo_font-weight--normal);
  font-size: var(--vtmn-typo_text-3-font-size);
  line-height: rem(24px);
  align-self: flex-start;
  text-align: start;
  margin: 0;
}

.vtmn-modal_content_actions {
  white-space: nowrap;
  margin: 0;
  display: flex;
  justify-content: flex-end;
  inline-size: 100%;
}

.vtmn-modal_content_actions > * {
  margin-inline: rem(12px);
  margin-block: 0;
}

@media screen and (max-width: 599px) {
  .vtmn-modal_content {
    inline-size: 100%;
    padding-block: rem(24px);
    padding-inline-start: rem(24px);
    padding-inline-end: 0;
    max-block-size: 60%;
    inset-block-end: 0;
    inset-inline-start: 0;
    transform: translate(0, 0);
    border-radius: var(--vtmn-radius_200) var(--vtmn-radius_200) 0 0;
  }

  .vtmn-modal_content_actions {
    flex-direction: column;
    padding-inline-end: rem(24px);
  }

  .vtmn-modal_content_actions > * {
    margin-block: rem(6px);
    margin-inline: 0;
    inline-size: 100%;
  }

  .vtmn-modal_content_body--overflow-indicator {
    inset-block-end: 10rem;
    inset-inline-start: rem(24px);
    inset-inline-end: rem(24px);
    block-size: 4rem;
  }

  .vtmn-modal_content_body {
    padding-inline-end: rem(24px);
  }

  .vtmn-modal_content_title {
    padding-inline-end: rem(24px);
  }
}

@media screen and (min-width: 1200px) {
  .vtmn-modal_content {
    inline-size: rem(900px);
  }
}
