#flash-success-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    width: calc(100% - 40px);
    max-width: 1000px;
    pointer-events: none;
}

/* Base: invisible & collapsed */
.flash-success-message {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin-bottom: 0;
    /* Some initial padding/border so we can animate from something */
    padding: 10px 20px;
    border: 1px solid #000; 
    border-radius: 5px;
    font-weight: bold;
    pointer-events: auto;
    transition:
        opacity 0.5s ease,
        max-height 0.5s ease,
        margin 0.4s ease,
        padding 0.4s ease,
        border-width 0.4s ease;
}

/* Animate in: fully visible & expanded */
.flash-success-message.entered {
    opacity: 1;
    max-height: 200px;  /* enough for typical success text */
    margin-bottom: 8px;
}

/* Animate out: fade & shrink EVERYTHING, incl. border/padding */
.flash-success-message.closing {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    border-bottom-width: 0;
    border-color: transparent !important; /* helps if border is colored */
}
