/* =========================================
   SAFER HAVEN.AI - MODAL STYLES
   Discovery Call Calendly Integration
   ========================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 11, 77, 0.9);
    /* Brand Navy with Opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(8px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--color-white, #ffffff);
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    max-height: 850px;
    position: relative;
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(253, 183, 26, 0.2);
    /* Subtle Gold Border */
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    border-radius: 50%;
}

.modal-close:hover {
    transform: rotate(90deg);
    background-color: rgba(30, 11, 77, 0.05);
}

.modal-close svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-primary, #1E0B4D);
}

.modal-content {
    flex: 1;
    width: 100%;
    height: 100%;
}

/* Loading Spinner for Calendly */
.modal-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(253, 183, 26, 0.2);
    border-top-color: var(--color-gold, #FDB71A);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal-loader p {
    color: var(--color-primary, #1E0B4D);
    font-family: var(--font-heading);
    font-weight: 500;
}

/* Scroll Lock */
body.modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .modal-container {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        background-color: var(--color-white, #ffffff);
        box-shadow: var(--shadow-md);
    }
}