/* ==========================================================================
   Modal Overlay & Background
   ========================================================================== */
.sop-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* ==========================================================================
   Modal Content Wrapper
   ========================================================================== */
.sop-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    
    /* Using flex so we can neatly stack the form and the close button */
    display: flex;
    flex-direction: column;
    
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

/* ==========================================================================
   Active / Visible State
   ========================================================================== */
.sop-modal-overlay.sop-modal-show {
    opacity: 1;
    visibility: visible;
}

.sop-modal-overlay.sop-modal-show .sop-modal-content {
    transform: translateY(0);
}

/* ==========================================================================
   Close Button (Centered at Bottom)
   ========================================================================== */
.sop-modal-close {
    display: block;
    margin: 15px auto 0 auto; /* Pushes it down 15px below the form and centers it */
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.6); /* Translucent white to look great on the dark overlay */
    cursor: pointer;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.sop-modal-close:hover {
    color: #ffffff; /* Brightens up when hovered */
    opacity: 1;
}

/* Ensure the inner form card doesn't have a double-shadow or weird margins in modal mode */
.sop-modal-content .sop-optin-card {
    margin: 0;
    width: 100%;
}