/* Скрытый класс */
.hidden { display: none; }

/* Оверлей */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity .18s ease;
}

/* Окно */
#popup {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%) scale(.95);
    min-width: 320px;
    max-width: 90%;
    max-height: 85vh;
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
    padding: 18px 18px 16px;
    z-index: 1001;
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
    outline: none;
}

/* Вид состояния открытого */
#overlay.show { opacity: 1; }
#popup.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }

/* Кнопка закрытия */
#popup .close {
    position: absolute;
    right: 8px;
    top: 6px;
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

/* Немного адаптива */
@media (max-width:480px){
    #popup { padding: 14px; min-width: 280px; border-radius: 6px; }
}

.openPopup {
    background-color: transparent;
    border: 0px;
}

.openPopup div.withicon {
    font-size: 1.3rem;
}