:root{
    --global--color-red:#cd2027;
    --global--color-blue:#212060;
    
}

/* Ensure the modal is hidden by default */
.modal-outer.hidden {
    display: none;
}

/* The state when the modal is fully visible and animated */
.modal-outer.is-open {
    display: block;
    opacity: 1;
}

/* Add a transition property for the modal-background specifically */
.modal-background {
    transition: opacity 300ms ease-out, transform 300ms ease-out;
}

/* The "closed" state for the background */
.modal-outer:not(.is-open) .modal-background {
    opacity: 0;
    transform: translateY(1rem) scale(0.95);
}

.modal-outer{
    position:fixed;
    z-index:3000; 
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px; 
    overflow-y: auto;
}

.modal-container{
    display:flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 1rem;
    padding-bottom: 5rem;
}

.modal-backdrop{
    position:fixed;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px; 
    transition-property: opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.modal-cover{
    position:fixed;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px; 
    background-color:var(--global--color-red);
    opacity:0.75;
}

.modal-shim{
    display:none;
}


.modal-background{
    background-color:#fff;
    border-radius: 0.75rem;
    display:inline-block;
    vertical-align: bottom;
    text-align: left;
    overflow: hidden;

    --tw-shadow: 0 20px 25px -5px rgba(0,0,0,0.1),0 10px 10px -5px rgba(0,0,0,0.04);
    box-shadow: var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow);

    --tw-translate-x: 0;
    --tw-translate-y: 0;
    --tw-rotate: 0;
    --tw-skew-x: 0;
    --tw-skew-y: 0;
    --tw-scale-x: 1;
    --tw-scale-y: 1;
    transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
    transition-property: all;
    transition-timing-function: cubic-bezier(.4,0,.2,1);
    transition-duration: .15s;
}

.modal-background.wide{
    width:100%; 
}

.modal-background.slim{
    max-width:32rem;
}

.modal-padding{
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
    padding-top: 1.25rem;
}

.modal-close{
    height: 3rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
}

.modal-close button{
    border:none;
    cursor:pointer;
    border-radius: .375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    padding: .5rem;
    transition-property: background-color,border-color,color,fill,stroke,opacity,box-shadow,transform;
    transition-timing-function: cubic-bezier(.4,0,.2,1);
    transition-duration: .15s;
}



.modal-close button:hover{
    --tw-text-opacity: 1;
    color: rgba(34,57,88,var(--tw-text-opacity));
}

.modal-close button:focus{
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.modal-content{
    flex-grow: 1;
    margin-top: .75rem;
    text-align: center;
}

.modal-content h3{
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 2rem;
    line-height: 1.5rem;
    margin-bottom: 1.5rem;
    margin-top: 2.5rem;
}

.modal-footer{
    padding-top: .75rem;
    padding-bottom: .75rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px){

    /* Modal related stuff */
    .modal-container{
        display: block;
        padding: 0;
    }
    .modal-shim{
        display: inline-block;
        height: 100vh;
        vertical-align: middle;
    }
    .modal-background{
        margin-top: 2rem;
        margin-bottom: 2rem;
        vertical-align: middle;
    }

    .modal-background.slim{
        max-width: 20rem;
    }
    
    .modal-background.wide{
        width: 83.333333%;
    }
    
    .modal-padding{
        padding: 2.5rem;
        padding-bottom: 2rem;
    }
    
    .modal-inner{
        display: flex;
        align-items: flex-start;
    }
    
    .modal-close{
        height: 2.5rem;
        margin-left: 0;
        margin-right: 0;
        width: 2.5rem;
        top:2rem;
        right:2rem;
    }
    
    .modal-content{
        
    }
    
    .modal-footer{
        margin-top: 0;
        text-align: left;
        flex-grow:1;
    }

}

/* Backdrop: Smooth, slightly slower fade */
.modal-backdrop {
    transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container: Snappier "pop" effect */
.modal-background {
    transition: opacity 300ms ease-out, transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop {
    backdrop-filter: blur(4px); /* Modern frosted glass effect */
}

.theme-red .modal-background{
    background-color:var(--global--color-red);
    color:#fff
}

.theme-blue .modal-background{
    background-color:var(--global--color-blue);
    color:#fff;
}

.theme-blue button{
    background-color:#fff;
}
.theme-blue button:hover{
    background-color:rgba(255,255,255,0.7);
}

.theme-red button{
    background-color:#fff;
}
.theme-red button:hover{
    background-color:rgba(255,255,255,0.7);
}

.theme-blue a.modal-link,
.theme-red a.modal-link{
    background-color:#fff;
}
.theme-blue a.modal-link:hover,
.theme-red a.modal-link:hover{
    background-color:rgba(255,255,255,0.7);
}

.theme-blue a.modal-link,.theme-blue a.modal-link:hover{
    color:var(--global--color-blue);
}
.theme-red a.modal-link,.theme-red a.modal-link:hover{
    color:var(--global--color-red);
}