#crm-modal-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

#crm-modal-box {
    background: #ffffff;
    padding: 28px 26px 22px;
    width: 92%;
    max-width: 440px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    position: relative;
    overflow: hidden;
}
#crm-modal-box * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

#crm-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0f766e;
    background: rgba(45, 212, 191, 0.15);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}

#crm-modal-badge span.flag {
    font-size: 14px;
}

#crm-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 8px;
}

#crm-modal-message {
    font-size: 15px;
    line-height: 1.5;
    color: #475569;
    margin: 0 0 18px;
}

#crm-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

#crm-modal-btn-primary,
#crm-modal-btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 999px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

#crm-modal-btn-primary {
    background: #0f766e;
    color: #ecfeff;
    box-shadow: 0 10px 25px rgba(15, 118, 110, 0.35);
}

#crm-modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 118, 110, 0.4);
    background: #0d9488;
}

#crm-modal-btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

#crm-modal-btn-secondary:hover {
    background: #cbd5f5;
}

#crm-modal-close-x {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 14px;
    cursor: pointer;
    color: #94a3b8;
    padding: 6px;
    line-height: 1;
}

#crm-modal-close-x:hover {
    color: #64748b;
}

@media (max-width: 480px) {
    #crm-modal-box {
        padding: 22px 18px 18px;
    }
    #crm-modal-title {
        font-size: 18px;
    }
    #crm-modal-message {
        font-size: 14px;
    }
    #crm-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
    #crm-modal-btn-primary,
    #crm-modal-btn-secondary {
        width: 100%;
    }
}

/* Emphasise the Location Notice badge label */
#crm-modal-badge .badge-label {
    font-weight: 800;
}

/* Location Notice button reset inside modal (Option 1: isolate from theme styles) */
#crm-modal-box .ln-button {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 28px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit !important; /* inherit from #crm-modal-box (which may be set via plugin font option) */
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
    border: none;
    margin: 0;
    white-space: nowrap;
}

/* Primary CTA inside Location Notice modal */
#crm-modal-box #crm-modal-btn-primary.ln-button {
    background: #0f766e;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(15, 118, 110, 0.35);
}

/* Secondary CTA inside Location Notice modal */
#crm-modal-box #crm-modal-btn-secondary.ln-button {
    background: #e2e8f0;
    color: #0f172a;
}

/* Redirect message below buttons / in loading state */
#crm-modal-redirect-message {
    margin-top: 16px;
    font-size: 15px;
    color: #0f172a;
    opacity: 0.9;
    display: none;
}

/* Loading state: keep modal box, center big spinning globe */
#crm-modal-box.crm-loading {
    text-align: center;
    padding-top: 40px;
    padding-bottom: 32px;
}

#crm-modal-box.crm-loading #crm-modal-badge {
    justify-content: center;
    background: transparent;
    box-shadow: none;
    margin-bottom: 12px;
}

#crm-modal-box.crm-loading #crm-modal-badge .flag {
    font-size: 48px;
    animation: crm-spin-globe 1s linear infinite;
}

#crm-modal-box.crm-loading #crm-modal-redirect-message {
    display: block;
    margin-top: 18px;
    font-size: 16px;
}

/* Spin animation for globe */
@keyframes crm-spin-globe {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
