.flash-message {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%) scaleX(0); 
  transform-origin: center center;      
  
  z-index: 1000;
  width: 90%;
  max-width: 500px;
  border-radius: 24px;
  padding: 16px;
  font-weight: bold;
  font-size: 1.2rem;
    
  animation:
    expand 0.5s ease-out forwards,
    collapse 0.5s ease-in forwards 5s;
}

@keyframes expand {
  from {
    transform: translateX(-50%) scaleX(0);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
  }
}

@keyframes collapse {
  from {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
  }
  to {
    transform: translateX(-50%) scaleX(0);
    opacity: 0;
  }
}

  
  .flash-message.success {
    background-color: #d4edda;
    color: #155724;
  }
  
  .flash-message.error {
    background-color: #f8d7da;
    color: #721c24;
  }
  
  .flash-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .flash-content span {
    flex: 1;
  }
  
  .close-flash {
    background: none;
    border: none;
    font-size: 20px;
    font-weight: bold;
    margin-left: 10px;
    cursor: pointer;
    color: inherit;
  }