.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__frame {
  position: relative;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

@media (min-width: 640px) {
  .modal__frame {
    padding: 2.5rem 1.5rem;
  }
}

.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 14, 12, 0.3);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  z-index: 10;
  width: 100%;
  max-height: min(85dvh, 900px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #f2ece0;
  border-radius: 16px;
  box-shadow: 0 16px 64px rgba(74, 59, 44, 0.18);
}

.modal__panel--md {
  max-width: 28rem;
}

.modal__panel--lg {
  max-width: 32rem;
}

.modal__header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #f9f6f0;
  flex-shrink: 0;
}

.modal__body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal__body > * + * {
  margin-top: 1rem;
}

.modal__footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .modal__footer {
    flex-direction: row;
    justify-content: flex-end;
  }

  .modal__footer .btn {
    width: auto;
  }
}

.modal__footer .btn {
  width: 100%;
}

.modal__checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal__hint {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #8f8070;
}

.modal__field-error {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #a85e4e;
}
