@keyframes modal-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.overlay {
  background: rgba(0, 0, 0, 0.5);
  height: var(--visual-viewport-height);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: 100;

  &[data-entering] {
    animation: modal-fade 200ms;
  }
  &[data-exiting] {
    animation: modal-fade 200ms reverse ease-in;
  }
}

@media screen and (min-width: 768px) {
  .overlay {
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

.modal {
  background-color: var(--Base-Surface-Primary-light-Normal);
  border-radius: var(--Corner-radius-Medium);
  box-shadow: 0px 4px 24px 0px rgba(38, 32, 30, 0.08);
  width: 100%;
  position: absolute;
  left: 0;
  bottom: 0;

  &[data-entering] {
    animation: slide-up 200ms;
  }
  &[data-exiting] {
    animation: slide-up 200ms reverse ease-in-out;
  }
}

.dialog {
  display: flex;
  flex-direction: column;
  gap: var(--Spacing-x2);
  padding-bottom: var(--Spacing-x2);
}

@media screen and (min-width: 768px) {
  .modal {
    left: auto;
    bottom: auto;
    width: 400px;
  }
}

.top {
  --button-height: 32px;
  box-sizing: content-box;
  display: flex;
  align-items: center;
  height: var(--button-height);
  position: relative;
  justify-content: center;
  padding: var(--Spacing-x2) var(--Spacing-x2) 0;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--Spacing-x3);
  gap: var(--Spacing-x2);
}

.nav {
  border-top: 1px solid var(--Base-Border-Subtle);
  display: flex;
  justify-content: space-between;
  padding: 0 var(--Spacing-x2);
  width: 100%;
}

.nav button {
  &:nth-child(1) {
    padding-left: 0;
  }

  &:nth-child(2) {
    padding-right: 0;
  }

  &[disabled] {
    visibility: hidden;
  }
}

.chevron {
  transform: rotate(180deg);
}

.badge {
  padding: var(--Spacing-x1) var(--Spacing-x-one-and-half);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--Spacing-x-half);
  background-color: var(--Base-Surface-Secondary-light-Normal);
  border-radius: var(--Corner-radius-Small);
}

.close {
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  right: var(--Spacing-x2);
  width: 32px;
  height: var(--button-height);
  display: flex;
  align-items: center;
}
