.common-modal-overlay {
  position: fixed;
  top: 0; 
  left: 0; 
  right: 0; 
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.common-modal-overlay.open {
  display: flex;
  opacity: 1;
}

.common-modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  
  width: 90%;
  max-width: 440px;
  
  /* Set a min-height so the footer is visually at bottom, 
     and optionally limit max-height so it fits on smaller screens */
  min-height: 440px;
  max-height: 80vh;
  
  /* Use flex layout in a column direction */
  display: flex;
  flex-direction: column;
  
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 9999;
  
  /* For the open/close transition */
  display: none;       /* hidden by default */
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
}

.common-modal-container.open {
  display: flex;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.common-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 2rem;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
}
.common-modal-close:hover {
  color: #000;
}

/* Header at the top; it will not shrink or expand. */
.common-modal-header {
  padding: 14px;
}

/* Body takes remaining space, can scroll internally if it’s too big. */
.common-modal-body {
  flex: 1;              /* or flex: 1 1 auto; */
  padding: 24px 14px 12px;
  overflow-y: auto;
  text-align: center;
}

/* Footer remains pinned at the bottom of the flex container. */
.common-modal-footer {
  padding: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
  /* By default, the footer won't expand or shrink if it has no explicit width. */
}

/* Common button styles, etc. */
.common-modal-button {
  width: 100%;
  font-size: 0.95rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 14px 20px;
  transition: background-color 0.2s;
}

.med-primary-button {
  background-color: #273534;
  color: #fff;
}
.med-primary-button:hover {
  background-color: #333;
}

.btn-secondary {
  background-color: #c5ede8;
  color: #333;
}
.btn-secondary:hover {
  background-color: #b0e2db;
}
